Skip to content

A parser of cron-style scheduling expressions.

License

Notifications You must be signed in to change notification settings

bloomberg/tzcron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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=<UTC>)
>>> next(schedule)
datetime.datetime(2016, 9, 25, 19, 12, tzinfo=<UTC>)
>>> next(schedule)
datetime.datetime(2016, 9, 25, 19, 13, tzinfo=<UTC>)

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

About

A parser of cron-style scheduling expressions.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages