PythonHub Logo Python Hub Weekly Digest for 2025-07-20

This week in Python, a popular video demonstrated how to use abstractions to avoid spaghetti code in Python projects. The throttled-py library was introduced, offering Python rate limiting with multiple algorithms and storage backends. An article discussed the benefits of deploying Django projects with Coolify, while another explored how type annotations are transforming Python. The desto tool was highlighted, which allows you to manage your bash and Python scripts through a web dashboard. Other notable topics included the optimization of LLM workflows, Python performance tricks, and the scaling of recommendation services at OLX. Have a great week and happy coding!

đź’– Most Popular

How I Use Abstraction to Avoid Spaghetti Code
The video explains why Python projects often devolve into "spaghetti code" and shows how using abstractions such as Callable, Abstract Base Classes (ABC), and Protocol can make codebases more modular, testable, and maintainable. Through a step-by-step refactoring of an image processing example, it highlights how applying the right abstractions early reduces coupling and import complexity...

throttled-py: Python rate limiting library with multiple algorithms (Fixed Window, Sliding Window, Token Bucket, Leaky Bucket & GCRA) and storage backends (Redis, In-Memory).
It is available in both synchronous and asynchronous modes, supports waiting and retrying mode, provides access methods such as function call / function calls/decorators/context managers.

Hosting your Django sites with Coolify
The article explains how deploying Django projects with Coolify streamlines the process by containerizing the app with Docker, automating builds, and managing environment variables through Coolify’s UI. This approach enables easier, near zero-downtime deployments compared to manual server setups, though users should note some nuances with environment variable availability during build steps.

Types are Transforming Python
The article describes how type annotations and new typing features have transformed Python, making code more robust, maintainable, and easier to understand by enabling static analysis, better tooling, and safer refactoring. Modern additions like data classes, generics, protocols, and TypedDict have improved both developer experience and runtime capabilities, allowing Python to compete mo...

desto
desto lets you run and manage your bash and Python scripts in the background (inside tmux sessions) through a simple web dashboard. Launch scripts, monitor their and your system's status, view live logs, and control sessions—all from your browser.


đź“– Articles

microsoft / mcp-for-beginners
This open-source curriculum is designed to teach the concepts and fundamentals of the Model Context Protocol (MCP), with practical examples in .NET, Java, TypeScript, JavaScript and Python.

Optimizing Tool Selection for LLM Workflows: Differentiable Programming with PyTorch and DSPy
How local, learnable routers can reduce token overhead, lower costs, and bring structure back to agentic workflows.

Why This Python Performance Trick Doesn’t Matter Anymore
A deep dive into Python’s name resolution, bytecode, and how CPython 3.11 quietly made a popular optimization irrelevant.

Agentic checkout in ~100 lines of Python
The post demonstrates how to build a functional agentic checkout system in around 100 lines of Python using LLMs and the Browser Use library, enabling automated online purchases by navigating, filling forms, and extracting order data. It highlights practical challenges like prompt tuning for determinism, implementing structured outputs with Pydantic, and adding guardrails to ensure safe ...

Watchfiles: Simple, modern and fast file watching for Python, written in Rust

Lost Chapter of Automate the Boring Stuff: Audio, Video, and Webcams in Python

Reflections on 2 years of CPython's JIT Compiler: The good, the bad, the ugly

TEN VAD
An open-source solution designed to supercharge your Voice AI Agents with lightning-fast, human-like conversations!Low- latency,lightweight and high performance.

Solving Wordle with uv's dependency resolver
The post describes how the author models Wordle as a dependency resolution problem, using the Python tool uv to encode Wordle’s feedback and constraints as package dependencies. By representing possible words and letter positions as package versions and leveraging uv’s resolver, the author creates an automated solver that efficiently narrows down solutions based on Wordle guesses and fee...

uv: Making Python Local Workflows FAST and BORING in 2025
The video demonstrates how to create fast, reliable local Python workflows for production projects using the uv packaging tool, highlighting practical techniques to streamline dependency management, automate tasks, and reduce friction in day-to-day development. It also covers integrating tools like Just, Overmind, and Direnv to further enhance workflow ergonomics and team collaboration.

How to Avoid N+1 Queries in Django Python
We'll see what N+1 queries are, why they can be an issue for your application, and how to mitigate them using Django’s best practices.

Scaling recommendations service at OLX
The article details how OLX scaled its Python-based FastAPI recommendation service to handle tens of thousands of requests per second by optimizing infrastructure and architecture. Key strategies included efficient request handling, robust monitoring, and leveraging cloud resources to ensure reliability and scalability during rapid user and data growth.

Dict Unpacking in Python

Python Hub Weekly Digest for 2025-07-13


⚙️ Projects

xai-sdk-python
The official Python SDK for the xAI API.

trae-agent
Trae Agent is an LLM-based agent for general purpose software engineering tasks.

Unmute
Make text LLMs listen and speak.

PhotoshopAPI
A modern and performant C++20 read/write parser of Photoshop Files (*.psd and *.psb) with fully fledged Python bindings hosted on PyPi.

Radiate
A fast and flexible evolution engine for implementing artificial evolution and genetic programming techniques.



← Previous

Project by Ruslan Keba. Since 2012. Powered by Python. Made in đź‡şđź‡¦Ukraine.