{
  "@context": "https://schema.org",
  "@id": "https://aggr.aymericbeaumet.com/items/simonwillison-net/2026-09-11-don-t-sleep-on-wrapture/#webpage",
  "@type": [
    "WebPage",
    "ArchiveComponent"
  ],
  "articleBody": "Graham Dumpleton's new monkey patching package [wrapture](https://wrapture.readthedocs.io/) is shaping up to be an indispensable tool for Python developers. I'm not sure why I've seen so little buzz about it!\n\nGraham has been posting new tutorials for it almost daily since [the initial release](https://simonwillison.net/2026/Aug/31/introducing-wrapture/) on August 31st. Here's everything he's published so far:\n\n- [Introducing wrapture](https://grahamdumpleton.me/posts/2026/08/introducing-wrapture/) - a new monkey patching library that serves both testing and observability (think New Relic style tracing) at the same time.\n- [Unit testing with wrapture](https://grahamdumpleton.me/posts/2026/09/unit-testing-with-wrapture/) - how to use it for the same kinds of thing as `unittest.mock`.\n- [Recording calls with wrapture](https://grahamdumpleton.me/posts/2026/09/recording-calls-with-wrapture/) - recording method calls as timelines and processing and displaying them as trees.\n- [Phased behaviour in wrapture](https://grahamdumpleton.me/posts/2026/09/phased-behaviour-in-wrapture/) - arranging patched methods to change behavior across multiple calls.\n- [Beyond callables in wrapture](https://grahamdumpleton.me/posts/2026/09/beyond-callables-in-wrapture/) - monkey patching attributes, dictionaries, generators.\n- [Live tracing with wrapture](https://grahamdumpleton.me/posts/2026/09/live-tracing-with-wrapture/) - tracing a live application to see exactly how it works.\n- [Zero-code tracing with wrapture](https://grahamdumpleton.me/posts/2026/09/zero-code-tracing-with-wrapture/) - configuring tracing in a separate TOML file without modifying Python code at all.\n- [Tracing Flask with wrapture](https://grahamdumpleton.me/posts/2026/09/tracing-flask-with-wrapture/) - using the separate [wrapture-instrumenation](https://github.com/GrahamDumpleton/wrapture-instrumentation) package to instrument a Flask application. That package also provides instrumentation for `aiohttp.client`, `aiohttp.web`, `django`, `fastapi`, `flask`, `grpc`, `http.client`, `httpx`, `jinja2`, `requests`, `sqlalchemy`, `sqlite3`, `starlette`, `urllib.request`, `urllib3`, `uvicorn`, `werkzeug.serving`, `wsgiref.simple_server`, `xmlrpc.client`, `xmlrpc.server`.\n- [Finding slow code with wrapture](https://grahamdumpleton.me/posts/2026/09/finding-slow-code-with-wrapture/) - wrapture's tools for recording timing information, both individually and aggregated across multiple calls.\n- [OpenTelemetry export in wrapture](https://grahamdumpleton.me/posts/2026/09/opentelemetry-export-in-wrapture/) - exporting traces to OpenTelemetry.\n\nGraham also has a [set of interactive workshops](https://github.com/GrahamDumpleton/wrapture-workshops) for wrapture, implemented as JupyterLab notebooks.\n\nWrapture is still alpha software but it's already very usable - especially given you can configure and try it out with a TOML file without modifying any Python code at all.\n\nThis feels like one of those Swiss Army Knife packages that, once mastered, will provide value against all sorts of problems for years to come.\n",
  "authors": [],
  "captured_at": "2026-09-11T17:43:44.917817170+00:00",
  "category": "programming",
  "content_html": "<p>Graham Dumpleton's new monkey patching package <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://wrapture.readthedocs.io/\">wrapture</a> is shaping up to be an indispensable tool for Python developers. I'm not sure why I've seen so little buzz about it!</p>\n<p>Graham has been posting new tutorials for it almost daily since <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://simonwillison.net/2026/Aug/31/introducing-wrapture/\">the initial release</a> on August 31st. Here's everything he's published so far:</p>\n<ul>\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://grahamdumpleton.me/posts/2026/08/introducing-wrapture/\">Introducing wrapture</a> - a new monkey patching library that serves both testing and observability (think New Relic style tracing) at the same time.</li>\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://grahamdumpleton.me/posts/2026/09/unit-testing-with-wrapture/\">Unit testing with wrapture</a> - how to use it for the same kinds of thing as <code>unittest.mock</code>.</li>\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://grahamdumpleton.me/posts/2026/09/recording-calls-with-wrapture/\">Recording calls with wrapture</a> - recording method calls as timelines and processing and displaying them as trees.</li>\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://grahamdumpleton.me/posts/2026/09/phased-behaviour-in-wrapture/\">Phased behaviour in wrapture</a> - arranging patched methods to change behavior across multiple calls.</li>\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://grahamdumpleton.me/posts/2026/09/beyond-callables-in-wrapture/\">Beyond callables in wrapture</a> - monkey patching attributes, dictionaries, generators.</li>\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://grahamdumpleton.me/posts/2026/09/live-tracing-with-wrapture/\">Live tracing with wrapture</a> - tracing a live application to see exactly how it works.</li>\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://grahamdumpleton.me/posts/2026/09/zero-code-tracing-with-wrapture/\">Zero-code tracing with wrapture</a> - configuring tracing in a separate TOML file without modifying Python code at all.</li>\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://grahamdumpleton.me/posts/2026/09/tracing-flask-with-wrapture/\">Tracing Flask with wrapture</a> - using the separate <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/GrahamDumpleton/wrapture-instrumentation\">wrapture-instrumenation</a> package to instrument a Flask application. That package also provides instrumentation for <code>aiohttp.client</code>, <code>aiohttp.web</code>, <code>django</code>, <code>fastapi</code>, <code>flask</code>, <code>grpc</code>, <code>http.client</code>, <code>httpx</code>, <code>jinja2</code>, <code>requests</code>, <code>sqlalchemy</code>, <code>sqlite3</code>, <code>starlette</code>, <code>urllib.request</code>, <code>urllib3</code>, <code>uvicorn</code>, <code>werkzeug.serving</code>, <code>wsgiref.simple_server</code>, <code>xmlrpc.client</code>, <code>xmlrpc.server</code>.</li>\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://grahamdumpleton.me/posts/2026/09/finding-slow-code-with-wrapture/\">Finding slow code with wrapture</a> - wrapture's tools for recording timing information, both individually and aggregated across multiple calls.</li>\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://grahamdumpleton.me/posts/2026/09/opentelemetry-export-in-wrapture/\">OpenTelemetry export in wrapture</a> - exporting traces to OpenTelemetry.</li>\n</ul>\n<p>Graham also has a <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/GrahamDumpleton/wrapture-workshops\">set of interactive workshops</a> for wrapture, implemented as JupyterLab notebooks.</p>\n<p>Wrapture is still alpha software but it's already very usable - especially given you can configure and try it out with a TOML file without modifying any Python code at all.</p>\n<p>This feels like one of those Swiss Army Knife packages that, once mastered, will provide value against all sorts of problems for years to come.</p>\n",
  "content_markdown": "Graham Dumpleton's new monkey patching package [wrapture](https://wrapture.readthedocs.io/) is shaping up to be an indispensable tool for Python developers. I'm not sure why I've seen so little buzz about it!\n\nGraham has been posting new tutorials for it almost daily since [the initial release](https://simonwillison.net/2026/Aug/31/introducing-wrapture/) on August 31st. Here's everything he's published so far:\n\n- [Introducing wrapture](https://grahamdumpleton.me/posts/2026/08/introducing-wrapture/) - a new monkey patching library that serves both testing and observability (think New Relic style tracing) at the same time.\n- [Unit testing with wrapture](https://grahamdumpleton.me/posts/2026/09/unit-testing-with-wrapture/) - how to use it for the same kinds of thing as `unittest.mock`.\n- [Recording calls with wrapture](https://grahamdumpleton.me/posts/2026/09/recording-calls-with-wrapture/) - recording method calls as timelines and processing and displaying them as trees.\n- [Phased behaviour in wrapture](https://grahamdumpleton.me/posts/2026/09/phased-behaviour-in-wrapture/) - arranging patched methods to change behavior across multiple calls.\n- [Beyond callables in wrapture](https://grahamdumpleton.me/posts/2026/09/beyond-callables-in-wrapture/) - monkey patching attributes, dictionaries, generators.\n- [Live tracing with wrapture](https://grahamdumpleton.me/posts/2026/09/live-tracing-with-wrapture/) - tracing a live application to see exactly how it works.\n- [Zero-code tracing with wrapture](https://grahamdumpleton.me/posts/2026/09/zero-code-tracing-with-wrapture/) - configuring tracing in a separate TOML file without modifying Python code at all.\n- [Tracing Flask with wrapture](https://grahamdumpleton.me/posts/2026/09/tracing-flask-with-wrapture/) - using the separate [wrapture-instrumenation](https://github.com/GrahamDumpleton/wrapture-instrumentation) package to instrument a Flask application. That package also provides instrumentation for `aiohttp.client`, `aiohttp.web`, `django`, `fastapi`, `flask`, `grpc`, `http.client`, `httpx`, `jinja2`, `requests`, `sqlalchemy`, `sqlite3`, `starlette`, `urllib.request`, `urllib3`, `uvicorn`, `werkzeug.serving`, `wsgiref.simple_server`, `xmlrpc.client`, `xmlrpc.server`.\n- [Finding slow code with wrapture](https://grahamdumpleton.me/posts/2026/09/finding-slow-code-with-wrapture/) - wrapture's tools for recording timing information, both individually and aggregated across multiple calls.\n- [OpenTelemetry export in wrapture](https://grahamdumpleton.me/posts/2026/09/opentelemetry-export-in-wrapture/) - exporting traces to OpenTelemetry.\n\nGraham also has a [set of interactive workshops](https://github.com/GrahamDumpleton/wrapture-workshops) for wrapture, implemented as JupyterLab notebooks.\n\nWrapture is still alpha software but it's already very usable - especially given you can configure and try it out with a TOML file without modifying any Python code at all.\n\nThis feels like one of those Swiss Army Knife packages that, once mastered, will provide value against all sorts of problems for years to come.\n",
  "dateCreated": "2026-09-11T17:43:44.917817170+00:00",
  "date_created": "2026-09-11T13:51:32+00:00",
  "date_modified": "2026-09-11T13:51:32+00:00",
  "date_published": "2026-09-11T13:51:32+00:00",
  "description": "Graham Dumpleton's new monkey patching package wrapture is shaping up to be an indispensable tool for Python developers. I'm not sure why I've seen so little buzz about it! Graham has been posting new tutorials for it almost daily since…",
  "external_url": "https://simonwillison.net/2026/Sep/11/wrapture/",
  "git": {
    "commit": "ebb0941c5c06a2ab2377342d607535262a3e969e",
    "path": "items/simonwillison-net/2026/09/2026-09-11-don-t-sleep-on-wrapture.md",
    "permalink": "https://github.com/aymericbeaumet/aggr-instance/blob/ebb0941c5c06a2ab2377342d607535262a3e969e/items/simonwillison-net/2026/09/2026-09-11-don-t-sleep-on-wrapture.md"
  },
  "id": "urn:aggr:item:4caa1c6c530ca2067c0f16cb9783eb203bc0e120",
  "isBasedOn": {
    "@id": "https://simonwillison.net/2026/Sep/11/wrapture/"
  },
  "mainEntity": {
    "@id": "https://simonwillison.net/2026/Sep/11/wrapture/",
    "@type": "CreativeWork",
    "archivedAt": {
      "@id": "https://aggr.aymericbeaumet.com/items/simonwillison-net/2026-09-11-don-t-sleep-on-wrapture/#webpage"
    },
    "dateModified": "2026-09-11T13:51:32+00:00",
    "datePublished": "2026-09-11T13:51:32+00:00",
    "headline": "Don't sleep on wrapture",
    "timeRequired": "PT2M",
    "url": "https://simonwillison.net/2026/Sep/11/wrapture/",
    "wordCount": 296
  },
  "name": "Archived snapshot: Don't sleep on wrapture",
  "preview": null,
  "reading_minutes": 2,
  "replicated_at": null,
  "source": "simonwillison-net",
  "source_name": "Simon Willison's Weblog",
  "summary": "Graham Dumpleton's new monkey patching package wrapture is shaping up to be an indispensable tool for Python developers. I'm not sure why I've seen so little buzz about it! Graham has been posting new tutorials for it almost daily since the initial release on August 31st. Here's everything he's published so far: Introducing wrapture - a new monkey patching library that serves both testing and observability (think New Relic style tracing) at the same time. Unit testing with wrapture - how to use it for the same kinds of thing as unittest.mock. Recording calls with wrapture - recording method calls as timelines and processing and displaying them as trees. Phased behaviour in wrapture - arranging patched methods to change behavior across multiple calls. Beyond callables in wrapture - monkey patching attributes, dictionaries, generators. Live tracing with wrapture - tracing a live application to see exactly how it works. Zero-code tracing with wrapture - configuring tracing in a separate TOML file without modifying Python code at all. Tracing Flask with wrapture - using the separate wrapture-instrumenation package to instrument a Flask application. That package also provides instrumentation for aiohttp.client, aiohttp.web, django, fastapi, flask, grpc, http.client, httpx, jinja2, requests, sqlalchemy, sqlite3, starlette, urllib.request, urllib3, uvicorn, werkzeug.serving, wsgiref.simple_server, xmlrpc.client, xmlrpc.server. Finding slow code with wrapture - wrapture's tools for recording timing information, both individually and aggregated across multiple calls. OpenTelemetry export in wrapture - exporting traces to OpenTelemetry. Graham also has a set of interactive workshops for wrapture, implemented as JupyterLab notebooks. Wrapture is still alpha software but it's already very usable - especially given you can configure and try it out with a TOML file without modifying any Python code at all. This feels like one of those Swiss Army Knife packages that, once mastered, will provide value against all sorts of problems for years to come. Tags: graham-dumpleton, open-source, testing, python, observability, monkey-patching",
  "tags": [
    "graham-dumpleton",
    "monkey-patching",
    "observability",
    "open-source",
    "python",
    "testing"
  ],
  "temporalCoverage": "2026-09-11T17:43:44.917817170+00:00",
  "title": "Don't sleep on wrapture",
  "url": "https://aggr.aymericbeaumet.com/items/simonwillison-net/2026-09-11-don-t-sleep-on-wrapture/",
  "word_count": 296
}