runs
🏃 Run a block of text as a subprocess 🏃
What it is and what it does
runs is a wrapper around Python's subprocess module that lets you execute multiple commands in a single call by passing a block of text. Instead of calling subprocess.run() once per command, you write your commands as a multi-line string (or list), and runs splits them, handles comments and line continuations, and returns results for each command. It provides drop-in replacements for subprocess.call(), check_call(), check_output(), and run(), all with UTF-8 encoding by default instead of bytes.
The main problem it solves is the friction of running sequential subprocess commands in Python: normally you either loop and call subprocess repeatedly, or manually split and parse command strings. runs handles the parsing, encoding defaults, and optional features like echo logging and exception handling in one place. It does not support shell features like pipes, redirection, or environment variable expansion—those still require shell=True and manual handling.
Use it for:
- Run a sequence of shell commands from a Python script without looping subprocess calls.
- Execute build or deployment steps (compilation, copying files, cleanup) as a text block.
- Test harnesses that need to run multiple CLI tools and collect their output as strings.
- Batch system administration tasks (disk checks, log rotation, service restarts) from Python.
- Development scripts that chain multiple command-line tools and need UTF-8 output by default.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Runs multiple subprocess commands from a text block or list, with UTF-8 encoding by default, line continuations, comments, and optional logging and error handling.
Yes, if you frequently run multiple subprocess commands in sequence and want cleaner syntax and UTF-8 defaults. The low install friction and permissive license make it a low-risk add. However, the aging maintenance status (192 days since last release) means it is stable but not actively developed—suitable for stable use cases, not for packages expecting ongoing feature work or rapid bug fixes.
Install
runs on PyPI
pip
pip install runsuv
uv add runspoetry
poetry add runsInstalling runs
Before you install
Low install friction with a single pure-Python dependency (xmod). Maintenance status is aging—last release was 192 days ago—so expect no active development, though the package is stable for its current scope.
License in practice
MIT license permits commercial and private use with minimal restrictions, requiring only license and copyright notice retention.
Quickstart
import runs
runs('''
echo "hello"
ls -la
echo "done"
''')
Requires Python 3.10 or later. Note that shell features like pipes, redirection, and environment variable expansion do not work—only direct command execution.
Verify before relying
- Whether xmod dependency is actively maintained or has its own aging/stability concerns.
- Real-world performance characteristics when running hundreds or thousands of commands in sequence.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — xmod |
| Maintenance | aging — 192 days since the last release |
| First released | |
| Downloads | 4,810,269/month — #2,223 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: runs-1.3.0-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
fancy-subprocessRuns shell commands with formatted output,…
permissive · top 15,000 on PyPI
subprocess.runProvides a simplified interface to run shell…
permissive · top 15,000 on PyPI
subprocrunnerWraps Python's subprocess module to simplify…
permissive · top 15,000 on PyPI
sargeSarge wraps Python's subprocess module to…
permissive · top 15,000 on PyPI
subprocess-teeA drop-in replacement for subprocess.run that…
permissive · top 5,000 on PyPI
subprocess-multiteeMultiplexes subprocess stdout/stderr to…
unclear · top 15,000 on PyPI
shCalls any Unix program as a Python function,…
permissive · top 5,000 on PyPI
executorWraps Python's subprocess module to simplify…
permissive · top 15,000 on PyPI
EasyProcessEasyProcess wraps Python's subprocess module to…
permissive · top 5,000 on PyPI
pytest-subprocessPytest plugin that intercepts and fakes…
permissive · top 15,000 on PyPI