Skip to main content

Simple example of usage is followings

>>> from croniter import croniter
>>> from datetime import datetime
>>> base = datetime(2010, 1, 25, 4, 46)
>>> iter = croniter('*/5 * * * *', base)  # every 5 minites
>>> print iter.get_next(datetime)   # 2010-01-25 04:50:00
>>> print iter.get_next(datetime)   # 2010-01-25 04:55:00
>>> print iter.get_next(datetime)   # 2010-01-25 05:00:00
>>>
>>> iter = croniter('2 4 * * mon,fri', base)  # 04:02 on every Monday and Friday
>>> print iter.get_next(datetime)   # 2010-01-26 04:02:00
>>> print iter.get_next(datetime)   # 2010-01-30 04:02:00
>>> print iter.get_next(datetime)   # 2010-02-02 04:02:00

All you need to know is constructor and get_next, these signature are following.

>>> def __init__(self, cron_format, start_time=time.time())

croniter iterate along with ‘cron_format’ from ‘start_time’. cron_format is ‘min hour day month day_of_week’, and please refer to http://en.wikipedia.org/wiki/Cron for details.

>>> def get_next(self, ret_type=float)

get_next return next time in iteration with ‘ret_type’. And ret_type accept only ‘float’ or ‘datetime’.

Metadata

Release files for croniter 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for croniter 0.1.6
File Size Uploaded Provenance Actions
croniter-0.1.6.tar.gz 4.4 kB Without provenance Details for croniter-0.1.6.tar.gz

Release files / croniter-0.1.6.tar.gz

Download URL croniter-0.1.6.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
865717ccaacb9a6039b4159163fcf6b82ee1d1ce4c94b5afff7f8c188849eb13
BLAKE2b-256 checksum
How to use checksums
e4ac1d194ca5c253ae8391af8e95c6a485316421b423b4dcaab06fa5c5ba2601
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for croniter 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

0.2.1

This release

0.1.6 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page