时区感知cron/quartz解析器
tzcron的Python项目详细描述
tzcron
用于cron/quartz表达式和时区的库。
概述
tzcron提供了一种方法来定义附加到时区的计划,并通过迭代创建的对象来从中获取时间引用。
安装
>>> pip install tzcron
用法
>>> 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>)
有关详细信息,请检查official documentation
开发此软件包
要测试包:
> python -m nose
发布新版本的软件包:
> python setup.py sdist bdist_wheel upload