python-crontab
Python Crontab API
What it is and what it does
python-crontab is a Python API for reading, writing, and managing crontab files and system cron schedules. It abstracts away the complexity of parsing and manipulating cron syntax, letting you create, modify, and remove jobs programmatically using a declarative interface. You instantiate a CronTab object pointing to a system crontab, a file, or an in-memory string, then add or modify jobs by setting their schedule fields (minute, hour, day, month, day-of-week) using chainable methods like every(), on(), and during(). Changes are persisted by calling write().
The package supports standard Linux and SystemV cron format, including special aliases (@reboot, @hourly, @daily, etc.) and extra comparison operators (< for minimum, > for maximum). It works on Unix/POSIX systems with appropriate permissions for system crontabs, and also supports Windows via file-based or in-memory tabs. Zero runtime dependencies and a pure-Python wheel make installation straightforward.
Use it for:
- Programmatically schedule recurring tasks in a Python application without shell scripting or manual crontab editing.
- Build automation tools that need to read existing cron jobs and modify or disable them based on application state.
- Create a web dashboard or CLI tool that lets users manage their cron schedules through a Python backend.
- Test cron expressions and validate schedule syntax before deploying to production systems.
- Migrate cron jobs between systems by reading from one crontab and writing to another via the API.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Reads, writes, and manipulates system crontab files and schedules through a Python API, supporting standard cron syntax and special aliases like @reboot and @hourly.
Yes, if you need to manage cron schedules from Python code on Unix/POSIX systems. The API is straightforward, the package is stable and dependency-free, and it handles the parsing and formatting burden. The aging maintenance status (last release 397 days ago) is not a blocker for stable use, but monitor for security issues. The LGPLv3 license requires review if you plan to ship it in proprietary software.
Install
python-crontab on PyPI
pip
pip install python-crontabuv
uv add python-crontabpoetry
poetry add python-crontabInstalling python-crontab
Before you install
Low install friction with no runtime dependencies. Last release was 397 days ago; maintenance status is aging, so expect slower response to issues but the package is marked Production/Stable and Mature.
License in practice
LGPLv3 copyleft license means derivative works must be released under the same license; acceptable for internal tools and open-source projects, but review required before incorporating into proprietary software.
Quickstart
from crontab import CronTab
cron = CronTab(user='root')
job = cron.new(command='echo hello')
job.minute.every(1)
cron.write()
Unix/POSIX system required for system crontab access; Windows users must use tabfile or tab parameters to work with crontab strings or files.
Verify before relying
- Whether the package works reliably with Python 3.10+ versions beyond those listed in classifiers.
- Current state of the GitLab repository and whether it accepts patches or is in maintenance-only mode.
Package facts
| License | LGPLv3 (copyleft) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 397 days since the last release |
| First released | |
| Downloads | 9,512,734/month — #1,529 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: python_crontab-3.3.0-py3-none-any.whl
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
crontabParses crontab schedule expressions and…
copyleft · top 5,000 on PyPI
django-crontabIntegrates system crontab scheduling into…
permissive · top 15,000 on PyPI
aiocronSchedules async functions to run on cron…
permissive · top 15,000 on PyPI
local-crontabConverts crontab expressions from a local…
permissive · top 15,000 on PyPI
scheduleSchedule provides a human-friendly API for…
permissive · top 5,000 on PyPI
cronitercroniter iterates over datetime objects using…
permissive · top 1,000 on PyPI
APSchedulerAPScheduler lets you schedule Python code to…
permissive · top 1,000 on PyPI
rq-schedulerAdds job scheduling capabilities to RQ (Redis…
permissive · top 15,000 on PyPI
cronsimParses and evaluates cron expressions to find…
permissive · top 5,000 on PyPI
uptimeRetrieves the system uptime (time since last…
permissive · top 15,000 on PyPI