# django-ical 1.9.2 documentation

## 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', 'wb')
    >>> feed.write(fp, 'utf-8')
    >>> fp.close()

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

django_ical.feedgenerator.DefaultFeed

  alias of `ICal20Feed`

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, stylesheets=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 elements to the calendar