Python Calendar Parsing Solution for Google Calendar

I am trying to analyze the repetition field of GCal. Usually it looks like this:

DTSTART;TZID=Europe/Kiev:20101111T140000
DTEND;TZID=Europe/Kiev:20101111T150000
RRULE:FREQ=DAILY;UNTIL=20101112T120000Z
BEGIN:VTIMEZONE
TZID:Europe/Kiev
X-LIC-LOCATION:Europe/Kiev
BEGIN:DAYLIGHT
TZOFFSETFROM:+0200
TZOFFSETTO:+0300
TZNAME:EEST
DTSTART:19700329T030000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0300
TZOFFSETTO:+0200
TZNAME:EET
DTSTART:19701025T040000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE

I need to extract a part that is valuable to me: the DTSTART, DTEND, RRULE events and another iCaledar field. Is there an existing solution for this?

+3
source share
3 answers

You can try the fantastic python-dateutil library (http://labix.org/python-dateutil).

+3
source

I am using the mxm icalendar package:

http://codespeak.net/icalendar/

, . , , , , .

+1

-, , pypi , DTSTART, DTEND, RRULE, RDATE, UID SUMMARY, , RRULE.

: http://pypi.python.org/pypi/pyICSParser ( , SW, , )

0
source

Source: https://habr.com/ru/post/1774108/


All Articles