--- id: subprocrunner version: "2.0.1" license: MIT License license_treatment: permissive maintenance: aging --- # subprocrunner — A Python wrapper library for subprocess module. License: permissive · Maintenance: aging · Downloads: 228.8K/mo ## What it is and what it does SubprocessRunner is a thin wrapper around Python's subprocess module that reduces boilerplate when executing external commands. It provides a simple object-oriented interface to run commands, automatically capture stdout and stderr, and access return codes without the ceremony of subprocess.Popen or subprocess.run. The package handles common patterns like retrying failed commands with exponential backoff, raising exceptions on non-zero exit codes, and dry-run mode for testing command sequences without actually executing them. The library is useful when you need to shell out to external tools from Python code and want cleaner syntax than the standard library offers. It depends only on mbstrdecoder for string handling and supports Python 3.7 through 3.12. The package includes a utility class (Which) to check if a command exists on the system and locate its absolute path, and can optionally log activity via loguru if installed. Use it for: - Run shell commands from Python scripts and capture their output without writing subprocess boilerplate. - Implement retry logic for flaky external commands with configurable backoff and jitter. - Test command sequences in dry-run mode before actually executing them. - Build command-line tool wrappers that need to validate return codes and raise exceptions on failure. - Track execution history of all commands run during a session for debugging or auditing. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Wraps Python's subprocess module to simplify running external commands, capturing output, handling retries, and checking return codes. Yes, if you frequently run external commands and want cleaner syntax than subprocess.Popen or subprocess.run. The low install friction, permissive license, and stable API make it a safe choice. The aging maintenance (860+ days since last release) is not a blocker for stable use cases, but verify compatibility with your Python version and consider whether you need active development support before adopting. ## Install pip install subprocrunner uv add subprocrunner poetry add subprocrunner ## Installing subprocrunner Before you install: Low friction install with a single runtime dependency (mbstrdecoder). Maintenance status is aging—last release was in April 2024 and no updates in over 860 days—but the repository remains active and the package is marked Production/Stable. License in practice: MIT License (permissive) means you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install subprocrunner from subprocrunner import SubprocessRunner runner = SubprocessRunner(["echo", "test"]) print(f"return code: {runner.run()}") print(f"stdout: {runner.stdout}") Verify before relying: - Whether the aging maintenance status (860+ days since last release) affects stability or compatibility with current Python versions. - Performance characteristics when running many commands or handling large output streams. ## Package facts - License: MIT License (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 228.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags subprocess wrapper, run external commands python, capture command output, subprocess retry logic, command execution helper, shell command wrapper, process return code handling, subprocess-wrapper, command-execution [View on SkillFed](https://skillfed.io/packages/subprocrunner) · [View on PyPI](https://pypi.org/project/subprocrunner/)