--- id: subprocess-tee version: "0.4.2" license: MIT license_treatment: permissive maintenance: active --- # subprocess-tee — subprocess-tee License: permissive · Maintenance: active · Downloads: 6.0M/mo ## 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 above — 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 pip install subprocess-tee uv add subprocess-tee poetry add subprocess-tee ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 6.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags subprocess output capture and print, real-time subprocess output, tee subprocess python, capture and display subprocess, subprocess run with output, live subprocess streaming, subprocess progress feedback, subprocess-wrapper, process-monitoring [View on SkillFed](https://skillfed.io/packages/subprocess-tee) · [View on PyPI](https://pypi.org/project/subprocess-tee/)