Pydantic models for cron
Actively maintained. Last release 7 weeks ago, commits in 14 of the last 26 weeks. A safe choice.
$
pip install cron-pydanticREADME as published on PyPI with version 0.1.1.
cron-pydantic
Typed, YAML-friendly models for cron schedules, jobs, and crontab files.
from cron_pydantic import CronConfiguration
config = CronConfiguration.model_validate(
{
"environment": {"PATH": "/usr/local/bin:/usr/bin"},
"job": {
"backup": {
"schedule": "0 2 * * *",
"command": "/opt/jobs/backup",
}
},
}
)
print(config.to_cron())
cron-pydantic validates five-field and special schedules, renders user and
system crontabs, parses existing crontab text, and loads YAML. File output is
explicit; the package never installs or replaces a host crontab.
Documentation
Published documentation is available at airflow-laminar.github.io/cron-pydantic.
Ecosystem
- supervisor-pydantic models supervisord processes.