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

Uploaded Python 3

File details

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

File metadata

  • Download URL: runchain-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 f9051154dd4153399ac1b55f052b5a79a8067b9a4363cd8aac9e0effefae31e9
MD5 d39c55dce94714c5296c7cbf45ce24cb
BLAKE2b-256 739859ddbef80ea4069c3d2364493508cce2a8f133b621787f35952505ea563d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: runchain-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5337059ba7ff0bfcdee1fa3ab8ba6ccc5b9a8fa3f087f5f7a40c968d4e560b5e
MD5 86c72ddd53b066855c5bd744042fe928
BLAKE2b-256 c9000db974facdb628086d4e9e5e2b01a89a201af59377dd71c34e34e39caa66

See more details on using hashes here.

Provenance

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