icalendar.prop.uri module#
URI values from RFC 5545.
- class icalendar.prop.uri.vUri(value, encoding='utf-8', /, params=None)[source]#
Bases:
strURI
- Value Name:
URI
- Purpose:
This value type is used to identify values that contain a uniform resource identifier (URI) type of reference to the property value.
- Format Definition:
This value type is defined by the following notation:
uri = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
- Description:
This value type might be used to reference binary information, for values that are large, or otherwise undesirable to include directly in the iCalendar object.
Property values with this value type MUST follow the generic URI syntax defined in [RFC3986].
When a property parameter value is a URI value type, the URI MUST be specified as a quoted-string value.
Examples
The following is a URI for a network file:
http://example.com/my-report.txt
>>> from icalendar.prop import vUri >>> uri = vUri.from_ical('http://example.com/my-report.txt') >>> uri vUri('http://example.com/my-report.txt') >>> uri.uri 'http://example.com/my-report.txt'
- property FMTTYPE: str | None#
FMTTYPE specfies the content type of a referenced object.
- Conformance:
RFC 5545 specifies the FMTTYPE. RFC 9253 adds FMTTYPE to LINK properties. In a LINK, FMTTYPE maps to the "type" attribute defined in Section 3.4.1 of RFC 8288. See RFC 6838.
- Description:
This parameter can be specified on properties that are used to reference an object. The parameter specifies the media type RFC 4288 of the referenced object. For example, on the "ATTACH" property, an FTP type URI value does not, by itself, necessarily convey the type of content associated with the resource. The parameter value MUST be the text for either an IANA-registered media type or a non-standard media type.
Example
A Microsoft Word document:
ATTACH;FMTTYPE=application/msword:ftp://example.com/pub/docs/ agenda.doc
A website:
LINK;FMTTYPE=text/html;LINKREL=SOURCE;LABEL=Venue;VALUE=URI: https://example.com/venue
- property LABEL: str | None#
LABEL provides a human-readable label.
- Conformance:
This property parameter is specified in RFC 7986, iCalendar Property Extensions.
RFC 9253 makes use of this for the LINK property. This parameter maps to the "title" attribute defined in Section 3.4.1 of RFC 8288. LABEL is used to label the destination of a link such that it can be used as a human-readable identifier (e.g., a menu entry) in the language indicated by the LANGUAGE (if present). The LABEL MUST NOT appear more than once in a given link; occurrences after the first MUST be ignored by parsers.
- Description:
This property parameter MAY be specified on the "CONFERENCE" property. It is anticipated that other extensions to iCalendar will reuse this property parameter on new properties that they define. As a result, clients MUST expect to find this property parameter present on many different properties. It provides a human-readable label that can be presented to calendar users to allow them to discriminate between properties that might be similar or provide additional information for properties that are not self-describing. The "LANGUAGE" property parameter can be used to specify the language of the text in the parameter value (as per Section 3.2.10 of RFC 5545).
Examples
This is a label of a chat.
CONFERENCE;VALUE=URI;FEATURE=VIDEO; LABEL="Web video chat, access code=76543"; :https://video-chat.example.com/;group-id=1234
- property LANGUAGE: str | None#
Specify the language for text values in a property or property parameter.
- Description:
This parameter identifies the language of the text in the property value and of all property parameter values of the property. The value of the "LANGUAGE" property parameter is that defined in RFC 5646.
For transport in a MIME entity, the Content-Language header field can be used to set the default language for the entire body part. Otherwise, no default language is assumed.
- property LINKREL: str | None#
- Purpose:
LINKREL specifies the relationship of data referenced by a LINK property.
- Conformance:
LINKREL is specified in RFC 9253. This parameter maps to the link relation type defined in Section 2.1 of RFC 8288. It is always quoted.
- Description:
This parameter MUST be specified on all LINK properties and define the type of reference. This allows programs consuming this data to automatically scan for references they support. There is no default relation type. Any link relation in the link registry established by RFC 8288, or new link relations, may be used. It is expected that link relation types seeing significant usage in calendaring will have the calendaring usage described in an RFC.
In the simplest case, a link relation type identifies the semantics of a link. For example, a link with the relation type "copyright" indicates that the current link context has a copyright resource at the link target.
Link relation types can also be used to indicate that the target resource has particular attributes, or exhibits particular behaviours; for example, a "service" link implies that the link target can be used as part of a defined protocol (in this case, a service description).
- Registration:
There are two kinds of relation types: registered and extension. These relation types are registered in RFC 8288.
See also
Examples
This identifies the latest version of the event information.
LINKREL=latest-version
- property RELTYPE: RELTYPE#
Specify the type of hierarchical relationship associated with a component.
- Conformance:
RFC 5545 introduces the RELTYPE property parameter. RFC 9253 adds new values.
- Description:
This parameter can be specified on a property that references another related calendar. The parameter specifies the hierarchical relationship type of the calendar component referenced by the property. The parameter value can be PARENT, to indicate that the referenced calendar component is a superior of calendar component; CHILD to indicate that the referenced calendar component is a subordinate of the calendar component; or SIBLING to indicate that the referenced calendar component is a peer of the calendar component. If this parameter is not specified on an allowable property, the default relationship type is PARENT. Applications MUST treat x-name and iana-token values they don't recognize the same way as they would the PARENT value.
- classmethod from_jcal(jcal_property)[source]#
Parse jCal from RFC 7265.
- Parameters:
jcal_property (
list) – The jCal property to parse.- Raises:
JCalParsingError – If the provided jCal is invalid.
- Return type:
- classmethod from_xcal(xml)[source]#
Parse xCal according to RFC 6321.
- Parameters:
parser – Required. The xCal to parse or a parser.
params – Required. The parameters of the xCal element.
- Raises:
XCalParsingError – If the provided xCal is invalid.
- Return type:
VProp
- params: Parameters#