Skip to content

Functions to compute recurrences of events in a environment using the Zope Component Architecture (ZCA)

License

Notifications You must be signed in to change notification settings

icemac/icemac.recurrence

Repository files navigation

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

Copyright (c) 2013-2020 Michael Howitz

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

image

image

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

About

Functions to compute recurrences of events in a environment using the Zope Component Architecture (ZCA)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages