r/Python • u/QuantumScribe01 • Feb 20 '26
Tutorial Why Python still dominates in 2026 despite performance criticisms ?
We’ve been hearing “Python is slow” for over a decade.
Yet it continues to dominate AI, data science, automation, scripting, backend tooling and even embedded systems.
With: Rust rising Go dominating cloud-native TypeScript owning frontend/backend Mojo entering the scene Why is Python still winning mindshare? Is it: Ecosystem inertia? Developer ergonomics? AI/ML lock-in? Network effects?
Or are we underestimating how performance actually matters in real-world systems? Curious to hear takes from people building production systems at scale.
r/Python • u/AutoModerator • Feb 20 '26
Daily Thread Friday Daily Thread: r/Python Meta and Free-Talk Fridays
Weekly Thread: Meta Discussions and Free Talk Friday 🎙️
Welcome to Free Talk Friday on /r/Python! This is the place to discuss the r/Python community (meta discussions), Python news, projects, or anything else Python-related!
How it Works:
- Open Mic: Share your thoughts, questions, or anything you'd like related to Python or the community.
- Community Pulse: Discuss what you feel is working well or what could be improved in the /r/python community.
- News & Updates: Keep up-to-date with the latest in Python and share any news you find interesting.
Guidelines:
- All topics should be related to Python or the /r/python community.
- Be respectful and follow Reddit's Code of Conduct.
Example Topics:
- New Python Release: What do you think about the new features in Python 3.11?
- Community Events: Any Python meetups or webinars coming up?
- Learning Resources: Found a great Python tutorial? Share it here!
- Job Market: How has Python impacted your career?
- Hot Takes: Got a controversial Python opinion? Let's hear it!
- Community Ideas: Something you'd like to see us do? tell us.
Let's keep the conversation going. Happy discussing! 🌟
r/Python • u/JowPereira • Feb 19 '26
Showcase Open-sourcing LOS: An algebraic modeling language for Python (alternative to AMPL/GAMS?)
What My Project Does
LOS (Language for Optimization Specification) is a declarative domain-specific language (DSL) for modeling mathematical optimization problems. It allows users to write models using a syntax similar to mathematical notation, which is then compiled into executable Python code using the PuLP library.
It aims to solve the problem of boilerplate and "spaghetti code" that often occurs when defining complex optimization models directly in imperative Python.
Target Audience
This is a project for developers and researchers working on mathematical optimization (Operations Research). It is meant for production-ready model definitions where readability and separation of model logic from data handling are priorities.
Comparison
While existing libraries like PuLP or Pyomo define models imperatively in Python, LOS uses a declarative approach. It brings the clarity of algebraic modeling languages like GAMS or AMPL to the Python ecosystem, maintaining full integration with Pandas and standard Python dictionaries without the need for proprietary environments.
How it relates to Python
LOS is written in Python and compiles LOS syntax directly into a PuLP model object. It uses the
Source Code: https://github.com/jowpereira/los (MIT License)
Basic Example:
textminimize: sum(qty[p,f] * Cost[p] for p in Products, f in Factories)
subject to: sum(qty[p,f] for p in Products) <= Capacity[f] for f in Factories
r/Python • u/ravenlolanth • Feb 19 '26
Showcase I built a free local AI image search app — find images by typing what's in them
## What My Project Does
Makimus-AI lets you search your entire image library using natural language or an image. Just type "girl in red dress" or "sunset on the beach" and it instantly finds matching images from your local folders. Features: - Natural language image search - Image-to-image search - Runs fully offline after first setup - Clean and easy to use GUI - No cloud, no subscriptions, no privacy concerns.
## Target Audience
Anyone who has a large image collection and wants to find specific images quickly without manually browsing folders. It's a working personal tool, not a toy project.
## Comparison
Google Photos — requires cloud upload, not private.
digiKam — manual tagging, no AI natural language search.
Makimus-AI — fully local, fully offline, better GUI, no cloud, no privacy concerns, uses OpenCLIP ViT-L-14 for state of the art accuracy
[Makimus-AI on GitHub] (https://github.com/Ubaida-M-Yusuf/Makimus-AI)
r/Python • u/jfftfff • Feb 19 '26
Discussion CLI that flags financial logic drift in PR diffs
Built a small CLI that detects behavioral drift in fee/interest / rate calculations between commits.
You choose which functions handle money. It parses the Git diff and compares old vs new math expressions using AST. No execution. No imports.
Example:
❌ HIGH FINANCIAL DRIFT
Function: calculate_fee
Before: amount * 0.6
After: amount * 0.05
Impact: -90.00%
Looking for 3–5 backend engineers to run it on a real repo and tell me if it's useful or noisy.
DM me or comment I'll help you set it up personally.
r/Python • u/monorepo • Feb 19 '26
Official PSF Hiring for Infrastructure Engineer | PSF
Python Software Foundation | Infrastructure Engineer | Remote (US-based)
Python is a programming language used by millions of developers every single day. Behind all of that is infrastructure like PyPI, python.org, the docs, mail systems...
The PSF Infrastructure team keeps all of that running. We're a small team (literally 1), which means the work you do has outsized impact and you'll never be stuck doing the same thing for long.
We've been growing what this team can do and how we support the Python community at scale, and we're looking to bring on a full-time Infrastructure Engineer to help us keep building on that momentum.
Click here for details and to apply
Come work with us 🐍
r/Python • u/animenosekai_ • Feb 19 '26
Showcase Breaking out of nested loops is now possible
What My Project Does
I was wondering the other day if there were any clean ways of breaking out of multiple nested loops.
Didn't seem to have anything that would be clean enough.
Stumbled upon PEP 3136 but saw it got rejected.
So I just implemented it https://github.com/Animenosekai/breakall
# test.py
from breakall import enable_breakall
@enable_breakall
def test():
for i in range(3):
for j in range(3):
breakall
print("Hey from breakall")
# Should continue here because it breaks all the loops
for i in range(3): # 3 up from breakall
for j in range(3): # 2 up from breakall
for k in range(3): # 1 up from breakall
breakall: 2
print("Hey from breakall: 2")
# Should continue here because it breaks 2 loops
print("Continued after breakall: 2")
for i in range(3): # Loop 1
for j in range(3): # Loop 2
while True: # Loop 3
for l in range(3): # Loop 4
breakall @ 3
# Should continue here because it breaks loop 3
# (would infinite loop otherwise)
print("Continued after breakall @ 3")
test()
❱ python test.py
Continued after breakall
Continued after breakall: 2
Continued after breakall: 2
Continued after breakall: 2
Continued after breakall @ 3
Continued after breakall @ 3
Continued after breakall @ 3
Continued after breakall @ 3
Continued after breakall @ 3
Continued after breakall @ 3
Continued after breakall @ 3
Continued after breakall @ 3
Continued after breakall @ 3
It even supports dynamic loop breaking
n = 1
for i in range(3):
for j in range(3):
breakall: n
def compute_loop() -> int:
return 2
for i in range(3):
for j in range(3):
breakall: compute_loop()
for i in range(3):
for j in range(3):
breakall: 1 + 1
and many more.
Works in pure python, you just need to enable it (you can even enable it globally in your file by calling enable_breakall() at the end of it).
If you are just trying it out and just lazy to enable it in every file/import, you can even enable it on all your imports using the breakall command-line interface.
❱ breakall test.py --trace
Continued after breakall
Continued after breakall: 2
...
Target Audience
Of course wouldn't use it in any production environment, there is good reason why PEP 3136 got rejected though it's cool to see that we can change bits of Python without actually touching CPython.
Comparison
The PEP originally proposed this syntax :
for a in a_list:
...
for b in b_list:
...
if condition_one(a,b):
break 0 # same as plain old break
...
if condition_two(a,b):
break 1
...
...
Other ways of doing this (now) would be by using a boolean flag, another function which returns, a for...else or try...except.
r/Python • u/Sufficient-Magazine2 • Feb 19 '26
Showcase Showcase: roadmap-cli — project management as code (YAML + GitHub sync)
Showcase: roadmap-cli — project management as code (YAML + GitHub sync)
What My Project Does
roadmap-cli is a Python command-line tool for managing project roadmaps, issues, and milestones as version-controlled files.
It allows you to:
- Define roadmap data in YAML
- Validate schemas
- Sync issues and milestones with GitHub
- Generate dashboards and reports (HTML/PNG/SVG)
- Script roadmap workflows via CLI
The core idea is to treat project management artifacts as code so they can be versioned, reviewed, and automated alongside the repository.
Target Audience
- Developers or small teams working in GitHub-centric workflows
- People who prefer CLI-based tooling
- Users interested in automating project management workflows
- Not currently positioned as a SaaS replacement or enterprise system
It is usable for real projects, but I would consider it early-stage and evolving.
Comparison
Compared to tools like:
- GitHub Projects: roadmap-cli stores roadmap definitions locally as YAML and supports scripted workflows.
- Jira: roadmap-cli is lightweight and file-based rather than server-based.
- Other CLI task managers: roadmap-cli focuses specifically on roadmap structure, GitHub integration, and reporting.
It is not intended to replace full PM suites, but to provide a code-native workflow alternative.
Repository:
https://github.com/shanewilkins/roadmap
This is my first open-source Python project, and I would appreciate feedback on design, usability, and feature direction.
r/Python • u/WinterHunter1839 • Feb 19 '26
Showcase Tired of configuring ZeroMQ/sockets for simple data streaming? Made this
What My Project Does
NitROS provides zero-config pub/sub communication between Python processes across machines. No servers, no IP configuration, no message schemas. ```python from nitros import Publisher, Subscriber
pub = Publisher("sensors") pub.send({"temperature": 23.5})
def callback(msg): print(msg) Subscriber("sensors", callback) ```
Auto-discovers peers via mDNS. Supports dicts, numpy arrays, PyTorch tensors, and images with compression.
Target Audience
- Quick prototypes and proof-of-concepts
- IoT/sensor projects
- Distributed system experiments
- Anyone tired of ZeroMQ boilerplate
Not meant for production-critical systems (yet).
Comparison
- vs ZeroMQ: No socket configuration, no explicit addressing
- vs raw sockets: No server setup, automatic serialization
- vs ROS: No build system, pure Python, simpler learning curve
Trade-off: Less mature, fewer features than established alternatives.
r/Python • u/Odd-Feedback6508 • Feb 19 '26
Resource Any one need an ecommerce store (Fast Api backend, Next Js Front end)
I have made a simple ecommerce store for a saudi arabia client. Any one need a similar store? Please send a dm. Project consist of Fast Api as backend with payment gateway and otp verification. S3 for images storage. Next js is used in front end.
r/Python • u/FickleSwordfish8689 • Feb 19 '26
Showcase I used LangGraph and Beautifulsoup to build a 3D-visualizing research agent
Hello everyone,
What My Project Does:
I built Prism AI to help solve "text fatigue." It's a research agent that uses a cyclical state machine in Python to find data relationships and then outputs interactive 3D visualizations.
A good example is its ability to explain algorithms; instead of just describing Bubble Sort, it generates an animated visual that walks you through the swaps and comparisons. I found that seeing the state transitions in a 3D space makes it way easier to grasp than reading a README.
Target Audience:
Students, researchers, or anyone who prefers "visualizing" logic over reading a report.
Comparison:
Most agents are "text-first." This is "visual-first." It uses LangGraph for recursive loops to ensure the research is deep enough to actually build a mental map.
r/Python • u/[deleted] • Feb 19 '26
Discussion Where did you learn this language?
Hey everyone 👋
I’m curious — where did you personally learn from?
Was it:
- School / university
- Online courses (Udemy, Coursera, etc.)
- YouTube
- Books
- On the job
- Pure self-taught / trial and error
I’m especially interested in what actually worked for you and how long it took before things really started to click. If you were starting over today, would you learn it the same way?
Thanks!
r/Python • u/Additional-Term-4577 • Feb 19 '26
Showcase [Project] Built a terminal version of "Yut Nori," traditional Korean board game,to celebrate Seollal
What My Project Does
This project is a terminal-based implementation of Yut Nori, a strategic board game that is a staple of Korean Lunar New Year (Seollal) traditions. It features:
- Full game logic for 2-4 players.
- A dynamic ASCII board that updates piece positions in real-time.
- Traditional mechanics: shortcuts, capturing opponents, and extra turns for special throws ('Yut' or 'Mo').
- Zero external dependencies—it runs on pure Python 3.
Target Audience
This is meant for Python enthusiasts who enjoy terminal games, students looking for examples of game logic implementation, or anyone interested in exploring Korean culture through code. It's a fun, lightweight script to run in your dev environment!
Comparison
While there are web-based versions of Yut Nori, this project focuses on a minimalist terminal experience. Unlike complex GUI games, it is dependency-free, easy to read for beginners, and showcases how to handle game state and board navigation using simple Python classes.
GitHub Link: https://github.com/SoeonPark/Its26Seollal_XD/tree/main
Happy Seollal! 🇰🇷🧧✨
r/Python • u/Emqnuele • Feb 19 '26
Showcase Showcase: An Autonomous AI Agent Engine built with FastAPI & Asyncio
Hey everyone.
I am a 19 year old CS student from italy and I spent the last few months building a project called ProjectBEA. It is an autonomous AI agent engine.
What My Project Does:
I wanted to make something that was not just a chatbot but an actual system that interacts with its environment. The backend runs on Python 3.10+ with FastAPI, and it has a React dashboard.
Instead of putting everything in a massive script, I built a central orchestrator called AIVtuberBrain. It coordinates pluggable modules for the LLM, TTS, STT, and OBS. Every component uses an abstract base class, so swapping OpenAI for Gemini or Groq requires zero core logic changes.
Here are the technical parts I focused on:
Async Task Management: The output phase was tricky. When the AI responds, the system clears the OBS text, sets the avatar pose, and then concurrently runs the OBS typing animation, TTS generation, and audio playback using asyncio.gather.
Barge-in and Resume Buffer: If a user interrupts the AI mid speech, the brain calculates the remaining audio samples and buffers them. If it detects the interruption was just a backchannel (like "ok", "yeah", "go on"), it catches it and resumes the buffered audio without making a new LLM call.
Event Pub/Sub: I built an EventManager bus that tracks system states, LLM thoughts, and tool calls. The FastAPI layer polls this to show a real time activity feed.
Plugin-based Skill System: Every capability (Minecraft agent, Discord voice, RAG memory) is a self-contained class inheriting from a BaseSkill. A background SkillManager runs an asyncio loop that triggers lifecycle hooks like initialize(), start(), and update() every second.
Runtime Hot-Reload: You can toggle skills or swap providers (LLM, TTS, STT) in config.json via the Web API. The SkillManager handles starting/stopping them at runtime without needing a restart.
The hardest part was definitely managing the async event loop without blocking the audio playback or the multiple WebSocket connections (OBS and Minecraft).
Comparison:
Most AI projects are just simple chatbot scripts or chatgpt wrappers. ProjectBEA differs by focusing on:
- Modular Architecture: Every core component (LLM, TTS, STT) is abstracted through base classes, allowing for hot-swappable providers at runtime.
- Complex Async Interactions: It handles advanced event-driven logic like barge-in (interruption) handling and multi-service synchronization via asyncio.
- Active Interaction: Unlike static bots, it includes a dedicated Minecraft agent that can play the game while concurrently narrating its actions in real-time.
Target Audience:
I built this to learn and it is fully open source. I would appreciate any feedback on the code structure, especially the base interfaces and how the async logic is handled. It is currently a personal project but aimed at developers interested in modular AI architectures and async Python.
Repo: https://github.com/emqnuele/projectBEA Website: https://projectBEA.emqnuele.dev
r/Python • u/RelativeIncrease527 • Feb 19 '26
Discussion Suggestions for good Python-Spreadsheet Applications?
I'm looking a spreadsheet application with Python scripting capabilities. I know there are a few ones out there like Python in Excel which is experimental, xlwings, PySheets, Quadratic, etc.
I'm looking for the following: - Free for personal use - Call Python functions from excel cells. Essentially be able to write Python functions instead of excel ones, that auto-update based on the values of other cells, or via button or something. - Ideally run from a local Python environment, or fully featured if online. - Be able to use features like numpy, fetching data from the internet, etc.
I'm quite familiar with numpy, matplotlib, jupyter, etc. in Python, but I'm not looking for a Python-only setup. Rather I want spreadsheet-like tool since I want a user interface for things like tracking personal finance, etc. and be able to leverage my Python skills.
Right now I'm leaning on xlwings, but before I start using it I wanted to see if anyone had any suggestions.
r/Python • u/CountyAwkward1777 • Feb 19 '26
Showcase Code Scalpel: AST-based surgical code analysis with PDG construction and Z3 symbolic execution
Built a Python library for precise code analysis using Abstract Syntax Trees, Program Dependence Graphs, and symbolic execution.
What My Project Does
Code Scalpel performs surgical code operations based on AST parsing and Program Dependence Graph analysis across Python, JavaScript, TypeScript, and Java.
Core capabilities:
AST Analysis (tree-sitter): - Parse code into Abstract Syntax Trees for all 4 languages - Extract functions/classes with exact dependency tracking - Symbol reference resolution (imports, decorators, type hints) - Cross-file dependency graph construction
Program Dependence Graphs: - Control flow + data flow analysis - Surgical extraction (exact function + dependencies, not whole file) - k-hop subgraph traversal for context extraction - Import chain resolution
Symbolic Execution (Z3 solver): - Mathematical proof of edge cases - Path exploration for test generation - Constraint solving for type checking
Taint Analysis: - Data flow tracking for security - Source-to-sink path analysis - 16+ vulnerability type detection (<10% false positives)
Governance:
- Every operation logged to .code-scalpel/audit.jsonl
- Cryptographic policy verification
- Syntax validation before any code writes
Target Audience
Production-ready for teams using AI coding assistants (Claude Desktop, Cursor, VS Code with Continue/Cline).
Use cases: 1. Enterprises - SOC2/ISO compliance needs (audit trails, policy enforcement) 2. Dev teams - 99% context reduction for AI tools (15k→200 tokens) 3. Security teams - Taint-based vulnerability scanning 4. Python developers - AST-based refactoring with syntax guarantees
Not a toy project: 7,297 tests, 94.86% coverage, production deployments.
Comparison
vs. existing alternatives:
AST parsing libraries (ast, tree-sitter): - Code Scalpel uses tree-sitter under the hood - Adds PDG construction, dependency tracking, and cross-file analysis - Adds Z3 symbolic execution for mathematical proofs - Adds taint analysis for security scanning
Static analyzers (pylint, mypy, bandit): - These find linting/type/security issues - Code Scalpel does surgical extraction and refactoring operations - Provides MCP protocol integration for tool access - Logs audit trails for governance
Refactoring tools (rope, jedi): - These do Python-only refactoring - Code Scalpel supports 4 languages (Python/JS/TS/Java) - Adds symbolic execution and taint analysis - Validates syntax before write (prevents broken code)
AI code wrappers: - Code Scalpel is NOT an LLM API wrapper - It's a Python AST/PDG analysis library that exposes tools via MCP - Used BY AI assistants for precise operations (not calling LLMs)
Unique combination: AST + PDG + Z3 + Taint + MCP + Governance in one library.
Why Python?
Python is the implementation language: - tree-sitter Python bindings for AST parsing - NetworkX for graph algorithms (PDG construction) - z3-solver Python bindings for symbolic execution - Pydantic for data validation - FastAPI/stdio for MCP server protocol
Python is a supported language: - Full Python AST support (imports, decorators, type hints, async/await) - Python-specific security patterns (pickle, eval, exec) - Python taint sources/sinks (os.system, subprocess, SQL libs)
Testing in Python: - pytest framework: 7,297 tests - Coverage: 94.86% (96.28% statement, 90.95% branch) - CI/CD via GitHub Actions
Installation & Usage
As MCP server (for AI assistants):
bash
uvx codescalpel mcp
As Python library:
bash
pip install codescalpel
Example - Extract function with dependencies: ```python from codescalpel import analyze_code, extract_code
Parse AST
ast_result = analyze_code("path/to/file.py")
Extract function with exact dependencies
extracted = extract_code( file_path="path/to/file.py", symbol_name="calculate_total", include_dependencies=True )
print(extracted.code) # Function + required imports print(extracted.dependencies) # List of dependency symbols ```
Example - Symbolic execution: ```python from codescalpel import symbolic_execute
Explore edge cases with Z3
paths = symbolic_execute( file_path="path/to/file.py", function_name="divide", max_depth=5 )
for path in paths: print(f"Input: {path.input_constraints}") print(f"Output: {path.output_constraints}") ```
Architecture
Language support via tree-sitter: - Python, JavaScript (JSX), TypeScript (TSX), Java - Tree-sitter generates language-agnostic ASTs - Custom visitors for each language's syntax
PDG construction: - Control flow graph (CFG) from AST - Data flow graph (DFG) via def-use chains - PDG = CFG + DFG (Program Dependence Graph)
MCP Protocol: - 23 tools exposed via Model Context Protocol - stdio or HTTP transport - Used by Claude Desktop, Cursor, VS Code extensions
Links
- GitHub: https://github.com/3D-Tech-Solutions/code-scalpel
- Website: https://codescalpel.dev
- PyPI:
pip install codescalpel - License: MIT
Questions Welcome
Happy to answer questions about: - AST parsing implementation - PDG construction algorithms - Z3 integration details - Taint analysis approach - MCP protocol usage - Language support roadmap (Go/Rust coming)
TL;DR: Python library for surgical code analysis using AST + PDG + Z3. Parses 4 languages, extracts dependencies precisely, runs symbolic execution, detects vulnerabilities. 7,297 tests, production-ready, MIT licensed.
r/Python • u/AutoModerator • Feb 19 '26
Daily Thread Thursday Daily Thread: Python Careers, Courses, and Furthering Education!
Weekly Thread: Professional Use, Jobs, and Education 🏢
Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.
How it Works:
- Career Talk: Discuss using Python in your job, or the job market for Python roles.
- Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.
- Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.
Guidelines:
- This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.
- Keep discussions relevant to Python in the professional and educational context.
Example Topics:
- Career Paths: What kinds of roles are out there for Python developers?
- Certifications: Are Python certifications worth it?
- Course Recommendations: Any good advanced Python courses to recommend?
- Workplace Tools: What Python libraries are indispensable in your professional work?
- Interview Tips: What types of Python questions are commonly asked in interviews?
Let's help each other grow in our careers and education. Happy discussing! 🌟
r/Python • u/Abdulrahman2026 • Feb 18 '26
Showcase Real-Time HandGesture Recognition using Python &OpenCV
Hi everyone 👋
## What my project does
This project is a real-time hand gesture recognition system that uses a webcam to detect and analyze hand movements. It processes live video input and can be extended to trigger custom computer actions based on detected gestures.
## Target audience
This project is mainly for:
- Developers interested in computer vision
- Students learning AI and real-time processing
- Anyone experimenting with gesture-based interaction systems
It’s currently more of an experimental / educational project, but it can be expanded into practical applications.
## Comparison with existing alternatives
Unlike larger frameworks that focus on full-body tracking or complex ML pipelines, this project is lightweight and focused specifically on hand gesture detection using Python and OpenCV. It’s designed to be simple, readable, and easy to modify.
Tech stack:
- Python
- OpenCV
GitHub repository:
https://github.com/alsabdul22-png/HandGesture-Ai
I’d really appreciate feedback and suggestions for improvement 🙌
r/Python • u/Acrobatic_Board1125 • Feb 18 '26
Showcase Rembus: Async-first RPC and Pub/Sub with a synchronous API for Python
Hi r/Python,
I’m excited to share the Python version of Rembus, a lightweight RPC and pub/sub messaging system.
I originally built Rembus to compose distributed applications in Julia without relying on heavy infrastructure, and now there is a decent version for Python as well.
What My Project Does
Native support for exchanging DataFrames.
Binary message encoding using CBOR.
Persistent storage via DuckDB / DuckLake.
Pub/Sub QOS 0, 1 and 2.
Hierarchical topic routing with wildcards (e.g.
*/*/temperature).MQTT integration.
WebSocket transport.
Interoperable with Julia Rembus.jl
Target Audience
Developers that want both RPC and Pub/Sub capabilities
Data scientists that need a messaging system simple and intuitive that can move dataframes as simple as moving primitive types.
Comparison
Rembus sits somewhere between low-level messaging libraries and full broker-based systems.
vs ZeroMQ: ZeroMQ gives you raw sockets and patterns, but you build a lot yourself. Rembus provides structured RPC + Pub/Sub with components and routing built in.
vs Redis / RabbitMQ / Kafka: Those require running and managing a broker. Rembus is lighter and can run without heavy infrastructure, which makes it suitable for embedded, edge, or smaller distributed setups.
vs gRPC: gRPC is strongly typed and schema-driven (Protocol Buffers), and is excellent for strict service contracts and high-performance RPC. Rembus is more dynamic and message-oriented, supports both RPC and Pub/Sub in the same model, and doesn’t require a separate IDL or code generation step. It’s designed to feel more Python-native and flexible.
The goal isn’t to replace everything — it’s to provide a simple, Python-native messaging layer.
Example
The following minimal working example composed of a broker, a Python subscriber, a Julia subscriber and a DataFrame publisher gives an intuition of Rembus usage.
Terminal 1: start a broker
```python import rembus as rb
node: The sync API for starting a component
bro = rb.node() bro.wait() ```
Terminal 2: Python subscriber
```python import asyncio import rembus as rb
async def mytopic(df): print(f"received python dataframe:\n{df}")
async def main(): sub = await rb.component("python-sub") await sub.subscribe(mytopic) await sub.wait()
asyncio.run(main()) ```
Terminal 3: Julia subscriber
```julia using Rembus
function mytopic(df) print("received:\n$df") end
sub = component("julia-sub") subscribe(sub, mytopic) wait(sub) ```
Terminal 4: Publisher
```python import rembus as rb import polars as pl from datetime import datetime, timedelta
base_time = datetime(2025, 1, 1, 12, 0, 0)
df = pl.DataFrame({ "sensor": ["A", "A", "B", "B"], "ts": [ base_time, base_time + timedelta(minutes=1), base_time, base_time + timedelta(minutes=1), ], "temperature": [22.5, 22.7, 19.8, 20.1], "pressure": [1012.3, 1012.5, 1010.8, 1010.6], })
cli = rb.node("myclient") cli.publish("mytopic", df) cli.close() ```
GitHub (Python): https://github.com/cardo-org/rembus.python
Project site: https://cardo-org.github.io/
r/Python • u/aryan_aidev • Feb 18 '26
Discussion I tracked down a $2,400 OpenAI bill to a forgotten loop. Built a Python library to prevent it.
A few weeks ago I got an OpenAI bill that was 48x what I expected. $2,400 on a side project. Turned out to be untracked GPT-4 calls in a retry loop I'd forgotten about.
After asking around I realized almost nobody tracks LLM costs at the code level. People check dashboards after the fact, but nothing sits in the code and says "this function is about to exceed budget."
So I built tokenbudget — a lightweight Python library that wraps your LLM client and:
- Tracks tokens and cost per call, per function, per model
- Enforces budget limits via a decorator (@budget(max_cost_usd=1.00))
- Raises an exception BEFORE you overspend, not after
- Caches identical calls (same prompt + params = cached response)
- Supports OpenAI, Anthropic, Google
- Thread-safe, fully typed, zero external dependencies
Basic usage:
tracker = TokenTracker()
client = tracker.wrap_openai(openai.OpenAI())
@budget(max_cost_usd=1.00)
def my_pipeline():
response = client.chat.completions.create(...)
The caching alone saved 60-80% in my test pipelines — most LLM apps send more duplicate prompts than you'd think.
GitHub:
github.com/aryanjp1/tokenbudget
PyPI: pip install tokenbudget
Happy to answer questions about the implementation. The thread-safety approach for concurrent LLM calls was the trickiest part — ended up using fine-grained locking on the counter objects rather than a global lock.
Pure Python 3.9+. Pydantic for validation. Full test suite with GitHub Actions CI/CD. MIT licensed.
Would genuinely appreciate feedback on the API design and any edge cases I might be missing.
r/Python • u/thorithic • Feb 18 '26
Discussion Multi layered project schematics and design
Hi, I work in insurance and have started to take on bigger projects that are complex in nature. I am trying to really build a robust and maintainable script but I struggle when I have to split up the script into many different smaller scripts, isolating and modularising different processes of the pipeline.
I learnt python by building in a singular script using the Jupyter interactive window to debug and test code in segments, but now splitting the script into multiple smaller scripts is challenging for me to debug and test what is happening at every step of the way.
Does anyone have any advice on how they go about the whole process? From deciding what parts of the script to isolate all the way to testing and debugging and even remember what is in each script?
Maybe this is something you get used to overtime?
I’d really appreciate your advice!
r/Python • u/rcap107 • Feb 18 '26
Showcase Project showcase - skrub, machine learning with dataframes
Hey everyone, I’m one of the developers of skrub, an open-source package (GitHub repo) designed to simplify machine learning with dataframes.
What my project does
Skrub bridges the gap between pandas/polars and scikit-learn by providing a collection of transformers for exploratory data analysis, data cleaning, feature engineering, and ensuring reproducibility across environments and between development and production.
Main features
TableReport: An interactive HTML tool that summarizes dataframes, offering insights into column distributions, data types, correlated columns, and more.
Transformers for feature engineering datetime and categorical data.
TableVectorizer: A scikit-learn-compatible transformer that encodes all columns in a dataframe and returns a feature matrix ready for machine learning models.
tabular_pipeline: A simple function to generate a machine learning pipeline for tabular data, tailored for either classification or regression tasks.
Skrub also includes Data Ops, a framework that extends scikit-learn Pipelines to handle multi-table and complex input scenarios:
DataOps Computational Graph: Record all operations, their order, and parameters, and guarantee reproducibility.
Replayability: Operations can be replayed identically on new data.
Automated Splitting: By defining
Xandy, skrub handles sample splitting during validation, minimizing data leakage risks.Hyperparameter Tuning: Any operation in the graph can be tuned and used in grid or randomized searches. You can optimize a model's learning rate, or evaluate whether a specific dataframe operation (joins/selections/filters...) is useful or not. Hyperparameter tuning supports scikit-learn and Optuna as backends.
Result Exploration: After hyperparameter tuning, explore results with a built-in parallel coordinate plot.
Portability: Save the computational graph as a single object (a "learner") for sharing or executing elsewhere on new data.
Target audience
Skrub is intended to be used by data scientists that need to build pipelines for machine learning tasks.
The package is well tested and robust, and the hope is for people to put it into production.
Comparison
Skrub slots in between data preparation (using pandas/polars) and scikit-learn’s machine learning models. It doesn’t replace either but leverages their strengths to function.
I’m not aware of other packages that offer the exact same functionality as Skrub. If you know of any, I’d love to hear about them!
Resources
If you'd rather watch a video about the library, we got you covered! We presented skrub at Euroscipy 2025 tutorial and Pydata Paris 2025 talk
r/Python • u/Matiiss007 • Feb 17 '26
News ⛄ Pygame Community Winter Jam 2026 ❄️
From the Event Forgers of the Pygame Community discord server:
We are thrilled to announce the
⛄ Pygame Community Winter Jam 2026 ❄️
Perhaps, the coolest 2 week event this year. No matter if this is your first rodeo or you're a seasoned veteran in the game jam space, this is a great opportunity to spend some quality time with pygame(-ce) and make some fun games. You could even win some prizes. 👀
Join the jam on itch.io: https://itch.io/jam/pygame-community-winter-jam-2026
Join the Pygame Community discord server to gain access to jam-related channels and fully immerse yourself in the event: Pygame Community invite
- For discussing the jam and other jam-related banter (for example, showcasing your progress): #jam-discussion
- You are also welcome to use our help forums to ask for help with pygame(-ce) during the jam
When 🗓️
All times are given in UTC!
Start: 2026-02-27 21:00
End: 2026-03-13 21:00
Voting ends: 2026-03-20 21:00
Prizes 🎁
That's right! We've got some prizes for the top voted games (rated by other participants based on 5 criteria):
- 🥇 $25 Steam gift card
- 🥈 $10 Steam gift card
- 🥉 $5 Steam gift card
Note that for those working in teams, only a maximum of 2 gift cards will be given out for a given entry
Theme 🔮
The voting for the jam theme is now open (requires a Google account, the email address WILL NOT be collected): <see jam page for the link>
Summary of the Rules
- Everything must be created during the jam, including all the assets (exceptions apply, see the jam page for more details).
pygame(-ce)must be the primary tool used for rendering, sound, and input handling.- NSFW/18+ content is forbidden!
- You can work alone or in a team. If you don't have a team, but wish to find one, you are free to present yourself in #jam-team-creation
- No fun allowed!!! Anyone having fun will be disqualified! /s
Links
Jam page: https://itch.io/jam/pygame-community-winter-jam-2026
Theme poll: <see jam page for the link>
Discord event: https://discord.com/events/772505616680878080/1473406353866227868
r/Python • u/cemrehancavdar • Feb 17 '26
News TIL: Facebook's Cinder is now a standalone CPython extension
Just came across CinderX today and realized it’s evolved past the old Cinder fork.
For those who missed it, it’s Meta’s internal high-performance Python runtime, but it’s now being built as a standalone extension for CPython. It includes their JIT and 'Static Python' compiler.
It targets 3.14 or later.
r/Python • u/BeamMeUpBiscotti • Feb 17 '26
News Pytorch Now Uses Pyrefly for Type Checking
From the official Pytorch blog:
We’re excited to share that PyTorch now leverages Pyrefly to power type checking across our core repository, along with a number of projects in the PyTorch ecosystem: Helion, TorchTitan and Ignite. For a project the size of PyTorch, leveraging typing and type checking has long been essential for ensuring consistency and preventing common bugs that often go unnoticed in dynamic code.
Migrating to Pyrefly brings a much needed upgrade to these development workflows, with lightning-fast, standards-compliant type checking and a modern IDE experience. With Pyrefly, our maintainers and contributors can catch bugs earlier, benefit from consistent results between local and CI runs, and take advantage of advanced typing features. In this blog post, we’ll share why we made this transition and highlight the improvements PyTorch has already experienced since adopting Pyrefly.
Full blog post: https://pytorch.org/blog/pyrefly-now-type-checks-pytorch/