subprocess-multitee
A small `tee` function for splitting stdout/stderr in subprocess, and a `subprocess.Popen` convenience wrapper
What it is and what it does
subprocess-multitee solves the standard library's either-or problem: subprocess.Popen forces you to choose between capturing output (stdout=PIPE) or displaying it (stdout=sys.stdout), but not both. This package provides a tee() function that creates a pipe spawning a background thread to read and write to multiple destinations in real-time, plus a Popen subclass that integrates cleanly with the tee primitive.
You pass tee() any combination of PIPE, DEVNULL, file objects, or file descriptors as destinations. The library handles the threading and I/O multiplexing, so you can simultaneously capture output, print to the terminal, and log to files—all from a single subprocess invocation. It works with the standard subprocess.run(), call(), check_call(), and check_output() functions via drop-in replacements, or directly with the enhanced Popen class.
Use it for:
- Run a build or test command (make, pytest) and capture full output while showing progress in real-time on the terminal.
- Log subprocess output to a file while simultaneously displaying it to the user, for debugging long-running processes.
- Capture output silently (tee to DEVNULL and PIPE) for programmatic inspection without terminal noise.
- Multiplex both stdout and stderr to separate log files and the console in a single Popen call.
- Integrate subprocess output capture into a training or data pipeline where you need both real-time feedback and recorded logs.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Multiplexes subprocess stdout/stderr to multiple destinations simultaneously, letting you capture output to a pipe while also displaying it in real-time or logging to files.
Yes. The package solves a genuine subprocess limitation with a clean, composable API, has no dependencies, low install friction, and is actively maintained. The only caveat is verifying the actual license before use—the description mentions MIT but the fact sheet marks it unclear.
Install
subprocess-multitee on PyPI
pip
pip install subprocess-multiteeuv
uv add subprocess-multiteepoetry
poetry add subprocess-multiteeInstalling subprocess-multitee
Before you install
Low friction: pure Python wheel with no runtime dependencies and requires only Python 3.6+. Actively maintained with recent releases.
License in practice
License status is unclear—the fact sheet lists no SPDX identifier or raw license text. Verify the actual license before use in proprietary or restricted contexts.
Quickstart
from subprocess_multitee import Popen, tee, PIPE
import sys
proc = Popen(['make'], stdout=tee(PIPE, sys.stdout))
output = proc.stdout.read()
proc.wait()
Verify before relying
- Actual license terms—the package description states MIT but the fact sheet lists license_treatment as 'unclear' with no SPDX identifier
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 243 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 88,501/month — #13,724 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: subprocess_multitee-0.2.1-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
logistrologistro wraps Python's standard logging module…
permissive · top 5,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
tendoTendo provides utility functions for Python…
permissive · top 15,000 on PyPI
wurlitzerCaptures C-level stdout and stderr output in…
permissive · top 5,000 on PyPI
EasyProcessEasyProcess wraps Python's subprocess module to…
permissive · top 5,000 on PyPI
subprocess.runProvides a simplified interface to run shell…
permissive · top 15,000 on PyPI
fancy-subprocessRuns shell commands with formatted output,…
permissive · top 15,000 on PyPI
scripttestscripttest runs command-line applications in…
permissive · top 15,000 on PyPI
runsRuns multiple subprocess commands from a text…
permissive · top 5,000 on PyPI