--- id: python-crontab version: "3.3.0" license: LGPLv3 license_treatment: copyleft maintenance: aging --- # python-crontab — Python Crontab API License: copyleft · Maintenance: aging · Downloads: 9.5M/mo ## 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 above — 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 pip install python-crontab uv add python-crontab 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: unspecified - Install friction: low - Maintenance: aging - Downloads: 9.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags crontab python api, schedule cron jobs programmatically, read write crontab files, cron expression parser, system cron management, cron-scheduling, system-administration [View on SkillFed](https://skillfed.io/packages/python-crontab) · [View on PyPI](https://pypi.org/project/python-crontab/)