Skip to main content

A tool for running command chains

Project description

runchain

PyPI Documentation Tests Coverage

Manage and execute chains of scripts.

Runchain allows you to group scripts into named chains, schedule them with cron, and run them in a predictable order. Perfect for backup scripts and maintenance tasks.

  • Group scripts into ordered chains
  • Schedule chains with crondir integration
  • Simple Python API and CLI interface

Usage

Install runchain:

pip install runchain

Create a backup chain by adding scripts:

runchain add backup ~/scripts/database-backup.sh 10
runchain add backup /usr/local/bin/file-backup.py 20-files
runchain add backup ./30-cleanup.sh

List your chains:

runchain list

List scripts in a specific chain:

runchain list backup

Run a chain manually:

runchain run backup

Schedule a chain with crondir:

runchain cron backup "0 2 * * *"

Remove a script or entire chain:

runchain remove backup 20-files
runchain remove backup

Or you may find it easier to skip the install step and run it using uv:

uvx runchain add backup ~/scripts/backup.sh 10
uvx runchain cron backup "0 2 * * *"
uvx runchain run backup

By default, runchain stores chains in ~/.runchain/, with each chain in its own subdirectory.

For full command line options, see command documentation

Example

For an example of setting up a backup chain, see How to create a backup chain in the documentation.

Python API

from runchain import Chain, list_chains

# List all chains
chains = list_chains()

# Work with a specific chain
backup = Chain("backup")
backup.add("~/scripts/database.sh", "10")
backup.cron("0 2 * * *")
backup.run()

See the API documentation for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

runchain-0.2.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

runchain-0.2.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file runchain-0.2.0.tar.gz.

File metadata

  • Download URL: runchain-0.2.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for runchain-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0840c43a60e71f25f3034007ccd15182687e76361556cf4b440f2ac5d2783fea
MD5 5c7e14816d236a73234bb009a805a3ca
BLAKE2b-256 45a1e66c4fa660989f798781004d8bc60012637c248221342afe41979ff6a34b

See more details on using hashes here.

Provenance

The following attestation bundles were made for runchain-0.2.0.tar.gz:

Publisher: pypi.yml on radiac/runchain

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file runchain-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: runchain-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for runchain-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ccf7708ec3db0e641366fb9e09f06daaf2451fbf1bd27c1bb68a4cb11e4099c2
MD5 1c167dfb06d309d0ceb77bf5bd4d2456
BLAKE2b-256 228389755af6ae0b606355e2a4fb7a7dca83c82f090248422886e72169a0d291

See more details on using hashes here.

Provenance

The following attestation bundles were made for runchain-0.2.0-py3-none-any.whl:

Publisher: pypi.yml on radiac/runchain

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page