Parse crontab expressions with Python
Project description
Crontabula 🧛
Crontabula is a small library for parsing Crontab expressions into Python objects. The usage is simple:
import crontabula
crontab = crontabula.parse("*/10 3,6 * * 1-4")
print(crontab.next)
# datetime.datetime(...)
Installation
Install with:
pip install crontabula
CLI
Crontabula comes with a small utility to print debug information about a crontab expression. Make sure you install the
library with the cli extra (pip install "crontabula[cli]").
$ crontabula "*/15 * 1,15 * 1-5,6"
minute 0 15 30 45
hour 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
day of month 1 15
month 1 2 3 4 5 6 7 8 9 10 11 12
day of week 1 2 3 4 5 6
next time 2022-04-19 17:30:00 (in 0:03:59.987874)
Contributing
Configure the environment and run the tests using Poetry:
$ poetry install
$ poetry run pre-commit install # Optional, for linting with black
$ poetry run pytest
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
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 crontabula-0.1.8.tar.gz.
File metadata
- Download URL: crontabula-0.1.8.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.9.22 Darwin/24.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a96e5dcdc938903c9f12088cf4907a400de8468b80b2b574e5c16d0bbb1290f
|
|
| MD5 |
f531e511c9f79b131752cfdc4f195418
|
|
| BLAKE2b-256 |
2f35c701d70414150d049ee8360f179b91e729b29acc6b41420946171292bacc
|
File details
Details for the file crontabula-0.1.8-py3-none-any.whl.
File metadata
- Download URL: crontabula-0.1.8-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.9.22 Darwin/24.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb9173d8054581ce7abc6a4fcfe30f9de59357f892b532d96dc228dff149c6ad
|
|
| MD5 |
382f71fbac715c6c459f52c7670bed1e
|
|
| BLAKE2b-256 |
68a327552ce9daa50e96efdaf0850bcbc090f08b389668d1ba513b137e6e996d
|