Skip to content


ics is a pythonic iCalendar library. Its goals are to read and write ics data in a developer-friendly way.


Install using pip:

pip install ics


ics will delete all data that it doesn't understand. Maybe it's better for your case to build a parse for ics.

Import a calendar from a file

file = '/tmp/event.ics'

from ics import Calendar

with open(file, 'r') as fd:
    calendar = Calendar(

# <Calendar with 118 events and 0 todo>

# {<Event 'Visite de "Fab Bike"' begin:2016-06-21T15:00:00+00:00 end:2016-06-21T17:00:00+00:00>,
# <Event 'Le lundi de l'embarqué: Adventure in Espressif Non OS SDK edition' begin:2018-02-19T17:00:00+00:00 end:2018-02-19T22:00:00+00:00>,
#  ...}
event = list(calendar.timeline)[0]

Export a Calendar to a file

with open('my.ics', 'w') as f:
# And it's done !

# iCalendar-formatted data is also available in a string


Last update: 2022-10-14