Get next and previous runs for a standard 5-field cron expression as normalized timestamps.
Project description
cron-runs for Python
Get the next and previous runs for a standard 5-field cron expression as normalized timestamps.
Install
pip install cron-runs
Features
- Standard 5-field cron only
- Timezone-aware output
- Reference time support
- ISO UTC, ISO with timezone offset, Unix seconds, Unix milliseconds
- Human-readable cron description
Usage
from cron_runs import get_cron_runs
result = get_cron_runs(
cron='0 9 * * 1-5',
timezone='America/Los_Angeles',
reference_time='2026-04-14T10:30:00-07:00',
next=2,
prev=1,
)
print(result)
API
get_cron_runs(...)
Inputs
cronstr, requiredtimezonestr, optional, defaultUTCreference_timestr or int or float, optional, default nownextint, optional, default1prevint, optional, default1
Notes
reference_timeaccepts:- ISO UTC
- ISO with timezone offset
- Unix seconds
- Unix milliseconds
nextandprevcan be0through100- This package does not schedule jobs. It only calculates occurrences.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cron_runs-1.0.0.tar.gz
(3.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cron_runs-1.0.0.tar.gz.
File metadata
- Download URL: cron_runs-1.0.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
011d8c205f59fe4b3ae4f28488accd4f11b7a671ad67b4b3f1690011c28f3be5
|
|
| MD5 |
e4959aab45c426cac78a016a5f0a17cb
|
|
| BLAKE2b-256 |
fe84c3d6ebd78eec1565199b1560283ac0f4e6b8aaec1cd1e34d3165ff86ee64
|
File details
Details for the file cron_runs-1.0.0-py3-none-any.whl.
File metadata
- Download URL: cron_runs-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cbd39fc1c99443b2da5da1b6a41f8fbe4d855075f8408d8b364ce868e6531b2
|
|
| MD5 |
d3b7ff024ea9c8b56a722001a613a8d3
|
|
| BLAKE2b-256 |
10e6d93842d3936cb846de864e016dc19e85949fe6dc41c1450dcb923fec9fa7
|