Skip to content
Go to file

Latest commit

For my current PR #240 I'm adding `hypothesis` as a test dependency to allow generation of random input strings to better test parsing and escaping logic (see e44e4b3). I also changed how we load the grammar file, to make the package zip safe again (see 3cafe53). While working on how these could be integrated into our testsuite, I found out that ` test` is deprecated ([1](pytest-dev/pytest#5534) [2]( The recommendation was to use `tox` to test the generated package directly using `pytest` instead of relying on `` to test the sources. Additionally, there's a designated successor to `` and `setup.cfg` (in which we probably accumulated a few outdated definitions), the build-system independent `pyproject.toml`. Additionally, there are newer tools like `pipenv`, `flit` and `poetry` to help with the whole build and publishing process. As I was not quite happy with how the whole development process of was set up, I wanted to give them a shot. Collecting some opinion around the internet, it seemed that `flit` was mostly targeted at very simple low-configuration projects and the development of `pipenv` somehow stagnated, while `poetry` seemed to be a well suited solution.

So this PR contains my attempt at migrating to `poetry`, with all sources moved according to the new recommended format.
It's mostly the config files in the root directory that changed, but I also removed the `dev` directory as it should no longer be needed. Next to all files from the `./ics/` directory remain unchanged and are simply moved to `./src/ics/`. I didn't copy the tests over yet, as I plan to rewrite most of them in my other branch.
The first of the two main configuration files is now `pyproject.toml`, where all meta-information on the project and how it can be installed (i.e. dependencies) and built are stored (without the need to actually execute the file and have some specific setuptools lying around). The second is `tox.ini`, where all testing related functionality is configured. A third file `.bumpversion.cfg` is from a small tool that helps with updating the version number in all places when doing a new release. The `poetry.lock` file optionally stores the dependency versions against which we want to develop, which is independent from the versions the library pulls in as dependency itself, where we are pretty liberal, and the versions we test against, which is always the latest releases. All library sourcecode now resides within a `src` folder, which is recommended as it prevents you from accidentally having the sources in your PATH when you want to test the final package.

The root directory now looks very clean and all those files have their specific purpose. If you want to configure how testing is done, you find all information in [`tox.ini`]( If you want to run the tests (i.e. pytest, doctest, flake8, mypy and check that the docs build), simply run `tox` - you don't have to worry about which versions in which venvs are installed and whether you're directly testing against the sources or against a built package, tox handles all that for you. This not only comes in very handy when running the tests manually, but should also ensure that [CI]( does exactly the same. On a side note, we're now again publishing [coverage data](

If you just want to run the tests and don't need to fiddle around with the development version of ics in an interactive shell, that's all you need. For the fiddling part, just run [`poetry install`]( and you will have a turnkey development environment set up. Use `poetry shell` or `poetry run` to easily access the venv poetry set up for you. Publishing is now also very simple: just call `poetry publish --build` and the tool will take care of the rest. This made it very easy to make some releases on the [testing pypi instance](

The third and last tool you might want is `bumpversion`, if you are making new releases. But there is no need anymore to handle any venvs yourself or to install all dependencies globally. To summarize, if you want to hit the ground running and publish a new release on a newly set-up machine, the following should suffice:

git clone && cd
pip install tox poetry bumpversion --user
tox # make sure all the test run
bumpversion --verbose release # 0.8.0-dev -> 0.8.0 (release)
poetry build # build the package
tox --recreate # ensure that the version numbers are consistent
# check changelog and amend if necessary
git push && git push --tags
poetry publish # publish to pypi
bumpversion --verbose minor # 0.8.0 (release) -> 0.9.0-dev
git push && git push --tags

You can try that out if you want -- except for the publishing part maybe. Also note that `bumpversion` directly makes a commit with the new version if you don't pass `--no-commit` or `--dry-run`, but that's no problem as you can easily amend any changes you want to make, e.g. to the changelog.

The above information on developing, testing and publishing can now also be found in the docs (see CONTRIBUTING.rst). As these changes are partially based upon #240 but are also quite fundamental, I wanted to collect feedback first before including the changes into #240. The only other thing #240 is still lacking is more testing (only few files already have close to 100% coverage), and I'd prefer to provide that using `tox` in this new environment. So that's also some kind of cyclic dependency.

Sorry for the (now superfluous) issue I opened before. So @C4ptainCrunch (and maybe also @aureooms and @tomschr), what's your opinion on this?

* migrate repo structure to poetry

* fix src path for pytest

* add doc skeleton

* implement handling of attachments

* import project files

* set version

* fix sphinx build with poetry

* don't use poetry within tox

see python-poetry/poetry#1941 (comment)

* fix timezone tests

* change coveralls action

* try codecov

* bugfixes

* add bumpversion

* separate src inspection (flake8+mypy src/) from package testing (pytest tests/) to fix PATH problems

* bugfixes

* Merge branch 'master' into new-parser-impl

* remove old files

* add dev and publish instructions

* checker happiness

`noqa` and `type: ignore` are now only used for actual bugs in the checkers
unfortunately, current pyflakes dislikes `type: ignore[something]`, so we can't ignore specific mypy bugs until pyflakes 2.2 is in flakes8

* more checker happiness

* Apply suggestions from code review

Co-Authored-By: Tom Schraitle <>

* use gitignore directly from github instead of

* Apply suggestions from code review to tox.ini

* fix tox.ini

* add pypy support

Mostly by moving/splitting test dependencies to different sections in
tox.ini as mypy and pypy don't work well together and it is sufficient
to run mypy checks on CPython.

* update developing documentation

* fix non-ASCII whitespace handling

* update test/dev dependencies
0b028d3 3

Git stats


Failed to load latest commit information.

README.rst 0.8.0-dev : iCalendar for Humans

Original repository (GitHub) - Bugtracker and issues (GitHub) - PyPi package (ics) - Documentation (Read The Docs).

Apache 2 License is a pythonic and easy iCalendar library. Its goals are to read and write ics data in a developer friendly way.

iCalendar is a widely-used and useful format but not user friendly. is there to give you the ability of creating and reading this format without any knowledge of it.

It should be able to parse every calendar that respects the rfc5545 and maybe some more… It also outputs rfc compliant calendars.

iCalendar (file extension .ics) is used by Google Calendar, Apple Calendar, Android and many more. is available for Python>=3.6 and is Apache2 Licensed.


$ pip install ics
from ics import Calendar, Event
c = Calendar()
e = Event() = "My cool event"
e.begin = '2014-01-01 00:00:00'
# [<Event 'My cool event' begin:2014-01-01 00:00:00 end:2014-01-01 00:00:01>]
with open('my.ics', 'w') as my_file:
# and it's done !

More examples are available in the documentation.


All the documentation is hosted on and is updated automatically at every commit.


Contribution are welcome of course! For more information, see contributing.

Testing & Docs

# setup virtual environment
$ sudo pip install virtualenv
$ virtualenv ve
$ source ve/bin/activate

# tests
$ pip install -r requirements.txt
$ pip install -r dev/requirements-test.txt
$ python test

# tests coverage
$ pip install -r requirements.txt
$ pip install -r dev/requirements-test.txt
$ python test
$ coverage html
$ firefox htmlcov/index.html

# docs
$ pip install -r requirements.txt
$ pip install -r dev/requirements-doc.txt
$ cd doc
$ make html


Parse ALL the calendars!
You can’t perform that action at this time.