icalendar.prop.geo module#
GEO property values from RFC 5545.
- class icalendar.prop.geo.vGeo(geo, /, params=None)[source]#
Bases:
objectGeographic position.
This property specifies information related to the global position for the activity specified by a calendar component.
This property value specifies latitude and longitude, in that order. The acceptable ranges are
-90.000000to+90.000000for latitude and-180.000000to+180.000000for longitude. The longitude and latitude values may be specified up to six decimal places, which will allow for accuracy to within one meter of geographical position.This property can be specified in VEVENT or VTODO calendar components.
- Raises:
ValueError – if geo is not a tuple of (latitude, longitude).
Examples
GEO:37.386013;-122.082932
Parse vGeo:
>>> from icalendar.prop import vGeo >>> geo = vGeo.from_ical('37.386013;-122.082932') >>> geo (37.386013, -122.082932)
Add a geographic location to an event:
>>> from icalendar import Event >>> event = Event() >>> latitude = 37.386013 >>> longitude = -122.082932 >>> event.add('GEO', (latitude, longitude)) >>> event['GEO'] vGeo((37.386013, -122.082932))
- 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
- property ical_value: tuple[float, float]#
Geographic position as a tuple of (latitude, longitude) according to RFC 5545 Section 3.8.1.6.
- params: Parameters#