Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/idlesign/icalendar_light
Light and easy iCalendar event reader
https://github.com/idlesign/icalendar_light
icalendar icalendar-parsing ics python python3
Last synced: 4 days ago
JSON representation
Light and easy iCalendar event reader
- Host: GitHub
- URL: https://github.com/idlesign/icalendar_light
- Owner: idlesign
- License: bsd-3-clause
- Created: 2020-02-18T11:52:36.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-12-08T06:13:34.000Z (almost 4 years ago)
- Last Synced: 2024-10-30T04:51:20.672Z (14 days ago)
- Topics: icalendar, icalendar-parsing, ics, python, python3
- Language: Python
- Homepage: https://github.com/idlesign/icalendar_light
- Size: 19.5 KB
- Stars: 18
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG
- Contributing: CONTRIBUTING
- License: LICENSE
Awesome Lists containing this project
README
icalendar_light
===============
https://github.com/idlesign/icalendar_light|release| |lic| |ci| |coverage|
.. |release| image:: https://img.shields.io/pypi/v/icalendar_light.svg
:target: https://pypi.python.org/pypi/icalendar_light.. |lic| image:: https://img.shields.io/pypi/l/icalendar_light.svg
:target: https://pypi.python.org/pypi/icalendar_light.. |ci| image:: https://img.shields.io/travis/idlesign/icalendar_light/master.svg
:target: https://travis-ci.org/idlesign/icalendar_light.. |coverage| image:: https://img.shields.io/coveralls/idlesign/icalendar_light/master.svg
:target: https://coveralls.io/r/idlesign/icalendar_lightDescription
-----------*Light and easy iCalendar event reader*
No fancy stuff, just iCalendar (``.ics``) events reading.
* Requires Python 3.6+;
* Uses ``namedtuple`` for event representation;
* Features iterative event reading to be fast and minimize memory usage.API
---.. code-block:: python
from icalendar_light.toolbox import Calendar
for event in Calendar.iter_events_from_file('my_calendar.ics'):
print(Calendar.event_stringify(event))# Or get events upcoming in next 5 days from iCalendar represented as lines:
lines = [] # Let's imagine this one is not empty %)
events = Calendar.iter_events_upcoming(lines, days_forward=5)CLI
---Requires `click` package (can be installed with: `pip install icalendar_light[cli]`).
.. code-block:: bash
; Show upcoming event for next 90 days
$ icalendar_light upcoming my_calendar.ics --days 90