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.2.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.2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for runchain-0.2.2.tar.gz
Algorithm Hash digest
SHA256 6d583c544a3b60dce41acc005a15c6d67fd1c67523b1e03c2165dfb95d693da2
MD5 124cf83ae9bdf5e7a48ad10bfafde756
BLAKE2b-256 d341f0e9f9376eab0cd4f677d3b5d307ccaf88683ad428318ea3c24582c04fe0

See more details on using hashes here.

Provenance

The following attestation bundles were made for runchain-0.2.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: runchain-0.2.2-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.12

File hashes

Hashes for runchain-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0aea07462dc27ae87c1675636c01e9bcf3b9b83e3c67be5c437c8a8906a43d64
MD5 0c184f96a1f1a3aee11a3903cd767b94
BLAKE2b-256 139080be730c3f731414655a6e30470a1410c5ab627f9572e0e1773b9eef4b60

See more details on using hashes here.

Provenance

The following attestation bundles were made for runchain-0.2.2-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