Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython

python-hcalendar is unavailable in PyPM, because there aren't any builds for it in the package repositories. Click the linked icons to find out why.

 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.1.2dev Failed View build log
Windows (64-bit)
0.1.2dev Failed View build log
Mac OS X (10.5+)
0.1.2dev Failed View build log
Linux (32-bit)
0.1.2dev Failed View build log
0.1dev Failed View build log
Linux (64-bit)
0.1.2dev Failed View build log
0.1dev Failed View build log
 
Links
Author
License
MIT
Lastest release
version 0.1.2dev on Jun 10th, 2013

Basic hCalendar Parser

Installation

Install all dependencies by using the following commands:

pip install isodate pip install BeautifulSoup4

Install the parser by cloning the source from github.com:

git clone git://github.com/mback2k/python-hcalendar.git hcalendar
Basic Example

The hCalendar class accepts file-like objects and strings, basically anything supported by BeautifulSoup

from hcalendar import hCalendar

html = """<div class="vcalendar"><div class="vevent">
<a class="url" href="http://conferences.oreillynet.com/pub/w/40/program.html">
http://conferences.oreillynet.com/pub/w/40/program.html

System Message: WARNING/2 (<string>, line 29)

Definition list ends without a blank line; unexpected unindent.

</a> <span class="summary">Web 2.0 Conference</span>: <abbr class="dtstart" title="2005-10-05">October 5</abbr>- <abbr class="dtend" title="2005-10-07">7</abbr>, at the <span class="location">Argent Hotel, San Francisco, CA</span>

System Message: WARNING/2 (<string>, line 34)

Definition list ends without a blank line; unexpected unindent.

</div></div>"""

hcal = hCalendar(html) for cal in hcal:

System Message: ERROR/3 (<string>, line 38)

Unexpected indentation.
for event in cal:
print event.url print event.summary print event.dtstart print event.dtend print event.location

HTML source code taken from [microformats.org](http://microformats.org/wiki/hcalendar). Output will look like this:

http://conferences.oreillynet.com/pub/w/40/program.html Web 2.0 Conference 2005-10-05 00:00:00 2005-10-07 00:00:00 Argent Hotel, San Francisco, CA

TODO

  • Implement support for hCard contacts and attendees
  • Implement support for geo locations
  • Maybe support for other microformats?

Subscribe to package updates

Last updated Jun 10th, 2013

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.