Cronparse
A simple tool for testing crontab like syntax.
Usage
>>> from cronparse import Cron
>>> c = Cron('*/5 * * * 0') # Matches only on Mondays, every 5th minute
>>> from datetime import datetime
>>> d = datetime(2020, 4, 13, 11, 5)
>>> c.matches(d)
True
>>> d = d.replace(minute=6)
>>> c.matches(d)
False
>>> d = d.replace(day=14, minute=5)
>>> c.matches(d)
False
>>> c.why(d) # Ask which fragment of the rule did not match
[True, True, True, True, False]
crontab rule syntax
Supported syntax:
- * - match any value
- 1 - match exact value
- */5 - match every 5th value
- 1,3,4 - match values from list
- 1-3 - match values in a range
- 1-3,7,*/2 - combinations!
- @yearly, @annually, @monthly, @weekly, @daily, @midnight, @hourly
Unsupported syntax:
- Day names
- Month names
- @reboot
Timezone Support
Optionally, you can pass a datetime.tzinfo as the second argument. It
defaults to datetime.timezone.utc.
Any datetime passed for testing will first be moved to that timezone.
Metadata
Release files for cronparse 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cronparse-0.3.0.tar.gz | 2.6 kB | Without provenance | Details for cronparse-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cronparse-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for cronparse-0.3.0-py3-none-any.whl |
Total release size: 5.1 kB
Release files / cronparse-0.3.0.tar.gz
| Download URL | cronparse-0.3.0.tar.gz |
|---|---|
| Size | 2.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cddb98da53e49aa3d3322c881b8b422f21b3ce41eea0cc29f59387ccbd3c6479
|
|
BLAKE2b-256 checksum How to use checksums |
fc0d8bd360927b4794fc2151396bebbb9cc6e28472776505ae1a248a5bd2e951
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.8.2
|
Release files / cronparse-0.3.0-py3-none-any.whl
| Download URL | cronparse-0.3.0-py3-none-any.whl |
|---|---|
| Size | 2.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
10ab288b97055545f3570811c454458f70312945bda10c7378a5457a2cca8c79
|
|
BLAKE2b-256 checksum How to use checksums |
1fc5594340c4650734fd5ba4b8db87714271e0e6241327e6fd4a34becb9cdf3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.8.2
|
Security for cronparse 0.3.0
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.