Bite-sized actionable content, practical tutorials, and resources for Python programmers.#70Python Hits All-Time High, New Type Checker ‘ty’, SQL-Ready ML Pipelines, and Debugging RAG with raggyLive Webinar | Scale AppSec with Security Champions – May 15Security Champions programs are a proven way to scale AppSec across dev teams. Join Snyk’s live webinar on May 15 @ 11AM ET✓ Defining the role of security champions✓ Designing a scalable, tailored program✓ Recognizing, rewarding & growing your champions🎓 BONUS: Earn CPE credits for attending!Save your spot now!Hi ,Welcome to a brand new issue of PythonPro!News Highlights: Python hits an all-time high in the Tiobe Index, solidifying its dominance; Astral unveils ty, a fast new type checker built to scale alongside Ruff and UV; Python 3.14 enters beta with t-strings and key PEPs for type checking and debugging; Orbital lets developers run scikit-learn pipelines as pure SQL directly inside databases.My top 5 picks from today’s learning resources:What’s Happening to Embeddings During Training?🧠How to Build an MCP Server in 5 Lines of Python🔌Unleashing gst-python-ml: Python-powered ML analytics for GStreamer pipelines🎥Engineer Python projects like a PRO🛠️Top Python Code Quality Tools to Improve Your Development Workflow🧹And, in From the Cutting Edge, we introduce raggy, a developer tool that enables real-time, interactive debugging of Retrieval-Augmented Generation (RAG) pipelines by combining a Python library of composable components with a visual interface for rapid iteration and evaluation.Stay awesome!Divya Anne SelvarajEditor-in-ChiefPractical workshops and technical sessions with 20+ ML engineers and researchers.• Sebastian Raschka: Live AMA on Large Language Models• Khuyen Tran: GPTs for time series forecasting• Luca Massaron, Thomas Nield, and others: Applied ML at scaleUse code EARLY40 for 40% off.Register with EARLY40Sign Up|Advertise🐍 Python in the Tech 💻 Jungle 🌳🗞️NewsPython popularity climbs to highest ever – Tiobe: Python has reached its highest-ever Tiobe Index rating at 25.35% in May 2025, surpassing all languages since Java’s 2001 peak.ty: Astral's New Type Checker (Formerly Red-Knot) - Talk Python to Me Ep. 506:Developed as a complement to Astral’s popular toolsRuffandUV,tyaims to offer faster, scalable, and more beginner-friendly type checking. It focuses on performance, better editor integration, and smoother adoption in large codebases. TY will be released as a standalone tool, not a drop-in replacement for MyPy or Pyright.Python's T-Strings Coming Soon and Other Python News for May 2025: Python 3.14 enters beta with PEP 750 introducing reusable template strings (t-strings) and PEPs 751, 768, and 781 enhancing dependency tracking, debugging safety, and type-checking support.Orbital for Python released: Orbital converts trained scikit-learn pipelines into pure SQL, enabling machine learning model execution directly within databases—no Python runtime needed.💼Case Studies and Experiments🔬An Empirical Study on the Performance and Energy Usage of Compiled Python Code: Evaluates Python compilers across seven benchmarks using eight compilation tools. Codon, PyPy, and Numba showed over 90% improvement in speed and energy, while Nuitka reduced memory use consistently.I Taught My Fridge Inventory to Text Me When I’m Out of Milk: Combines a Raspberry Pi, Python, OCR (Tesseract), and Twilio to automate fridge inventory tracking.📊AnalysisWhat’s Happening to Embeddings During Training?: Investigates how embedding vectors evolve during training by analyzing metrics like Gini index, Hoyer sparsity, vector entropy, and spectral entropy.PyTorch Tensors Explained: Explains how PyTorch handles tensors—covering memory layout, strides, and autograd—to help developers understand efficient tensor operations and automatic differentiation.🎓Tutorials and Guides🤓How to Build an MCP Server in 5 Lines of Python: Shows you how to turn a Python function into an LLM-compatible tool by launching an MCP server using Gradio in just five lines of code. It covers setup, deployment, and integration with MCP clients like Claude Desktop and Cursor.Data Profiling in Python: common ways to explore your data (part 2): Introduces practical techniques for data profiling, focusing on using value_counts() to analyze categorical variables and understand dataset composition.5 steps to N-body simulation: Teaches beginners to build efficient N-body gravity simulations in Python through initial setup, implementing gravity, basic simulation, higher-order methods, and adaptive time-stepping.Unleashing gst-python-ml: Python-powered ML analytics for GStreamer pipelines: This new Python framework enables real-time video analytics using Python tools, and supports object detection, tracking, captioning, and more.The Python Profilers: Explains how to use Python’s deterministic profilers—cProfile and profile —to analyze performance by measuring function call frequency and duration and covers usage examples.Automating code deletion with Gemini (and a little Python): Details how the author used Gemini 2.0 Flash and Python to automate the removal of outdated docgen code from 235 GN build files after migrating Pigweed’s documentation system to Bazel.📖Open Source Book | Causal Inference for The Brave and True by Matheus Facure Alves: Offers a Python-based, practical introduction to causal inference, balancing rigorous theory with humour and real-world examples. Part I covers foundational methods like causal graphs and regression; Part II explores modern, tech-focused approaches like CATE and meta-learners.🔑Best Practices and Advice🔏Engineer Python projects like a PRO: Guides AI engineers on structuring Python projects using modern tools like uv, ruff, and Docker Compose, while advocating for a monorepo setup to improve code quality, reproducibility, and scalability in real-world development.Top Python Code Quality Tools to Improve Your Development Workflow: Covers linters, formatters, type checkers, security scanners, test coverage, profiling, and CI/CD integration.Kate and Python language server:Explains how to configure the python-lsp-server in the Kate editor to work smoothly with Python virtual environments by using a custom bash script (pylsp_in_env) and enabling the ruff plugin for linting."AI Coffee" Grand Opening This Monday • A Story About Parameters and Arguments in Python Functions:Uses a coffee shop analogy to explain Python function parameters, covering positional and keyword arguments,*args and**kwargs, default values, and more.What does @Slot() do?: Explains the role of the @Slot() decorator in PySide6, showing that while it's optional for most signal-slot connections, it's required for thread-safe execution and slightly improves memory efficiency.🔍From the Cutting Edge: Raggy–RAG Without the Lag💥In RAG Without the Lag: Interactive Debugging for Retrieval-Augmented Generation Pipelines, Lauro et al. introduce raggy, a developer tool designed to simplify debugging and iterative development of Retrieval-Augmented Generation (RAG) pipelines. The study comes from researchers at the University of Pittsburgh and UC Berkeley.ContextRAG is a technique that combines a retriever and an LLM to generate responses based on external documents. It's widely used to build AI assistants that require domain-specific knowledge, with 86% of enterprise LLM deployments reportedly using it as of 2024.However, RAG pipelines are notoriously hard to debug. Retrieval and generation are deeply intertwined, and developers must tune many parameters (chunk size, retrieval method, prompt wording, etc.) while enduring long feedback loops, often involving time-intensive re-indexing. Existing tools don’t support rapid iteration or show how changes in one part affect the whole pipeline.Key Features of raggyComposable Python primitives for defining RAG pipelines (e.g., Query, Retriever, LLM, Answer).Interactive debugging interface that visualises chunk retrieval quality and generated outputs.Real-time parameter editing for chunk size, retrieval methods, LLM prompts, and more.Versioned checkpoints to rollback and test alternative pipeline states.Support for manual overrides, allowing direct selection of chunks or editing of LLM responses.Evaluation tools, including the ability to save “golden” answers and compare outputs.What This Means for Youraggy is especially relevant for machine learning engineers, LLM application developers, and data scientists working on question-answering systems, enterprise chatbots, or knowledge-intensive assistants. With raggy, you can debug your RAG pipeline interactively, isolate root causes of errors, and iterate without costly delays. It is designed to fit within Python-based workflows and support both experienced and novice developers alike.Examining the DetailsTo evaluate raggy’s effectiveness, the authors conducted a user study involving 12 developers with prior experience building production-grade RAG pipelines. Participants were asked to improve a baseline question-answering system over a corpus of 220 hospital documents. The study followed a think-aloud protocol, with participants engaging in tasks such as debugging poorly performing queries, handling noisy inputs, and rejecting irrelevant questions. The authors observed that developers consistently started by validating the retrieval component—manually inspecting and adjusting chunk size, retrieval methods, or number of chunks—before moving on to LLM generation. This retriever-first strategy persisted even when LLM components preceded retrieval in the pipeline, underscoring the centrality of retrieval quality in RAG debugging.raggy’s low-latency feedback was particularly well received. On average, 71.3% of parameter changes would have required document re-indexing in traditional workflows, yet participants could implement and test these changes instantly within raggy. The tool’s pre-materialisation of hundreds of vector indexes (across chunk sizes and retrieval methods) and its checkpointing mechanism for preserving intermediate pipeline states enabled this rapid iteration. Participants also appreciated how the tool integrated seamlessly with their existing Python code, automatically generating an interactive UI without requiring manual configuration. This reduced context switching and allowed them to stay focused on the debugging task.You can learn more by reading the entire paper or looking at the source code on GitHub.And that’s a wrap.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere. The complete PythonPro archives can be foundhere.If you have any suggestions or feedback, or would like us to find you a Python learning resource on a particular subject, just respond to this email!*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{font-size:75%;line-height:0}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more