icemac.recurrence

Compute recurrences of events


Keywords
calendar, event, recurring, recurrence, datetime, python, recurring-events
License
MIT
Install
pip install icemac.recurrence==1.4.1

Documentation

This package provides helper functions to compute recurrences of events in a environment using the Zope Component Architecture (ZCA).

Copyright (c) 2013-2019 Michael Howitz

This package is licensed under the MIT License, see LICENSE.txt inside the package.

https://travis-ci.com/icemac/icemac.recurrence.svg?branch=master Current version on PyPI Supported Python versions Supported Python implementations

Usage

  • Register the package at the ZCA via ZCML:

    <include package="icemac.recurrence" />
    
  • Compute recurrences. The example computes the 2nd Tuesday each month.:

    >>> from icemac.recurrence import get_recurrences
    >>> get_recurrences(
    ...     datetime=datetime(2015, 10, 13, 11, 15),
    ...     period='nth weekday of month',
    ...     interval_start=datetime(2015, 1, 1),
    ...     interval_end=datetime(2015, 12, 31))
    [datetime(2015, 10, 13, 11, 15),
     datetime(2015, 11, 10, 11, 15),
     datetime(2015, 12, 8, 11, 15)]
    
  • Supported recurrence periods:

    • daily
    • weekly
    • biweekly
    • nth weekday of month
    • nth weekday every other month
    • nth weekday from end of month
    • nth weekday from end of other month
    • yearly

Hacking

Source code

Get the source code:

$ git clone https://github.com/icemac/icemac.recurrence

or fork me on: https://github.com/icemac/icemac.recurrence

Running the tests

You have to install tox onto your machine.

To run the tests yourself call:

$ tox