Skip to main content

Generic parallel/sequential task runner with TUI output

Project description

Camas

Generic parallel/sequential task runner with a live tree-style TUI.

CI

Install

uv add camas

or

pip install camas

Quick start

Camas takes a typed Python expression describing a tree of Task, Sequential, and Parallel nodes and runs it, streaming progress into a live tree in your terminal.

Run two checks in parallel:

python -m camas 'Parallel(tasks=(Task("ruff check ."), Task("mypy .")))'

A typical CI pipeline — format-check, then checks in parallel, then tests:

python -m camas 'Sequential(tasks=(
    Task("ruff format . --check"),
    Parallel(tasks=(Task("mypy ."), Task("pyright ."))),
    Task("pytest"),
))'

Run one task across a matrix of Python versions in parallel:

python -m camas 'Parallel(
    tasks=(Task("pytest --python {PY}"),),
    matrix={"PY": ("3.12", "3.13", "3.14")},
)'

Use --dry-run to print the task tree without executing it.

Library

The same building blocks are available as a library:

import asyncio
from camas import Parallel, Sequential, Task, run
from camas.effect.termtree import Termtree, TermtreeOptions

task = Sequential(tasks=(
    Task("ruff format . --check"),
    Parallel(tasks=(Task("mypy ."), Task("pyright ."))),
    Task("pytest"),
))

result = asyncio.run(run(task, effects=(Termtree(TermtreeOptions()),)))
raise SystemExit(result.returncode)

Task, Sequential, and Parallel are immutable NamedTuple values. A Sequential short-circuits on the first non-zero exit; a Parallel runs its children concurrently. Both accept an optional matrix mapping for variable expansion in task commands, names, and environments.

License

MIT

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

camas-0.1.0.tar.gz (60.5 kB view details)

Uploaded Source

Built Distribution

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

camas-0.1.0-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file camas-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for camas-0.1.0.tar.gz
Algorithm Hash digest
SHA256 44b1fc8ded4ab15ff05a334f1af96f324e5ffc6ea9fd49c1e90fcb6808a1c6bd
MD5 f1e139555c1c5c1ee1da7ecbce702ca0
BLAKE2b-256 03649008e00857e0335ab97ca842670a77384f3a594223342504f4570ec13fae

See more details on using hashes here.

Provenance

The following attestation bundles were made for camas-0.1.0.tar.gz:

Publisher: ci.yaml on JPHutchins/camas

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

File details

Details for the file camas-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: camas-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for camas-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f2a2e4df6e8b5944f08e0b483270b17f9accc7b5171bd15cf877efbd5ea0b36
MD5 779792ceca0e5881d04dabdc28961952
BLAKE2b-256 8dd38610881e8e216d1db11d790fe82e51b20ec3e0667fba14137b30769e1e84

See more details on using hashes here.

Provenance

The following attestation bundles were made for camas-0.1.0-py3-none-any.whl:

Publisher: ci.yaml on JPHutchins/camas

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