2011-08-17 21:40:23 +00:00
|
|
|
==========================================================
|
|
|
|
Internet Calendaring and Scheduling (iCalendar) for Python
|
|
|
|
==========================================================
|
|
|
|
|
|
|
|
The `icalendar`_ package is a parser/generator of iCalendar files for use
|
|
|
|
with Python.
|
|
|
|
|
|
|
|
|
|
|
|
About this fork
|
|
|
|
===============
|
|
|
|
|
|
|
|
.. warn:: This part should be removed actual before release.
|
|
|
|
|
|
|
|
Aim of this fork is to bring this package up to date with latest RFC
|
|
|
|
specification as part of `plone.app.event`_ project which aims is to bring
|
|
|
|
recurrence evens to `Plone`_.
|
|
|
|
|
|
|
|
Current plan:
|
|
|
|
|
|
|
|
1. Merge bugfixes from forks listed bellow.
|
|
|
|
2. Contact all interested and try to get release 2.2 out.
|
|
|
|
3. Start working on 3.0 to bring package up-to-date with newer iCalendar
|
|
|
|
specification (`RFC 5545`_), while keeping 2.X series to be backwords
|
|
|
|
compatible with `RFC 2445`_.
|
|
|
|
|
|
|
|
Known forks:
|
|
|
|
|
|
|
|
- https://codespeak.net/svn/iCalendar/trunk/
|
|
|
|
The original codespeak repo, which this branch is based on (keeping it up to
|
|
|
|
date in ``svn-trunk`` branch)
|
|
|
|
|
|
|
|
- https://github.com/cozi/icalendar
|
|
|
|
The icalendar fork of the Cozi group with many fixes and additions.
|
|
|
|
Especially ``master-future`` branch is interesting.
|
|
|
|
|
|
|
|
- https://github.com/greut/iCalendar
|
|
|
|
Another repository. All changes except the one from commit
|
|
|
|
#5166fa914593d8366044 were integrated into the cozi fork.
|
|
|
|
|
|
|
|
- https://github.com/ryba-xek/iCalendar
|
|
|
|
Another repo which fixes an Unicode issue with folding. Integrated into
|
|
|
|
cozi.
|
|
|
|
|
|
|
|
- https://github.com/1calendar/icalendar
|
|
|
|
Same as above.
|
|
|
|
|
|
|
|
- https://bitbucket.org/psagers/icalendar
|
|
|
|
Another repo which fixes something also integrated in greut's repo, but not
|
|
|
|
in cozi's. Not sure if we need it.
|
|
|
|
|
|
|
|
|
|
|
|
.. _`icalendar`: http://pypi.python.org/pypi/icalendar
|
|
|
|
.. _`plone.app.event`: http://github.com/collective/plone.app.event
|
|
|
|
.. _`Plone`: http://plone.org
|
|
|
|
.. _`RFC 5545`: http://www.ietf.org/rfc/rfc5545.txt
|
|
|
|
.. _`RFC 2445`: http://www.ietf.org/rfc/rfc2445.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. warn:: Below is content of previous README.
|
2005-03-23 16:26:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-28 12:59:10 +00:00
|
|
|
Introduction
|
|
|
|
============
|
2005-11-07 21:07:56 +00:00
|
|
|
|
2005-04-28 12:59:10 +00:00
|
|
|
I (Max M) have often needed to parse and generate iCalendar
|
|
|
|
files. Finally I got tired of writing ad-hoc tools.
|
2005-11-07 21:07:56 +00:00
|
|
|
|
2005-04-08 14:30:31 +00:00
|
|
|
So this is my attempt at making an iCalendar package for Python. The
|
|
|
|
inspiration has come from the email package in the standard lib, which
|
2005-04-28 12:59:10 +00:00
|
|
|
I think is pretty simple, yet efficient and powerful.
|
2005-03-23 16:26:03 +00:00
|
|
|
|
2005-11-08 14:45:21 +00:00
|
|
|
The package can both generate and parse iCalendar files, and can
|
2005-04-28 13:30:10 +00:00
|
|
|
easily be used as is.
|
|
|
|
|
2005-04-08 14:30:31 +00:00
|
|
|
The aim is to make a package that is fully compliant to RFC 2445, well
|
|
|
|
designed, simple to use and well documented.
|
2005-03-23 16:26:03 +00:00
|
|
|
|
2005-04-28 13:30:10 +00:00
|
|
|
News
|
|
|
|
====
|
|
|
|
|
2008-07-11 18:07:09 +00:00
|
|
|
* 2008-07-11: `iCalendar 2.0`_ released (`changes for 2.0`_)
|
2006-11-25 12:18:51 +00:00
|
|
|
* 2006-11-26: `iCalendar 1.2`_ released (`changes for 1.2`_)
|
2006-11-23 12:39:35 +00:00
|
|
|
* 2006-11-23: `iCalendar 1.1`_ released (`changes for 1.1`_)
|
2006-08-03 14:02:20 +00:00
|
|
|
* 2006-08-03: `iCalendar 1.0`_ released (`changes for 1.0`_)
|
2005-11-08 12:58:10 +00:00
|
|
|
* 2005-11-08: `iCalendar 0.11`_ released (`changes for 0.11`_)
|
2005-04-28 13:30:10 +00:00
|
|
|
* 2005-04-28: `iCalendar 0.10`_ released (`changes for 0.10`_)
|
|
|
|
|
2008-07-11 18:07:09 +00:00
|
|
|
.. _`iCalendar 2.0`: iCalendar-2.0.tgz
|
|
|
|
.. _`changes for 2.0`: changes-2.0.html
|
2006-11-25 12:18:51 +00:00
|
|
|
.. _`iCalendar 1.2`: iCalendar-1.2.tgz
|
|
|
|
.. _`changes for 1.2`: changes-1.2.html
|
2006-11-23 12:39:35 +00:00
|
|
|
.. _`iCalendar 1.1`: iCalendar-1.1.tgz
|
|
|
|
.. _`changes for 1.1`: changes-1.1.html
|
|
|
|
.. _`iCalendar 1.0`: iCalendar-1.0.tgz
|
2006-08-03 14:02:20 +00:00
|
|
|
.. _`changes for 1.0`: changes-1.0.html
|
2005-11-08 12:58:10 +00:00
|
|
|
.. _`iCalendar 0.11`: iCalendar-0.11.tgz
|
|
|
|
.. _`changes for 0.11`: changes-0.11.html
|
2005-04-28 13:30:10 +00:00
|
|
|
.. _`iCalendar 0.10`: iCalendar-0.10.tgz
|
|
|
|
.. _`changes for 0.10`: changes-0.10.html
|
|
|
|
|
|
|
|
Example
|
|
|
|
=======
|
2005-03-23 16:26:03 +00:00
|
|
|
|
2005-04-08 14:30:31 +00:00
|
|
|
To open and parse a file::
|
2005-11-07 21:07:56 +00:00
|
|
|
|
2005-04-29 12:56:17 +00:00
|
|
|
>>> from icalendar import Calendar, Event
|
2005-04-08 14:30:31 +00:00
|
|
|
>>> cal = Calendar.from_string(open('test.ics','rb').read())
|
|
|
|
>>> cal
|
2005-11-07 21:07:56 +00:00
|
|
|
VCALENDAR({'VERSION': vText(u'2.0'), 'METHOD': vText(u'Request'), 'PRODID': vText(u'-//My product//mxm.dk/')})
|
|
|
|
|
2005-04-08 14:30:31 +00:00
|
|
|
>>> for component in cal.walk():
|
|
|
|
... component.name
|
|
|
|
'VCALENDAR'
|
|
|
|
'VEVENT'
|
|
|
|
'VEVENT'
|
2005-11-07 21:07:56 +00:00
|
|
|
|
2005-04-28 12:59:10 +00:00
|
|
|
To create a calendar and write it to disk::
|
2005-11-07 21:07:56 +00:00
|
|
|
|
2005-04-08 14:30:31 +00:00
|
|
|
>>> cal = Calendar()
|
|
|
|
>>> from datetime import datetime
|
2005-11-14 12:37:11 +00:00
|
|
|
>>> from icalendar import UTC # timezone
|
2005-04-08 14:30:31 +00:00
|
|
|
>>> cal.add('prodid', '-//My calendar product//mxm.dk//')
|
|
|
|
>>> cal.add('version', '2.0')
|
2005-11-07 21:07:56 +00:00
|
|
|
|
2005-04-08 14:30:31 +00:00
|
|
|
>>> event = Event()
|
|
|
|
>>> event.add('summary', 'Python meeting about calendaring')
|
2005-11-08 14:49:55 +00:00
|
|
|
>>> 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))
|
2005-04-08 14:30:31 +00:00
|
|
|
>>> event['uid'] = '20050115T101010/27346262376@mxm.dk'
|
|
|
|
>>> event.add('priority', 5)
|
2005-11-07 21:07:56 +00:00
|
|
|
|
2005-04-08 14:30:31 +00:00
|
|
|
>>> cal.add_component(event)
|
2005-11-07 21:07:56 +00:00
|
|
|
|
2005-04-08 14:30:31 +00:00
|
|
|
>>> f = open('example.ics', 'wb')
|
|
|
|
>>> f.write(cal.as_string())
|
|
|
|
>>> f.close()
|
2005-03-23 16:26:03 +00:00
|
|
|
|
2005-04-28 13:30:10 +00:00
|
|
|
More documentation
|
|
|
|
==================
|
|
|
|
|
|
|
|
Consult this example_ for introductory doctests and explanations. Here
|
|
|
|
are two smaller_ examples_.
|
|
|
|
|
|
|
|
.. _example: example.html
|
|
|
|
.. _smaller: small.html
|
|
|
|
.. _examples: groupscheduled.html
|
2005-11-07 21:07:56 +00:00
|
|
|
.. _multiple: multiple.html
|
|
|
|
|
2005-04-28 13:30:10 +00:00
|
|
|
All modules and classes also have doctests that shows how they
|
|
|
|
work. There is also an `interfaces.py`_ file which describes the API.
|
|
|
|
|
|
|
|
.. _`interfaces.py`: interfaces.py
|
2005-03-23 16:26:03 +00:00
|
|
|
|
2005-04-28 12:59:10 +00:00
|
|
|
Mailing list
|
|
|
|
============
|
2005-03-23 16:26:03 +00:00
|
|
|
|
2005-04-28 12:59:10 +00:00
|
|
|
If you have any comments or feedback on the module, please use the iCalendar
|
|
|
|
mailing list. You can subscribe to it here:
|
2005-11-07 21:07:56 +00:00
|
|
|
|
2005-04-28 12:59:10 +00:00
|
|
|
http://codespeak.net/mailman/listinfo/icalendar-dev
|
|
|
|
|
|
|
|
We would love to hear use cases, or get ideas for improvements.
|
|
|
|
|
|
|
|
There is also a checkins mailing list, if you want to follow development:
|
|
|
|
|
|
|
|
http://codespeak.net/mailman/listinfo/icalendar-checkins
|
2005-03-23 16:26:03 +00:00
|
|
|
|
|
|
|
Download
|
2005-04-08 14:30:31 +00:00
|
|
|
========
|
2005-03-23 16:26:03 +00:00
|
|
|
|
2008-07-11 18:07:09 +00:00
|
|
|
* `iCalendar 2.0`_ (2008-07-11)
|
2006-11-25 12:18:51 +00:00
|
|
|
* `iCalendar 1.2`_ (2006-11-26)
|
2006-11-23 12:39:35 +00:00
|
|
|
* `iCalendar 1.1`_ (2006-11-23)
|
|
|
|
* `iCalendar 1.0`_ (2006-08-03)
|
2005-11-08 12:58:10 +00:00
|
|
|
* `iCalendar 0.11`_ (2005-08-11)
|
2005-04-28 13:30:10 +00:00
|
|
|
* `iCalendar 0.10`_ (2005-04-28)
|
|
|
|
|
|
|
|
You can also check out the `development version of iCalendar`_ from
|
|
|
|
subversion, using a command like::
|
|
|
|
|
|
|
|
svn co http://codespeak.net/svn/iCalendar/trunk iCalendar
|
|
|
|
|
|
|
|
.. _`development version of iCalendar`: http://codespeak.net/svn/iCalendar/trunk
|
|
|
|
|
|
|
|
Dependencies
|
|
|
|
============
|
2005-11-07 21:07:56 +00:00
|
|
|
|
2005-04-28 13:30:10 +00:00
|
|
|
It is dependent on the datetime package, so it requires Python >=
|
|
|
|
2.3. There are no other dependencies.
|
2005-03-23 16:26:03 +00:00
|
|
|
|
|
|
|
License
|
2005-04-08 14:30:31 +00:00
|
|
|
=======
|
2005-03-23 16:26:03 +00:00
|
|
|
|
2005-04-08 14:30:31 +00:00
|
|
|
LGPL. See LICENSE.txt for details.
|