This release is a pre-release and may not be stable for production use.
🔧 cuprum
Typed, async command execution for Python—so you can ditch the shell scripts without losing your mind.
Website: https://df12.studio/cuprum
Why cuprum?
If you've ever written a Python script that calls out to external commands,
you've probably experienced the joys of subprocess: stringly-typed arguments,
mysterious failures, and output that vanishes into the void. Cuprum is here to
help.
- No shell roulette: You build argument vectors for approved executables, so there are no command strings to quote, escape, or get wrong.
- You choose what runs: A catalogue decides which programs can be built into commands. Use the default one, or define your own with project metadata. An optional execution scope narrows things further at run time.
- Answers, not guesswork: Every completed run returns a structured result, so success, failure, and output are right there to inspect.
- Async when you want it: Cuprum is async-first, with synchronous wrappers for scripts that don't need an event loop.
Whether you're building deployment helpers, CI glue, or maintenance scripts, we want "Python instead of Bash" to feel like an upgrade rather than a chore.
Quick start
Installation
Cuprum needs Python 3.12 or newer. Install it with pip:
python -m pip install cuprum
Or add it to a uv project:
uv add cuprum
Quick taste
This example approves the Python interpreter that is running it, so it works on any machine without assuming which other tools are installed:
import asyncio
import sys
from cuprum import Program, ProgramCatalogue, sh
catalogue = ProgramCatalogue.from_programs(sys.executable, name="quick-start")
python = sh.make(Program(sys.executable), catalogue=catalogue)
command = python("-c", "print('hello, cuprum!')")
async def main() -> None:
result = await command.run()
assert result.ok and result.stdout == "hello, cuprum!\n"
asyncio.run(main())
Prefer to skip the event loop? command.run_sync() returns the same result.
Features
- Catalogue-backed builders – Unknown programs raise
UnknownProgramErrorbefore anything runs. - Structured results – Exit code, process ID, captured output, timing,
resource measurements where the platform supports them, and a handy
okproperty. - Output your way – Capture, echo, per-line observation, and an optional heartbeat for quiet children can each be switched on independently.
- Graceful cancellation – Cancelled or timed-out runs terminate the child,
wait for a configurable grace period, then force-kill it (
SIGKILLon POSIX). - Composition – Build pipelines, or run commands concurrently with a bounded level of parallelism.
- Context policy – Scoped allowlists, environment overlays, and hooks keep each part of your application to the commands it should use.
- Optional acceleration – A Rust extension speeds up stream handling; the pure Python installation has no runtime dependencies at all.
Status
Cuprum is young but busy. The command runtime, scoped allowlists, hooks, and the optional native stream backend are all in place. The public API may still evolve before a stable release, so check the changelog and migration guide when you upgrade.
Learn more
- Users' guide — synchronous execution, output observation, pipelines, concurrency, policy, and troubleshooting
- Developers' guide — building, testing, and maintaining cuprum
- Roadmap — planned features and progress
- Changelog — what changed in each release
- 0.2.0 migration guide — upgrading an existing application
About the name
The name is a tip of the hat to Plumbum, the library that showed us shell-like scripting in Python could actually be pleasant. "Cuprum" is Latin for copper—another metal used in pipes—and we hope to carry that spirit forward with a focus on type safety and explicit allowlists.
Licence
ISC — see LICENSE for details.
Contributing
Contributions are welcome! Please read AGENTS.md for the house rules and the developers' guide for how to build and test the project.
Release files for cuprum 0.2.0b1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cuprum-0.2.0b1.tar.gz | 277.4 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| cuprum-0.2.0b1-py3-none-any.whl | Python 3 | none | any | Details |
| cuprum-0.2.0b1-cp312-abi3-win_amd64.whl | CPython 3.12 | abi3 | Windows x86-64 | Details |
| cuprum-0.2.0b1-cp312-abi3-manylinux_2_28_x86_64.whl | CPython 3.12 | abi3 | Linux glibc 2.28+ x86-64 | Details |
| cuprum-0.2.0b1-cp312-abi3-manylinux_2_28_aarch64.whl | CPython 3.12 | abi3 | Linux glibc 2.28+ ARM64 | Details |
| cuprum-0.2.0b1-cp312-abi3-macosx_11_0_arm64.whl | CPython 3.12 | abi3 | macOS 11.0+ ARM64 | Details |
| cuprum-0.2.0b1-cp312-abi3-macosx_10_12_x86_64.whl | CPython 3.12 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 2.9 MB
Release files / cuprum-0.2.0b1.tar.gz
| Download URL | cuprum-0.2.0b1.tar.gz |
|---|---|
| Size | 277.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dc590eabc0b4dd2d191a2c8d4933001c9b50fee12044fcda928a0cbef0990ab3
|
|
BLAKE2b-256 checksum How to use checksums |
8630170d5f78a930661f91162b334d4e1d2b7092acf478d01f6dafc736dc8edf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / cuprum-0.2.0b1-py3-none-any.whl
| Download URL | cuprum-0.2.0b1-py3-none-any.whl |
|---|---|
| Size | 259.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
09dcd284eabcfb085cc8f51ba33a4ea087df8ccf318aea4f5c09e74e6b01ab65
|
|
BLAKE2b-256 checksum How to use checksums |
15eb52af3139aa40a924b8491b53c637b719f3a055bd93772f2d93b30cca8ead
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / cuprum-0.2.0b1-cp312-abi3-win_amd64.whl
| Download URL | cuprum-0.2.0b1-cp312-abi3-win_amd64.whl |
|---|---|
| Size | 377.6 kB |
| Tags | CPython 3.12 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
84e1b2804d1dd1d2a97e78760d7f9e181b7e76c6457305d155a9b72a0cc14356
|
|
BLAKE2b-256 checksum How to use checksums |
919771764c1637faaa8c615fcfa8648e4de82f1155d57775eb1fa0e56ac6cd0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / cuprum-0.2.0b1-cp312-abi3-manylinux_2_28_x86_64.whl
| Download URL | cuprum-0.2.0b1-cp312-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 521.3 kB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
04fbb1f6cc223dc0daa80594271360c0801380148f41ddbb603899b62cca6e0b
|
|
BLAKE2b-256 checksum How to use checksums |
365cefc6bff370f810755f5db647a9991138e8972f0caeb7f846987e031e8ee3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / cuprum-0.2.0b1-cp312-abi3-manylinux_2_28_aarch64.whl
| Download URL | cuprum-0.2.0b1-cp312-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 522.8 kB |
| Tags | CPython 3.12 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
18cb11d29efc95b7aabfa58187653e60738a428081470590feeb2bf382a64596
|
|
BLAKE2b-256 checksum How to use checksums |
861aafbbc11bc897e4290cce95b19b4d19e3647d902665a6d1066e7d095817a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / cuprum-0.2.0b1-cp312-abi3-macosx_11_0_arm64.whl
| Download URL | cuprum-0.2.0b1-cp312-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 479.5 kB |
| Tags | CPython 3.12 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ac480a7cc911c0036b2b471f311d54fe70f21dd6de4ded5c964ac48e9691e318
|
|
BLAKE2b-256 checksum How to use checksums |
0c616d94724cc03644f1c882aebe224ae79eea3c48b4e412ecb6bc712412f03e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / cuprum-0.2.0b1-cp312-abi3-macosx_10_12_x86_64.whl
| Download URL | cuprum-0.2.0b1-cp312-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 480.7 kB |
| Tags | CPython 3.12 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
44c63156002c9415ad2035ceb59348d1563b538a6e73ce1de243bc71f4620f25
|
|
BLAKE2b-256 checksum How to use checksums |
03fcf1bd7c376507766c5a4358538a1b80f42e4210287ba05b400d2747610939
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|