https://github.com/bloomberg/tzcron
A parser of cron-style scheduling expressions.
https://github.com/bloomberg/tzcron
Last synced: about 1 year ago
JSON representation
A parser of cron-style scheduling expressions.
- Host: GitHub
- URL: https://github.com/bloomberg/tzcron
- Owner: bloomberg
- License: apache-2.0
- Created: 2016-08-04T18:44:34.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-09-25T22:35:37.000Z (almost 10 years ago)
- Last Synced: 2025-04-15T12:25:58.814Z (over 1 year ago)
- Language: Python
- Size: 32.2 KB
- Stars: 20
- Watchers: 4
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
.. image:: https://readthedocs.org/projects/tzcron/badge/?version=latest
:target: http://tzcron.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
tzcron
######
A library to work with cron/quartz expressions and timezones.
Overview
########
tzcron provides a way to define schedules attached to timezones and get time occurrences out of it by just iterating the object created.
Install
#######
>>> pip install tzcron
Usage
#####
>>> import tzcron
>>> import pytz
>>> schedule = tzcron.Schedule("* * * * * *", pytz.utc)
>>> str(schedule)
'Cron: * * * * * * @UTC [2016-09-25 19:10:48.948486+00:00->None]'
>>> next(schedule)
datetime.datetime(2016, 9, 25, 19, 11, tzinfo=)
>>> next(schedule)
datetime.datetime(2016, 9, 25, 19, 12, tzinfo=)
>>> next(schedule)
datetime.datetime(2016, 9, 25, 19, 13, tzinfo=)
For further information, check the `official documentation `_
Develop this package
####################
To test the package::
> python -m nose
To release a new version of the package::
> python setup.py sdist bdist_wheel upload