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:: ics
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:: ics
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 .request_status import vRequestStatus
74from .text import vText
75from .uid import vUid
76from .unknown import vUnknown
77from .uri import vUri
78from .xml import vXml
79from .xml_reference import vXmlReference
80
81VPROPERTY: TypeAlias = (
82 vAdr
83 | vBoolean
84 | vBroken
85 | vCalAddress
86 | vCategory
87 | vDDDLists
88 | vDDDTypes
89 | vDate
90 | vDatetime
91 | vDuration
92 | vFloat
93 | vFrequency
94 | vInt
95 | vMonth
96 | vN
97 | vOrg
98 | vPeriod
99 | vRecur
100 | vSkip
101 | vText
102 | vTime
103 | vUTCOffset
104 | vUri
105 | vWeekday
106 | vInline
107 | vBinary
108 | vGeo
109 | vUnknown
110 | vXmlReference
111 | vXml
112 | vUid
113 | vRequestStatus
114)
115
116__all__ = [
117 "DT_TYPE",
118 "VPROPERTY",
119 "AdrFields",
120 "NFields",
121 "TimeBase",
122 "TypesFactory",
123 "vAdr",
124 "vBinary",
125 "vBoolean",
126 "vBroken",
127 "vCalAddress",
128 "vCategory",
129 "vDDDLists",
130 "vDDDTypes",
131 "vDate",
132 "vDatetime",
133 "vDuration",
134 "vFloat",
135 "vFrequency",
136 "vGeo",
137 "vInline",
138 "vInt",
139 "vMonth",
140 "vN",
141 "vOrg",
142 "vPeriod",
143 "vRecur",
144 "vRequestStatus",
145 "vSkip",
146 "vText",
147 "vTime",
148 "vUTCOffset",
149 "vUid",
150 "vUnknown",
151 "vUri",
152 "vWeekday",
153 "vXml",
154 "vXmlReference",
155]