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.5

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.5
File Size Uploaded Provenance Actions
cronipy-0.1.5.tar.gz 3.6 kB Without provenance Details for cronipy-0.1.5.tar.gz

Built distribution (wheel)

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

Total release size: 8.0 kB

Release files / cronipy-0.1.5.tar.gz

Download URL cronipy-0.1.5.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9eb44a7631904e237f37fc800a0d8fd5b0c2f9f3db658ae022ff23a9cdb594c1
BLAKE2b-256 checksum
How to use checksums
c7d2ebbde08cbbe0c861480d092a1763cdbd053a251d446e91ceed00e188462d
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.5-py3-none-any.whl

Download URL cronipy-0.1.5-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e05c483e8169f05c6d7163a5e017e4cf574a4b04756e98e0079a905842a453c1
BLAKE2b-256 checksum
How to use checksums
950d2ef46cba21063e230a76b0e0554bb60ef3e9ab69d2704b6673d93fa0927e
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.5

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