Anthony Kong
Anthony Kong

Reputation: 40844

How to parse an ical file and export event to a list?

I have an iCal file. I would like to be able to extract all events into a list. Is there any tools or library that can do it easily? (e.g. handle the time zone info)

Python is the preferred language, but any interpretive language is OK.

Upvotes: 2

Views: 1462

Answers (2)

User
User

Reputation: 14883

You can use the icalendar package for this.

source = """BEGIN:VCALENDAR
...
""" # your source string from a file
import icalendar
cal = icalendar.Calendar.from_ical(source)
events = cal.walk("VEVENT")


Upvotes: 0

RaM
RaM

Reputation: 1107

http://sourceforge.net/projects/dday-ical/ is quite a good .net library for ical. the object model is really good as well

Upvotes: 2

Related Questions