Skip to main content

Fast, yet simple, iCalendar reader with excellent recurrence support.

Project description

iCal-library

Fast, yet simple, iCalendar reader with excellent recurrence support. RFC 5545 compliant.

Coverage Package version Supported Python versions


Documentation: https://jorricks.github.io/iCal-library/

Source Code: https://github.com/Jorricks/iCal-library

Features

  • 🚀 Easy python interface. It's as simple as 'client.load_ics_file("<my_file>").timeline' to show all your events of that week.
  • 📈 Timeline support. Show exactly what is planned for a specific week.
  • Fully functional support for recurring iCal components. E.g. Any recurring event will show up as intended within the timeline interface. This includes:
    1. Recurring components/events based on RRule.
    2. Recurring components/events based on RDate.
    3. Excluding components/events based on EXDate.
    4. Any combination of the above three.
    5. Redefined/changed components/events correctly show the latest version.
  • ⏩ Very fast parsing due to lazy evaluation of iCal properties.
  • ⁉️ Debugger supported. Any issues? Open up a debugger and inspect all values.
  • 🔅 Minimal dependencies. Only python-dateutil and pendulum.
  • 🆎 Fully typed code base.

Requirements

Python 3.8+

iCal-library uses two major libraries for their date and time utilities:

Installation

To use iCal-library, first install it using pip:

pip install iCal-library

Example

A simple example. Please look in the docs for more examples.

from ical_library import client

calendar = client.parse_icalendar_file("/home/user/my_icalendar.ics")
print(calendar.events)
print(calendar.todos)
print(calendar.journals)
print(calendar.free_busy_list)
print(calendar.time_zones)

Note: iCal-library is fully Debugger compliant, meaning it is very easy to use a debugger with this project. It will be much faster to see all the different attributes and functions from inside a Python debugger. If you are unsure whether your IDE supports it, take a look here under the sections 'IDEs with Debug Capabilities'.

Limitations

  • Currently, it is not supported to write ICS files. If this is a deal-breaker for you, it should be relatively straight forward to add it, so please consider submitting a PR for this :). However, this will be added shortly!

Why yet another iCalendar library?

I first tried several libraries for iCalendar events. However, none of them supported recurring events as well as they should be. For some libraries my calendar loaded but then didn't show my recurring events, while others simply threw stacktraces trying to load it. Furthermore, I noticed that my calendar (with over 2000 events) took ages to load. After traversing the code of the other libraries I decided I wanted to build my own. With some key principles:

  • Recurring components should be the main priority to get working.
  • No strict evaluation that could lead to errors while parsing the file.
  • Lazy evaluation for iCalendar properties to speed up the process.

Ideas for additional features

  • Support quoted property parameters containing special characters.
  • Support the new Properties for iCalendar (RFC 7986).
  • Support CalDev (RFC 4791).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ical-library-0.2.1.tar.gz (101.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ical_library-0.2.1-py3-none-any.whl (60.7 kB view details)

Uploaded Python 3

File details

Details for the file ical-library-0.2.1.tar.gz.

File metadata

  • Download URL: ical-library-0.2.1.tar.gz
  • Upload date:
  • Size: 101.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for ical-library-0.2.1.tar.gz
Algorithm Hash digest
SHA256 b3e6b748544898b7ff6363eaa2733043cab778f263534b85835d133bb9232caa
MD5 4a72931c2c997f7da2980017f4b9ead0
BLAKE2b-256 097d25b335155ac4d1c70a55c373a970fa6a7d419318e8cbfb853293c2a0b5d7

See more details on using hashes here.

File details

Details for the file ical_library-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: ical_library-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 60.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for ical_library-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5ae564ed269385c80623a8f0f4f6cec8c521f98a1f9331bef6c1446333f33731
MD5 7f53cf2c413b3598fc78ff8cbff79c96
BLAKE2b-256 642d55bb99a5675c978493c8bd645754947d38dd9d5da1bc84c7f8e456f211fd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page