django_ical.feedgenerator

iCalendar feed generation library – used for generating iCalendar feeds.

Sample usage:

>>> from django_ical import feedgenerator
>>> from datetime import datetime
>>> feed = feedgenerator.ICal20Feed(
...     title="My Events",
...     link="http://www.example.com/events.ical",
...     description="A iCalendar feed of my events.",
...     language="en",
... )
>>> feed.add_item(
...     title="Hello",
...     link="http://www.example.com/test/",
...     description="Testing."
...     start_datetime=datetime(2012, 5, 6, 10, 00),
...     end_datetime=datetime(2012, 5, 6, 12, 00),
... )
>>> fp = open('test.ical', 'w')
>>> feed.write(fp, 'utf-8')
>>> fp.close()

For definitions of the iCalendar format see: http://www.ietf.org/rfc/rfc2445.txt

class django_ical.feedgenerator.ICal20Feed(title, link, description, language=None, author_email=None, author_name=None, author_link=None, subtitle=None, categories=None, feed_url=None, feed_copyright=None, feed_guid=None, ttl=None, **kwargs)

iCalendar 2.0 Feed implementation.

write(outfile, encoding)

Writes the feed to the specified file in the specified encoding.

write_items(calendar)

Write all events to the calendar

django_ical.feedgenerator.DefaultFeed

alias of django_ical.feedgenerator.ICal20Feed