skillfed

subprocess-multitee

A small `tee` function for splitting stdout/stderr in subprocess, and a `subprocess.Popen` convenience wrapper

subprocess-multitee v0.2.1 88.5K downloads/30d#13,724 on PyPI2
License unclear Active released

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-multitee

uv

uv add subprocess-multitee

poetry

poetry add subprocess-multitee

Installing 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

subprocess output capture and displaytee stdout stderr to multiple destinationsreal-time subprocess output loggingcapture subprocess output while printingmultiplex subprocess streamssubprocess stdout to file and terminal
subprocess-utilitiesprocess-io

More Software Development packages