New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

python-hcalendar

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

python-hcalendar

python-hcalendar is a basic hCalendar parser

  • 0.2.4
  • PyPI
  • Socket score

Maintainers
1

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 = """<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. 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

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc