Skip to main content

A module which unfolds ICalendar events.

Project description

Travis Build and Tests Status Python Package Version on Pypi Downloads from Pypi

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

  1. Optional: Install virtualenv and Python3 and create a virtual environment.
    virtualenv -p python3 ENV
    source ENV/bin/activate
  2. Install the packages.
    pip install -r requirements.txt test-requirements.txt
  3. Run the tests
    pytest

To release new versions, edit setup.py, the __version__ variable and run

python3 setup.py tag_and_deploy

Research

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

recurring_ical_events-0.0.7a0.tar.gz (13.7 kB view details)

Uploaded Source

File details

Details for the file recurring_ical_events-0.0.7a0.tar.gz.

File metadata

  • Download URL: recurring_ical_events-0.0.7a0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

File hashes

Hashes for recurring_ical_events-0.0.7a0.tar.gz
Algorithm Hash digest
SHA256 6f5b506b06818f329296844bbf814f61ac4e4fbdd47e0684ecfc773c54da608e
MD5 57b02d2af7b3f4e6fd25add2082d45df
BLAKE2b-256 8f2a793a1f63f51b2b04e9a76553838907ab0acd27397a077c21b82d2e622c0b

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