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

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

Built distribution (wheel)

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

Total release size: 8.2 kB

Release files / cronipy-0.1.7.tar.gz

Download URL cronipy-0.1.7.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e9b6e00dd6a68eff8ce4795712aa9460d2ee234311bd0be915bbb6786b548b1d
BLAKE2b-256 checksum
How to use checksums
adadb0fb6b4b259a0d0ec39cd5e49a0ea8a0ab9d3b0e8a10be8908513d441ead
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.7-py3-none-any.whl

Download URL cronipy-0.1.7-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e9f3d57fdc5ad98f5b35f2f70ee5f61fd7e6b47b20784e3db11c107e73f4d16
BLAKE2b-256 checksum
How to use checksums
0d831feba9e191e8784693d050aec820974d1977fead7cdfdcc966f354a9266b
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.7

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