skillfed

python-crontab

Python Crontab API

python-crontab v3.3.0 9.5M downloads/30d#1,529 on PyPI
Copyleft license LGPLv3 AGING released

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-crontab

uv

uv add python-crontab

poetry

poetry add python-crontab

Installing 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

Development Status :: 5 - Production/StableDevelopment Status :: 6 - MatureIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsOperating System :: POSIXOperating System :: POSIX :: LinuxOperating System :: POSIX :: SunOS/SolarisProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

crontab python apischedule cron jobs programmaticallyread write crontab filescron expression parsersystem cron management
cron-schedulingsystem-administration

More Monitoring packages