wurlitzer
Capture C-level output in context managers
Decision gist · record as of 2026-08-14
Yes. Wurlitzer solves a specific, hard problem (capturing C-level I/O) with a clean API, has no dependencies, is actively maintained, carries an MIT license, and has no known vulnerabilities. Install it if you work with native extensions, compiled libraries, or need output capture in Jupyter—otherwise it's not necessary.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.5 or later; os.dup2 is Unix-like systems only (Linux, macOS, BSD), not available on Windows.
- Low friction: pure Python wheel with no runtime dependencies.
- Actively maintained with recent commits and a stable release history since 2016.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.
last release 2024-06-12 (793 days) · last repo commit 2026-07-06 · 222 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,832,013 downloads/mo, #3,510 on PyPI
Alternatives
Verify before relying
pip install wurlitzer
from wurlitzer import pipes
with pipes() as (out, err):
call_some_c_function()
stdout_text = out.read()- Whether the package works correctly on all modern Python versions up to 3.12+ despite the 3.5 minimum requirement.
- Performance overhead or GIL interaction when capturing high-volume C output in production workloads.
What it is and what it does
Wurlitzer lets you capture output produced directly by C code and native libraries—output that normally bypasses Python's sys.stdout and sys.stderr. It works by using os.dup2 to redirect file descriptors at the OS level, making it possible to intercept output from compiled extensions, system calls, and third-party C libraries that write directly to stdout/stderr.
The package provides context managers (pipes, sys_pipes) and integrates with Python's logging module and file objects. It's particularly useful in Jupyter notebooks and IPython environments where you want to display C-level output in cell results, and in testing scenarios where you need to verify or suppress output from native code.
Use it for
- Capture and verify output from C extensions or compiled libraries in unit tests.
- Display C-level output in Jupyter notebooks by enabling the wurlitzer IPython extension.
- Redirect native library output to Python loggers for centralized log management.
- Suppress or forward output from blocking C functions that hold the GIL.
- Debug integration issues between Python and native code by inspecting captured output.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Wurlitzer solves a specific, hard problem (capturing C-level I/O) with a clean API, has no dependencies, is actively maintained, carries an MIT license, and has no known vulnerabilities. Install it if you work with native extensions, compiled libraries, or need output capture in Jupyter—otherwise it's not necessary.
Install
wurlitzer on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Actively maintained with recent commits and a stable release history since 2016.
Requires Python 3.5 or later; os.dup2 is Unix-like systems only (Linux, macOS, BSD), not available on Windows.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install wurlitzer
from wurlitzer import pipes
with pipes() as (out, err):
call_some_c_function()
stdout_text = out.read()
Verify before relying
- Whether the package works correctly on all modern Python versions up to 3.12+ despite the 3.5 minimum requirement.
- Performance overhead or GIL interaction when capturing high-volume C output in production workloads.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.5 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 793 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,832,013 / month, #3,510 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3 |
Evidence: wurlitzer-3.1.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “capture c output python”
- wurlitzerCaptures C-level stdout and stderr output in Python using os.dup2,…
- subprocess-multiteeMultiplexes subprocess stdout/stderr to multiple destinations…
- subprocess-teeA drop-in replacement for subprocess.run that captures output while…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also subprocess-multitee · logistro · scripttest · EasyProcess · execnb · subprocess-tee · pytest-catchlog · subprocess.run · subprocrunner · spur