A module which unfolds ICalendar events.
Project description
ICal has some complexity to it: Events can be repeated, removed from the feed and edited later on. This tool takes care of these circumstances.
Let’s put our expertise together and build a tool that can solve this!
day light saving time
recurring events
recurring events with edits
recurring events where events are omitted
recurring events events where the edit took place later
normal events
recurrence of dates but not hours, minutes, and smaller
endless recurrence
ending recurrence
events with start date and no and date
events with start as date and start as datetime
RRULE, RDATE, EXDATE
import requests
import icalendar
import datetime
import recurring_ical_events
today = datetime.datetime.today()
one_year_ahead = today.replace(year=today.year + 1)
ical_string = requests.get("https://url-to-ical-feed").text
calendar = icalendar.Calendar.from_ical(ical_string)
for event in recurring_ical_events.of(calendar).between(today, one_year_ahead):
print(event["DTSTART"])
Installation
pip install python-recurring-ical-events
Development
- Optional: Install virtualenv and Python3 and create a virtual environment.
virtualenv -p python3 ENV source ENV/bin/activate
- Install the packages.
pip install -r requirements.txt test-requirements.txt
- Run the tests
pytest
Releasing new versions:
python3 setup.py tag_and_deploy
Research
https://github.com/oberron/annum - https://stackoverflow.com/questions/28829261/python-ical-get-events-for-a-day-including-recurring-ones#28829401
https://stackoverflow.com/questions/20268204/ical-get-date-from-recurring-event-by-rrule-and-dtstart
https://stackoverflow.com/questions/46471852/ical-parsing-reoccuring-events-in-python
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for recurring_ical_events-0.0.5a0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2c573bc517d86df2088bd433ad35893b02562d45ec3c6793e5d8ced2d977c1c |
|
MD5 | cb233b78c25ccc78458382996fea0fbd |
|
BLAKE2b-256 | a03ef1cce01215003a5d5ac97f4e0304e4504d3518b85370b18ac72792810906 |