https://github.com/mback2k/python-hcalendar
Basic hCalendar Parser implemented in Python
https://github.com/mback2k/python-hcalendar
Last synced: 4 months ago
JSON representation
Basic hCalendar Parser implemented in Python
- Host: GitHub
- URL: https://github.com/mback2k/python-hcalendar
- Owner: mback2k
- License: mit
- Created: 2012-04-06T09:59:10.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2022-12-26T20:53:19.000Z (over 3 years ago)
- Last Synced: 2025-09-25T04:56:53.787Z (8 months ago)
- Language: Python
- Homepage:
- Size: 77.1 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
Basic hCalendar Parser
======================
Dependencies
------------
- isodate [http://pypi.python.org/pypi/isodate/]
- Beautiful Soup 4 [http://www.crummy.com/software/BeautifulSoup/]
Installation
-------------
Install the latest version from pypi.python.org:
pip install python-hcalendar
Install the development version 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 = """
http://conferences.oreillynet.com/pub/w/40/program.html
Web 2.0 Conference:
October 5-
7,
at the Argent Hotel, San Francisco, CA
"""
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?
License
-------
* Released under MIT License
* Copyright (c) 2012-2019 Marc Hoersken