- Published on
Introducing wrapture
- Authors

- Name
- DeepHorus
Graham Dumpleton, a renowned Python developer known for foundational projects like wrapt and the New Relic Python agent, has released a new library called Wrapture. Unveiled on August 31, 2026, the library is designed to streamline both tracing and testing in Python applications by extending the monkey-patching concepts from his earlier work. Dumpleton positions Wrapture as a versatile tool that can act as a drop-in alternative to standard mocking libraries while also providing powerful code observation capabilities.
The core innovation of Wrapture is its ability to wrap any function or method to either trace all access or override its return values. This dual functionality addresses a common developer need: attaching observation to third-party or legacy code without disturbing the program's execution. Dumpleton notes that this capability, specifically the non-intrusive recording of data flows, has been a persistent challenge he has aimed to solve throughout his career.
Key features include built-in support for OpenTelemetry, a leading observability framework, and a configuration-based system for adding tracing to existing projects. The configuration syntax, using TOML-like directives, allows developers to define targets, observation points, and output sinks, such as writing trace data to a JSON lines file. This approach simplifies integrating tracing into established codebases without extensive refactoring.
Wrapture also serves as a potent unit testing tool. It enables developers to stub methods, control return values, and even transform results from original functions during tests. Example code demonstrates clean syntax for replacing method outputs or modifying their data, offering more flexibility than traditional mocking in some scenarios.
Notably, Dumpleton reveals that Wrapture is his first large-scale project built entirely with AI assistance. He emphasizes that this was a deliberate, expert-directed engineering process, not speculative "vibe coding." Every line of code and documentation was produced by an AI assistant under his precise direction, leveraging his deep domain expertise to ensure design integrity.
While still a very young project, Wrapture has launched to what Dumpleton describes as a "very promising start." It provides a unified solution for two critical software development practices, potentially reducing complexity in Python projects. The library's approach may influence how developers integrate testing and observability in the future.
The release underscores a growing trend of seasoned developers leveraging AI tools as advanced production aids rather than autonomous creators. Dumpleton's transparent methodology highlights a model where deep subject matter expertise guides AI generation to produce robust, well-documented open-source software. As Wrapture matures, its adoption could reshape Python development workflows for both testing and system tracing.