iCalendariCalendar package for Python | |
Download |
iCalendar Ranking & Summary
Advertisement
iCalendar Tags
iCalendar Description
iCalendar package for Python iCalendar is a generator/parser of iCalendar files for use with Python. It follows the RFC 2445 (iCalendar) specification.Example:To open and parse a file:>>> from icalendar import Calendar, Event>>> cal = Calendar.from_string(open('test.ics','rb').read())>>> calVCALENDAR({'VERSION': vText(u'2.0'), 'METHOD': vText(u'Request'), 'PRODID': vText(u'-//My product//mxm.dk/')})>>> for component in cal.walk():... component.name'VCALENDAR''VEVENT''VEVENT'To create a calendar and write it to disk:>>> cal = Calendar()>>> from datetime import datetime>>> from icalendar import UTC # timezone>>> cal.add('prodid', '-//My calendar product//mxm.dk//')>>> cal.add('version', '2.0')>>> event = Event()>>> event.add('summary', 'Python meeting about calendaring')>>> event.add('dtstart', datetime(2005,4,4,8,0,0,tzinfo=UTC))>>> event.add('dtend', datetime(2005,4,4,10,0,0,tzinfo=UTC))>>> event.add('dtstamp', datetime(2005,4,4,0,10,0,tzinfo=UTC))>>> event = '20050115T101010/27346262376@mxm.dk'>>> event.add('priority', 5)>>> cal.add_component(event)>>> f = open('example.ics', 'wb')>>> f.write(cal.as_string())>>> f.close() Requirements: · Python What's New in This Release: · Fixed a string index out of range error in the new folding code.
iCalendar Related Software