python-hcalendar is a basic hCalendar parser
Project description
Basic hCalendar Parser
======================
Dependencies
------------
- isodate [http://pypi.python.org/pypi/isodate/]
- Beautiful Soup 4 [http://www.crummy.com/software/BeautifulSoup/]
Installation
-------------
Install all dependencies by using the following commands:
pip install -r requirements.txt
Install the parser by cloning the source from github.com:
pip install git+https://github.com/mback2k/python-hcalendar.git
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
</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>
</div></div>"""
hcal = hCalendar(html)
for cal in hcal:
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?
======================
Dependencies
------------
- isodate [http://pypi.python.org/pypi/isodate/]
- Beautiful Soup 4 [http://www.crummy.com/software/BeautifulSoup/]
Installation
-------------
Install all dependencies by using the following commands:
pip install -r requirements.txt
Install the parser by cloning the source from github.com:
pip install git+https://github.com/mback2k/python-hcalendar.git
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
</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>
</div></div>"""
hcal = hCalendar(html)
for cal in hcal:
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?
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python-hcalendar-0.1.3dev.zip
(10.9 kB
view hashes)
Built Distribution
python-hcalendar-0.1.3dev.win32.exe
(206.9 kB
view hashes)
Close
Hashes for python-hcalendar-0.1.3dev.win32.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e202b1d47ee94c9d36ee511d732565aded3ce4c5574a99240b6519203cd8c97 |
|
MD5 | 9e42f4cd097afdb16837045e36ecdca2 |
|
BLAKE2b-256 | 6d5cf0760321dacf82f6b21a621c7fda9d3a72b9fdc5c1667aae2d05aa68b041 |