Python Weekly (Issue 746 May 21 2026)

Welcome to issue 746 of Python Weekly. Let's get straight to the links this week.

$992 Billion in Art Could Change Hands. Why Are These 71,105 Investors Paying Close Attention?

Deloitte ran the numbers. They project UHNW art and collectibles wealth -- already at $2.5 trillion -- to hit $3.47 trillion by 2030.

The institutional world has been quietly preparing for this. Back in 2011, 25% of wealth managers surveyed offered art-related services. In 2024, 51%. Family offices now average a 13.4% allocation to art and collectibles. And it’s not just because they love art. It’s because they like the math.

These positions were built over decades through private dealer relationships most investors never had. The access just wasn't there.

Masterworks is changing that:

  • 71,000+ investors

  • $1.3B deployed across 525+ artworks

  • 29 closed sales

  • Net annualized returns like 16.5%, 17.6%, and 17.8%, not including those unsold.

Investing involves risk. Past performance is not indicative of future returns. See important disclosures at masterworks.com/cd.


Articles, Tutorials and Talks

The post is about agent hooks as a control layer that makes AI behavior more deterministic by enforcing rules at specific lifecycle points, instead of relying on prompts alone. It emphasizes using hooks for policy enforcement, validation, and observability so teams can block bad actions, add guardrails, and make agent workflows more production-safe.

The video demonstrates how a single Python class can gradually become overloaded with unrelated responsibilities like validation, data processing, and model training, making the code harder to maintain and reason about. It then walks through refactoring the code into smaller, focused components while introducing a practical framework for deciding what logic should and should not belong inside a class.

This post details how to build a lightweight tool for monitoring file system activity on macOS without relying on third-party dependencies. It explains how to implement a Swift script that interfaces directly with Apple's native FSEvents API and forwards those live change notifications to a Python environment via stdout.

Useful for quickly prototyping APIs, AI agents, automation tools, and full-stack Python apps without local setup. SPONSOR

The video explores django-q2, a lightweight alternative to Celery for handling background jobs and asynchronous task processing in Django applications. It highlights how django-q2 simplifies setup and integration while providing built-in support for async workers, scheduled tasks, and Django Admin management features.

This guide walks through using the OpenTelemetry Python SDK's LoggingHandler to bridge Python's built-in logging module with an OpenTelemetry-compliant pipeline without changing your existing log statements. It demonstrates how to configure the handler (via dictConfig), map standard log records into structured OTel fields, and automatically correlate logs with active traces to route them through an OTLP exporter to your observability backend.

The article introduces nb-cli, a Rust-built command-line interface engineered to let developers and AI agents programmatically read, write, and execute Jupyter notebooks without needing a running server. It highlights an AI-optimized Markdown format that exposes structured token-efficient code and cell metadata, enabling language models and automated CI/CD pipelines to manipulate notebooks and isolate execution errors natively in the terminal.

A guide on LLM evaluation and AI observability, explaining how to monitor, test, and deploy reliable AI agents in production with confidence and control.

Best practices and common patterns for effectively evaluating AI agents.

The benchmark shows Django LiveView can deliver a similar LiveView-style experience to Phoenix LiveView, but it moves more data over the wire in the larger-list case. Its takeaway is that Python/Django can get surprisingly close on real-time UI performance, though Phoenix still looks leaner in network usage and latency-sensitive interactions.


Interesting Projects, Tools, and Libraries

Fast and Accurate Code Search for Agents. Uses ~98% fewer tokens than grep+read.

Autonomous Hacking Agent for Red Team.

A suite of plugins for legal workflows.

Interactive architecture diagrams for codebases.

An Agentic System for Scalable Articulated 3D Asset Generation.

Headroom compresses everything your AI agent reads - tool outputs, logs, RAG chunks, files, and conversation history - before it reaches the LLM. Same answers, fraction of the tokens.

Project-aware tab completion for Django's manage.py.

Self-hosted monitoring for Python task queues. Live dashboards, searchable task history, and alerting that fires.

GEO-first, SEO-supported. Optimize websites for AI-powered search engines.

Remove visible and invisible AI watermarks from images generated by Google Gemini (Nano Banana), ChatGPT / DALL-E, Stable Diffusion, Adobe Firefly, Midjourney, and other AI models.


New Releases

Upcoming Events and Webinars

Join the global Python, data science, and AI community in London on June 5–6 for two days of expert talks, hands-on learning, and networking with practitioners from across industry and academia. Hear from leading voices in the Python ecosystem, explore the latest in data science and machine learning, and connect with fellow developers, researchers, and enthusiasts. Python Weekly readers get 15% off registration through May 29th with code PYTHONWEEKLY15.

The upcoming YouTube Live explores why AI systems frequently miss critical details in complex workflows like contract review, despite sounding confident in their responses. It will demonstrate a Python-based agentic review system that uses specialized subagents, validation, memory management, and audit trails to make AI workflows more reliable and accountable.

There will be following talks

  • Docker for Python Users

  • Enum Deep Cuts: Lessons from Enums in ty

There will be following talks

  • Text2SQL in the Wild — Agentic Workflows & Semantic Models on Customer Data

  • Interpreting and Communicating Statistical Models

There will be following talks

  • What a Single-File LLM Security Analyzer Taught Us?

  • Getting reliable text when PDFs lie and OCR fails

There will be following talks

  • Popular Python Packages Series

  • PyCon 2026 Recap

  • Side hustle infrastructure

  • Give Your Agents REPLs

There will be following talks

  • How to rewrite a microservice in Python

  • OpenClaw in Practice: Building Useful Agentic AI Workflows

There will be following talks

  • Accelerated Knowledge Discovery at NASA: Building an Agentic AI Research Companion

  • Production-Ready AI Agents: Containerization, Sandboxes, and the LangChain Stack

  • Science in the Agentic Era: Structured Experimentation with ado

There will be following talks

  • How to handle homelab paranoia with Arroyo

  • Is Python's dependence on C being corroded?


Our Other Newsletters

Programmer Weekly - A free weekly newsletter for programmers.

Founder Weekly - A free weekly newsletter for entrepreneurs featuring best curated content, must read articles, how to guides, tips and tricks, resources, events and more.