python-python-crontab
Port variant v13
Summary Python Crontab API (3.13)
Package version 3.3.0
Homepage https://gitlab.com/doctormo/python-crontab/
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants v14
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 04 FEB 2026, 12:37:25 UTC
Port created 04 FEB 2026, 12:37:25 UTC
Subpackage Descriptions
single Python Crontab -------------- Bug Reports and Development =========================== Please report any problems to the [GitLab issues tracker]. Please use Git and push patches to the [GitLab project code hosting]. **Note:** If you get the error got an unexpected keyword argument 'user' when using CronTab, you have the wrong module installed. You need to install ``python-crontab and not crontab`` from pypi or your local package manager and try again. Description =========== Crontab module for reading and writing crontab files and accessing the system cron automatically and simply using a direct API. Comparing the [below chart] you will note that W, L, # and ? symbols are not supported as they are not standard Linux or SystemV crontab format. +-------------+-----------+-----------------+-------------------+-------------+ |Field Name |Mandatory |Allowed Values |Special Characters |Extra Values | +=============+===========+=================+===================+=============+ |Minutes |Yes |0-59 |\* / , - | < > | +-------------+-----------+-----------------+-------------------+-------------+ |Hours |Yes |0-23 |\* / , - | < > | +-------------+-----------+-----------------+-------------------+-------------+ |Day of month |Yes |1-31 |\* / , - | < > | +-------------+-----------+-----------------+-------------------+-------------+ |Month |Yes |1-12 or JAN-DEC |\* / , - | < > | +-------------+-----------+-----------------+-------------------+-------------+ |Day of week |Yes |0-6 or SUN-SAT |\* / , - | < > | +-------------+-----------+-----------------+-------------------+-------------+ Extra Values are '<' for minimum value, such as 0 for minutes or 1 for months. And '>' for maximum value, such as 23 for hours or 12 for months. Supported special cases allow crontab lines to not use fields. These are the supported aliases which are not available in SystemV mode: =========== ============ Case Meaning =========== ============ @reboot Every boot @hourly 0 * * * * @daily 0 0 * * * @weekly 0 0 * * 0 @monthly 0 0 1 * * @yearly 0 0 1 1 * @annually 0 0 1 1 * @midnight 0 0 * * * =========== ============ To control the output of specials see `SPECIALS_CONVERSION` below. How to Use the Module ===================== Here is a simple example of how python-crontab is typically used. First the CronTab class is used to instantiate a cron object, then the cron object is used to declaratively manipulate the cron (spawning a new job in this case). Lastly, declared changes get written to the crontab by calling write on the object:: from crontab import CronTab cron = CronTab(user='root') job = cron.new(command='echo hello_world') job.minute.every(1) cron.write() Alternatively, you can use the with context manager which will automatically call write on the cron object upon exit:: with CronTab(user='root') as cron: job = cron.new(command='echo hello_world') job.minute.every(1) print('cron.write() was just executed') **Note:** Several users have reported their new crontabs not saving automatically or that the module doesn't do anything. You **MUST** use write() if you want your edits to be saved out. See below for full details on the use of the write function. Getting access to a crontab can happen in five ways, three system methods
Configuration Switches (platform-specific settings discarded)
PY313 ON Build using Python 3.13 PY314 OFF Build using Python 3.14
Package Dependencies by Type
Build (only) python313:dev:std
python-pip:single:v13
autoselect-python:single:std
Build and Runtime python313:primary:std
Download groups
main mirror://PYPIWHL/47/42/bb4afa5b088f64092036221843fc989b7db9d9d302494c1f8b024ee78a46
Distribution File Information
739a778b1a771379b75654e53fd4df58e5c63a9279a63b5dfe44c0fcc3ee7884 27533 python-src/python_crontab-3.3.0-py3-none-any.whl
Ports that require python-python-crontab:v13
python-django-celery-beat:v13 Database-backed Periodic Tasks (3.13)