Skip to main content

cronipy

cronipy turns Python functions into cron jobs. You decorate a function with a schedule, run one command, and cronipy writes the crontab entries for you.

Rather than reinvent cron in Python, cronipy uses your system crontab.

The package is in early development, and the interface can change.

Installation

Requires cron installed on your system.

pip install cronipy

Usage

Define your jobs in a module of your package, e.g. mypackage.tasks_module:

from cronipy import Cron

cron = Cron()

@cron.task("*/5 * * * *")
def do_something_every_five_minutes():
    ...

Then install jobs from all Cron objects in the specified module:

$ cronipy install mypackage.tasks_module

Or, to replace your existing crontab with jobs defined with cronipy:

$ cronipy install mypackage.tasks_module --replace-existing

cronipy adds one line per decorated function into the current user's crontab. Function output is logged in logs/<function name>.log.

Jobs added by cronipy can be cleaned up from your crontab by:

$ cronipy uninstall mypackage.tasks_module

Jobs can be also installed and uninstalled from Python:

cron.install()
# and
cron.uninstall()

Options

You can pass these arguments to Cron:

  • dry_run: when true, a job prints its name and does nothing.
  • env: a dictionary of environment variables added to every crontab line.
  • log_dir: where the log files go, ./logs by default.
  • work_dir: the directory each job runs in, ./ by default.
  • python: the interpreter the jobs use, the one that runs cronipy by default.

Development

This repository uses uv. Set up a development environment with uv sync, and run the checks with uv run pytest.

Roadmap

  • Enable compatibility with single-file modules.
  • CLI command to uninstall cronipy entries from crontab..
  • Enable autodiscovery of modules containing Cron objects.

License

BSD 3-Clause

Metadata

Release files for cronipy 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cronipy 0.1.6
File Size Uploaded Provenance Actions
cronipy-0.1.6.tar.gz 3.6 kB Without provenance Details for cronipy-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cronipy 0.1.6
File Interpreter ABI Platform Actions
cronipy-0.1.6-py3-none-any.whl Python 3 none any Details for cronipy-0.1.6-py3-none-any.whl

Total release size: 8.0 kB

Release files / cronipy-0.1.6.tar.gz

Download URL cronipy-0.1.6.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
efa893dcf9ef910c4eb4e43bfad7c83f0765da6bf3ee2cee85fb6fe3e7498e2b
BLAKE2b-256 checksum
How to use checksums
fd313769689d62342720fcc5c34fe7c8565a2445aeb3871f37589d778065f67f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / cronipy-0.1.6-py3-none-any.whl

Download URL cronipy-0.1.6-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7694b7628c97bff66b278c9269ab823c41b16c095c49d0a63d9357f3ba615ac4
BLAKE2b-256 checksum
How to use checksums
8b7ad7816aa570ec38431403b9669925a7cc6fdb3441d8f774517f42a708fb36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for cronipy 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page