PythonHub
2.53K subscribers
2.35K photos
50.1K links
News & links about Python programming.
https://pythonhub.dev/
Download Telegram
Shrink Your Python Container in One Command with SlimToolkit

Use SlimToolkit to shrink a Python container by half in one command. No Dockerfile changes. Walkthrough on a chatbot with common edge cases and fixes.

https://codecut.ai/shrink-python-container-slimtoolkit/
1
When Python manual wiring turns into copy-paste architecture

A small typed dependency injection approach for apps that outgrow copy-pasted constructors but do not need a full DI framework.

https://vshulcz.hashnode.dev/when-python-manual-wiring-turns-into-copy-paste-architecture
What types of exceptions should you catch?

The trickiest programming bugs are often caused by catching exceptions that you didn't mean to catch or handling exceptions in ways that obfuscate the actual error that's occurring. Which exceptions should you catch and which should you leave unhandled?

https://www.pythonmorsels.com/what-types-of-exceptions-should-you-catch/
Macro Evals for Agentic Systems

This cookbook outlines a macro-evaluation workflow for analyzing multi-agent systems at scale using a simulated electric vehicle order pipeline. It demonstrates how to look past individual responses and evaluate systemic behaviors such as orchestration, routing, and tool choices by combining lower-level execution checks (via Promptfoo) into population-level trace analyses to discover and...

https://developers.openai.com/cookbook/examples/partners/macro_evals_for_agentic_systems/macro_evals_for_agentic_systems
PookieDb

Django-style ORM for SQLite and PostgreSQL. Chainable QuerySet API, migrations, relationships, and an interactive CLI. Works outside Django.

https://pypi.org/project/pookiedb/
Breaking Circular Imports in Python Without Losing Type Safety

The article explores practical techniques for handling circular imports in Python while preserving static type safety, using a financial modeling framework as a real-world example. It argues that strategically placed local imports and dependency thunks are often the least-bad solution, offering better type checking and maintainability than context dictionaries, builder patterns, or large...

https://www.orcaset.com/blog/breaking-circular-imports-in-python-without-losing-type-safety
Django: introducing django-integrity-policy

The article introduces django-integrity-policy, a package that helps Django applications enforce browser Integrity Policy headers, protecting against unauthorized or tampered third-party scripts and resources.

https://adamj.eu/tech/2026/05/31/introducing-django-integrity-policy/
AI Engineering for Developers

A tour through AI engineering for developers who already know how to ship software. Fourteen chapters, no LinkedIn voice, no slow warm-up. We will go from 'what is a foundation model' to 'how do you run agents in production on Google Cloud' without skipping the parts that matter.

https://www.lucavall.in/blog/ai-engineering-for-developers