subprocess-tee
subprocess-tee
What it is and what it does
subprocess-tee wraps Python's standard subprocess module to solve a common problem: you want to see what a long-running command is doing in real-time, but you also need to capture its output for later use. It does both simultaneously by printing to the console while collecting stdout and stderr into the result object, mimicking the Unix tee utility. The package works on POSIX systems (Linux, macOS) and treats all output as text by default, which differs from the standard subprocess module.
The implementation is straightforward: import from subprocess-tee instead of subprocess, call it the same way, and get both live feedback and captured output. You can disable the tee behavior with tee=False if needed, and use check=True to raise exceptions on non-zero exit codes, just like the standard library version.
Use it for:
- Monitor progress of build scripts or CI/CD pipelines while capturing logs for debugging.
- Run installation or deployment commands and display output in real-time while saving it to a file.
- Execute long-running tests or data processing jobs with live console feedback and complete output capture.
- Stream command output for user feedback while preserving it for post-execution analysis.
- Replace standard subprocess in existing tools to add real-time visibility without refactoring.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A drop-in replacement for subprocess.run that captures output while printing it in real-time, similar to the Unix tee command.
Yes. The package solves a genuine pain point with zero dependencies, permissive licensing, active maintenance, and a simple API that drops into existing code. It ranks in the top 5000 PyPI packages by download volume and has no known vulnerabilities. Install it if you run subprocesses and want real-time feedback without losing the captured output.
Install
subprocess-tee on PyPI
pip
pip install subprocess-teeuv
uv add subprocess-teepoetry
poetry add subprocess-teeInstalling subprocess-tee
Before you install
Low install friction with no runtime dependencies. Actively maintained with recent commits; last release was 2024-06-17 and the repository remains active.
License in practice
MIT license is permissive, allowing free use, modification, and distribution with minimal restrictions.
Quickstart
pip install subprocess-tee
from subprocess_tee import run
result = run("echo 123")
print(result.stdout)
Requires Python 3.8 or later; universal_newlines=True is implied (text mode only).
Verify before relying
- Whether asyncio support mentioned in keywords is available via a separate API or integrated into the main run function.
- Performance characteristics when handling very large output streams.
- Behavior differences from subprocess.run beyond output capture (e.g., timeout handling, signal behavior).
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 788 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,999,958/month — #1,990 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: subprocess_tee-0.4.2-py3-none-any.whl
Keywords: subprocess, asyncio
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
scripttestscripttest runs command-line applications in…
permissive · top 15,000 on PyPI
subprocess-multiteeMultiplexes subprocess stdout/stderr to…
unclear · top 15,000 on PyPI
subprocess.runProvides a simplified interface to run shell…
permissive · top 15,000 on PyPI
tendoTendo provides utility functions for Python…
permissive · top 15,000 on PyPI
fancy-subprocessRuns shell commands with formatted output,…
permissive · top 15,000 on PyPI
runsRuns multiple subprocess commands from a text…
permissive · top 5,000 on PyPI
shCalls any Unix program as a Python function,…
permissive · top 5,000 on PyPI
EasyProcessEasyProcess wraps Python's subprocess module to…
permissive · top 5,000 on PyPI
runezA zero-dependency utility library providing…
permissive · top 5,000 on PyPI
wurlitzerCaptures C-level stdout and stderr output in…
permissive · top 5,000 on PyPI