Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/icalendar/prop/__init__.py: 100%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

24 statements  

1"""This module contains the parser/generators (or coders/encoders if you 

2prefer) for the classes/datatypes that are used in iCalendar: 

3 

4########################################################################### 

5 

6# This module defines these property value data types and property parameters 

7 

84.2 Defined property parameters are: 

9 

10.. code-block:: text 

11 

12 ALTREP, CN, CUTYPE, DELEGATED-FROM, DELEGATED-TO, DIR, ENCODING, FMTTYPE, 

13 FBTYPE, LANGUAGE, MEMBER, PARTSTAT, RANGE, RELATED, RELTYPE, ROLE, RSVP, 

14 SENT-BY, TZID, VALUE 

15 

164.3 Defined value data types are: 

17 

18.. code-block:: text 

19 

20 BINARY, BOOLEAN, CAL-ADDRESS, DATE, DATE-TIME, DURATION, FLOAT, INTEGER, 

21 PERIOD, RECUR, TEXT, TIME, URI, UTC-OFFSET 

22 

23########################################################################### 

24 

25iCalendar properties have values. The values are strongly typed. This module 

26defines these types, calling val.to_ical() on them will render them as defined 

27in rfc5545. 

28 

29If you pass any of these classes a Python primitive, you will have an object 

30that can render itself as iCalendar formatted date. 

31 

32Property Value Data Types start with a 'v'. they all have an to_ical() and 

33from_ical() method. The to_ical() method generates a text string in the 

34iCalendar format. The from_ical() method can parse this format and return a 

35primitive Python datatype. So it should always be true that: 

36 

37.. code-block:: python 

38 

39 x == vDataType.from_ical(VDataType(x).to_ical()) 

40 

41These types are mainly used for parsing and file generation. But you can set 

42them directly. 

43""" 

44 

45from typing import TypeAlias 

46 

47from .adr import AdrFields, vAdr 

48from .binary import vBinary 

49from .boolean import vBoolean 

50from .broken import vBroken 

51from .cal_address import vCalAddress 

52from .categories import vCategory 

53from .dt import ( 

54 DT_TYPE, 

55 TimeBase, 

56 vDate, 

57 vDatetime, 

58 vDDDLists, 

59 vDDDTypes, 

60 vDuration, 

61 vPeriod, 

62 vTime, 

63 vUTCOffset, 

64) 

65from .factory import TypesFactory 

66from .float import vFloat 

67from .geo import vGeo 

68from .inline import vInline 

69from .integer import vInt 

70from .n import NFields, vN 

71from .org import vOrg 

72from .recur import vFrequency, vMonth, vRecur, vSkip, vWeekday 

73from .text import vText 

74from .uid import vUid 

75from .unknown import vUnknown 

76from .uri import vUri 

77from .xml_reference import vXmlReference 

78 

79VPROPERTY: TypeAlias = ( 

80 vAdr 

81 | vBoolean 

82 | vBroken 

83 | vCalAddress 

84 | vCategory 

85 | vDDDLists 

86 | vDDDTypes 

87 | vDate 

88 | vDatetime 

89 | vDuration 

90 | vFloat 

91 | vFrequency 

92 | vInt 

93 | vMonth 

94 | vN 

95 | vOrg 

96 | vPeriod 

97 | vRecur 

98 | vSkip 

99 | vText 

100 | vTime 

101 | vUTCOffset 

102 | vUri 

103 | vWeekday 

104 | vInline 

105 | vBinary 

106 | vGeo 

107 | vUnknown 

108 | vXmlReference 

109 | vUid 

110) 

111 

112__all__ = [ 

113 "DT_TYPE", 

114 "VPROPERTY", 

115 "AdrFields", 

116 "NFields", 

117 "TimeBase", 

118 "TypesFactory", 

119 "vAdr", 

120 "vBinary", 

121 "vBoolean", 

122 "vBroken", 

123 "vCalAddress", 

124 "vCategory", 

125 "vDDDLists", 

126 "vDDDTypes", 

127 "vDate", 

128 "vDatetime", 

129 "vDuration", 

130 "vFloat", 

131 "vFrequency", 

132 "vGeo", 

133 "vInline", 

134 "vInt", 

135 "vMonth", 

136 "vN", 

137 "vOrg", 

138 "vPeriod", 

139 "vRecur", 

140 "vSkip", 

141 "vText", 

142 "vTime", 

143 "vUTCOffset", 

144 "vUid", 

145 "vUnknown", 

146 "vUri", 

147 "vWeekday", 

148 "vXmlReference", 

149]