Search the archive

14,355 indexed articles, 13,283 of them summarised by us.

Articles
14,355
Research papers
91,965
Models priced
2,249
Providers
163

2 results for “wrapture”

Newest and most relevant first

Don't sleep on wrapture

Python developers get a free alpha tool that can add unit-test mocking, call recording, timing analysis and OpenTelemetry tracing to live applications without touching any Python code, just a TOML config file.

Wrapture is a free Python tool released on August 31st that can temporarily swap parts of a running program for testing or watching what the program does, a technique called monkey patching. It can record every function call, trace slow code, and send timing data to standard monitoring systems. Python programmers who build, test or debug software can use it, though it is still alpha software.

Graham Dumpleton, the creator of a popular Python web-hosting tool, has released wrapture, an open-source alpha library for instrumenting and testing Python applications. The main draw for teams is zero-code operation: tracing is configured in a TOML file rather than by editing code, lowering adoption risk. It ships with a companion package covering major Python frameworks and exports to OpenTelemetry, a common industry standard, so it could complement or compete with existing paid monitoring setups.

Wrapture is a monkey patching library supporting both unittest.mock-style test mocking and New Relic-style observability. It records call timelines as trees, supports phased behaviour across multiple calls, and can patch attributes, dictionaries and generators as well as callables. Zero-code tracing is configured via TOML, and the companion wrapture-instrumentation package instruments flask, django, fastapi, grpc, httpx, sqlalchemy and roughly 15 other libraries. Traces export to OpenTelemetry; it remains in alpha.

Simon Willison’s Weblog →

Introducing wrapture

Wrapture gives Python engineers a single monkeypatching-based tool to replace unittest.mock stubs and add OpenTelemetry tracing to code they don't control.

A veteran Python developer named Graham Dumpleton has released Wrapture, a new free tool, just weeks old. It lets programmers wrap any function so its behaviour can be watched or changed without editing the original code. That means it can be used both for testing, standing in for slow or risky parts of a program, and for tracing what a program does. Notably, every line was written by an AI assistant under his direction.

Wrapture, a new open-source Python library from wrapt creator Graham Dumpleton, targets the testing and observability tooling market currently served by Python's built-in unittest.mock. It also carries an unusually strong pitch: it was built entirely by an AI assistant under expert direction, not vibe coded. For teams, the risk is low and the gain is a configuration-based way to trace existing projects; it's weeks old, so maturity is unproven.

Wrapture extends wrapt's monkeypatching to testing and tracing: bindings like wrapture.binding(Gateway, "charge") support stubbed returns and result transforms via context managers, positioning it against unittest.mock. Tracing targets are declared in TOML config with sinks such as jsonlines, and OpenTelemetry export is built in. The project is a few weeks old, and Dumpleton states every line of code and documentation was AI-written under his design direction.

Simon Willison’s Weblog →