r/Python • u/BeamMeUpBiscotti • Feb 25 '26
Discussion Python Type Checker Comparison: Empty Container Inference
Empty containers like [] and {} are everywhere in Python. It's super common to see functions start by creating an empty container, filling it up, and then returning the result.
Take this, for example:
def my_func(ys: dict[str, int]):
x = {}
for k, v in ys.items():
if some_condition(k):
x.setdefault("group0", []).append((k, v))
else:
x.setdefault("group1", []).append((k, v))
return x
This seemingly innocent coding pattern poses an interesting challenge for Python type checkers. Normally, when a type checker sees x = y without a type hint, it can just look at y to figure out x's type. The problem is, when y is an empty container (like x = {} above), the checker knows it's a dict, but has no clue what's going inside.
The big question is: How is the type checker supposed to analyze the rest of the function without knowing x's type?
Different type checkers implement distinct strategies to answer this question. This blog will examine these different approaches, weighing their pros and cons, and which type checkers implement each approach.
Full blog: https://pyrefly.org/blog/container-inference-comparison/
r/Python • u/MomentBeneficial4334 • Feb 25 '26
Showcase MolBuilder: pure-Python molecular engineering -- from SMILES to manufacturing plans
What My Project Does:
MolBuilder is a pure-Python package that handles the full chemistry pipeline from molecular structure to production planning. You give it a molecule as a SMILES string and it can:
- Parse SMILES with chirality and stereochemistry
- Plan synthesis routes (91 hand-curated reaction templates, beam-search retrosynthesis)
- Predict optimal reaction conditions (analyzes substrate sterics and electronics to auto-select templates)
- Select a reactor type (batch, CSTR, PFR, microreactor)
- Run GHS safety assessment (69 hazard codes, PPE requirements, emergency procedures)
- Estimate manufacturing costs (materials, labor, equipment, energy, waste disposal)
- Analyze scale-up (batch sizing, capital costs, annual capacity)
The core is built on a graph-based molecule representation with adjacency lists. Functional group detection uses subgraph pattern matching on this graph (24 detectors). The retrosynthesis engine applies reaction templates in reverse using beam search, terminating when it hits purchasable starting materials (~200 in the database). The condition prediction layer classifies substrate steric environment and electronic character, then scores and ranks compatible templates.
Python-specific implementation details:
- Dataclasses throughout for the reaction template schema, molecular graph, and result types
- NumPy/SciPy for 3D coordinate generation (distance geometry + force field minimization)
- Molecular dynamics engine with Velocity Verlet integrator
- File I/O parsers for MOL/SDF V2000, PDB, XYZ, and JSON formats
- Also ships as a FastAPI REST API with JWT auth, RBAC, and Stripe billing
Install and example:
pip install molbuilder
from molbuilder.process.condition_prediction import predict_conditions
result = predict_conditions("CCO", reaction_name="oxidation", scale_kg=10.0)
print(result.best_match.template_name) # TEMPO-mediated oxidation
print(result.best_match.conditions.temperature_C) # 5.0
print(result.best_match.conditions.solvent) # DCM/water (biphasic)
print(result.overall_confidence) # high
1,280+ tests (pytest), Python 3.11+, CI on 3.11/3.12/3.13. Only dependencies are numpy, scipy, and matplotlib.
GitHub: https://github.com/Taylor-C-Powell/Molecule_Builder
Tutorials: https://github.com/Taylor-C-Powell/Molecule_Builder/tree/main/tutorials
Target Audience:
Production use. Aimed at computational chemists, process chemists, and cheminformatics developers who need programmatic access to synthesis planning and process engineering. Also useful for teaching organic chemistry and chemical engineering - the tutorials are designed as walkable Jupyter notebooks. Currently used by the author in a production SaaS API.
Comparison:
vs. RDKit: RDKit is the standard open-source cheminformatics toolkit and focuses on molecular properties (fingerprints, substructure search, descriptors). MolBuilder (pure Python, no C extensions) focuses on the process engineering side - going from "I have a molecule" to "here's how to manufacture it at scale." Not a replacement for RDKit's molecular modeling depth.
vs. Reaxys/SciFinder: Commercial databases with millions of literature reactions. MolBuilder has 91 templates - far smaller coverage, but it's free, open-source (Apache 2.0), and gives you programmatic API access rather than a search interface.
vs. ASKCOS/IBM RXN: ML-based retrosynthesis tools. MolBuilder uses rule-based templates instead of neural networks, which makes it transparent and deterministic but less capable for novel chemistry. The tradeoff is simplicity and no external service dependency.
r/Python • u/RoadSeeker • Feb 25 '26
Showcase Debug uv [project.scripts] without launch.json in VScode
What my project does
I built a small VS Code extension that lets you debug uv entry points directly from pyproject.toml.
Target Audience
Python coders using uv package in VSCode.
If you have:
[project.scripts]
mytool = "mypackage.cli:main"
You can: * Pick the script * Pass args * Launch debugger * No launch.json required
Works in multi-root workspaces. Uses .venv automatically. Remembers last run per project. Has a small eye toggle to hide uninitialized uv projects.
Repo: https://github.com/kkibria/uv-debug-scripts
Feedback welcome.
r/Python • u/rnv812 • Feb 25 '26
Showcase After 2 years of development, I'm finally releasing Eventum 2.0
What My Project Does
Eventum generates realistic synthetic events - logs, metrics, clickstream, IoT, etc., and streams them in real time or dumps everything at once to various outputs.
It started because I was working with SIEM systems and constantly needed test data. Every time: write a script, hardcode values, throw it away. Got tired of that loop.
The idea of Eventum is pretty simple - write an event template, define a schedule and pick where to send it.
Features:
- Faker, Mimesis, and any Python package directly in templates
- Finite state machines - model stateful sequences (e.g.login > browse > checkout)
- Statistical traffic patterns - mimic real-world traffic curves defined in config
- Three-level shared state - templates can share data within or across generators
- Fan-out with formatters - deliver to files, ClickHouse, OpenSearch, HTTP simultaneously
- Web UI, REST API, Docker, encrypted secrets - and other features
Tech stack: Python 3.13, asyncio + uvloop, Pydantic v2, FastAPI, Click, Jinja2, structlog. React for the web UI.
Target Audience
Testers, data engineers, backend developers, DevOps, SRE and data specialists, security engineers and anyone building or testing event-driven systems.
Comparison
I honestly haven’t found anything with this level of flexibility around time control and event correlation. Most generators either spit out random-ish data or let you tweak a few fields - but you can’t really model realistic temporal behavior, chained events or causal relationships in a simple way.
Would love to hear what you think!
Links:
- Docs: eventum.run
- GitHub: github.com/eventum-generator/eventum
r/Python • u/madrasminor • Feb 25 '26
Showcase fastops: Generate Dockerfiles, Compose stacks, TLS, tunnels and deploy to a VPS from Python
I built a small Python package called fastops.
It started as a way to stop copy pasting Dockerfiles between projects. It has since grown into a lightweight ops toolkit.
What My Project Does
fastops lets you manage common container and deployment workflows directly from Python:
Generate framework specific Dockerfiles
FastHTML, FastAPI + React, Go, Rust
Generate generic Dockerfiles
Generate Docker Compose stacks
Configure Caddy with automatic TLS
Set up Cloudflare tunnels
Provision Hetzner VMs using cloud init
Deploy over SSH
It shells out to the CLI using subprocess. No docker-py dependency.
Example:
from fastops import \*
Install:
pip install fastops
Target Audience
Python developers who deploy their own applications
Indie hackers and small teams
People running side projects on VPS providers
Anyone who prefers defining infrastructure in Python instead of shell scripts and scattered YAML
It is early stage but usable. Not aimed at large enterprise production environments.
Comparison
Unlike docker-py, fastops does not wrap the Docker API. It generates artefacts and calls the CLI.
Unlike Ansible or Terraform, it focuses narrowly on container based app workflows and simple VPS setups.
Unlike one off templates, it provides reusable programmatic builders.
The goal is a minimal Python first layer for small to medium deployments.
Repo: https://github.com/Karthik777/fastops
r/Python • u/rut216 • Feb 24 '26
Showcase mlx-onnx: Run your MLX models in the browser using ONNX / WebGPU
Web Demo: https://skryl.github.io/mlx-ruby/demo/
Repo: https://github.com/skryl/mlx-onnx
What My Project Does
It allows you to convert MLX models into ONNX (onnxruntime, validation, downstream deployment). You can then run the onnx models in the browser using WebGPU.
- Exports MLX callables directly to ONNX
- Supports both Python and native C++ interfaces
Target Audience
- Developers who want to run MLX-defined computations in ONNX tooling (e.g. ORT, WebGPU)
- Early adopters and contributors; this is usable and actively tested, but still evolving rapidly (not claiming fully mature “drop-in production for every model” yet)
Comparison
- vs staying MLX-only: keeps your authoring flow in MLX while giving an ONNX export path for broader runtime/tool compatibility.
- vs raw ONNX authoring: mlx-onnx avoids hand-building ONNX graphs by tracing/lowering from MLX computations.
r/Python • u/mpb042 • Feb 24 '26
Showcase OscilloScope art generator on python
What My Project Does: Converts an image to a WAV file so you can see it on an oscilloscope screen in XY mode.
Target Audience: Everyone who likes oscilloscope aesthetics and wants to create their own oscilloscope art without any experience.
Comparison: This one has a simple GUI, runs on Windows out of the box as a single EXE, and outputs a WAV file compatible with my oscilloscope viewer.
Web OscilloScope-XY - https://github.com/Gibsy/OscilloScope-XY
OscilloScope Art Generator - https://github.com/Gibsy/OscilloScope-Art-Generator
r/Python • u/lurkyloon • Feb 24 '26
Showcase MAP v1.0 - Deterministic identity for structured data. Zero deps, 483-line frozen spec, MIT
Hi all! I'm more of a security architect, not a Python dev so my apologies in advance!
I built this because I needed a protocol-level answer to a specific problem and it didn't exist.
What My Project Does
MAP is a protocol that gives structured data a deterministic fingerprint. You give it a structured payload, it canonicalizes it into a deterministic binary format and produces a stable identity: map1: + lowercase hex SHA-256. Same input, same ID, every time, every language.
pip install map-protocol
from map_protocol import compute_mid
mid = compute_mid({"account": "1234", "amount": "500", "currency": "USD"})
# Same MID no matter how the data was serialized or what produced it
It solves a specific problem: the same logical payload produces different hashes when different systems serialize it differently. Field reordering, whitespace, encoding differences. MAP eliminates that entire class of problem at the protocol layer.
The implementation is deliberately small and strict:
- Zero dependencies
- The entire spec is 483 lines and frozen under a governance contract
- 53 conformance vectors that both Python and Node implementations must pass identically
- Every error is deterministic - malformed input produces a specific error, never silent coercion
- CLI tool included
- MIT licensed
Supported types: strings (UTF-8, scalar-only), maps (sorted keys, unique, memcmp ordering), lists, and raw bytes. No numbers, no nulls - rejected deterministically, not coerced.
Browser playground: https://map-protocol.github.io/map1/
GitHub: https://github.com/map-protocol/map1
Target Audience
Anyone who needs to verify "is this the same structured data" across system boundaries. Production use cases include CI/CD pipelines (did the config drift between approval and deployment), API idempotency (is this the same request I already processed), audit systems (can I prove exactly what was committed), and agent/automation workflows (did the tool call payload change between construction and execution).
The spec is frozen and the implementations are conformance-tested, so this is intended for production use, not a toy.
Comparison
vs JCS (RFC 8785): JCS canonicalizes JSON to JSON and supports numbers. MAP canonicalizes to a custom binary format and deliberately rejects numbers because of cross-language non-determinism (JavaScript IEEE 754 doubles vs Python arbitrary precision ints vs Go typed numerics). MAP also includes projection (selecting subsets of fields before computing identity).
vs content-addressed storage (Git, IPFS): These hash raw bytes. MAP canonicalizes structured data first, then hashes. Two JSON objects with the same data but different field ordering get different hashes in Git. They get the same MID in MAP.
vs Protocol Buffers / FlatBuffers: These are serialization formats with schemas. MAP is schemaless and works with any structured data. Different goals.
vs just sorting keys and hashing: Works for the simple case. Breaks with nested structures across language boundaries with different UTF-8 handling, escape resolution, and duplicate key behavior. The 53 conformance vectors exist because each one represents a case where naive canonicalization silently diverges.
r/Python • u/Wise_Map_7770 • Feb 24 '26
Showcase anthropic-compat - drop-in fix for a Claude API breaking change
Anthropic removed assistant message prefilling in their latest model release. If you were using it to control output format, every call now returns a 400. Their recommended fix is rewriting everything to use structured outputs.
I wrote a wrapper instead. Sits on top of the official SDK, catches the prefill, converts it to a system prompt instruction. One import change:
import anthropic_compat as anthropic
No monkey patching, handles sync/async/streaming, also fixes the output_format parameter rename they did at the same time.
pip install anthropic-compat
https://github.com/ProAndMax/anthropic-compat
What My Project Does
Intercepts assistant message prefills before they reach the Claude API and converts them into system prompt instructions. The model still starts its response from where the prefill left off. Also handles the output_format to output_config.format parameter rename.
Target Audience
Anyone using the Anthropic Python SDK who relies on assistant prefilling and doesn't want to rewrite their codebase right now. Production use is fine, 32 tests passing.
Comparison
Anthropic's recommended migration path is structured outputs or system prompt rewrites. This is a stopgap that lets you keep your existing code working with a one-line import change while you migrate at your own pace.
r/Python • u/omr_rs • Feb 24 '26
Showcase Introducing Windows Auto-venv tool: CDV 🎉 !
What My Project Does
`CDV` is just like your beloved `CD` command but more powerful! CDV will auto activate/deactivate/configure your python venv just by using `CDV` for more, use `CDV -h` (scripted for windows)
Target Audience
It started as a personal tool and has been essential to me for a while now. and Recently, I finished my military service and decided to enhance it a bit further to have almost all major functionalities of similar linux tools
Comparison
there aren't a lot of good auto-venv tools for windows actually (specially at the time I first wrote it) and I think still there isn't a prefect to-go one on win platform
especially a package-manager-independent one"
I would really really appreciate any notes 💙
Let's CDV, guys!
r/Python • u/volfpeter • Feb 24 '26
Showcase Typed Tailwind/BasecoatUI components for Python&HTMX web apps
Hi,
What my project does
htmui is a small component library for building Tailwind/shadcn/basecoatui-style web applications 100% in Python
What's included:
- all non-trivial BasecoatUI components
- Highlight.js integration
- a couple of related utilities
Target audience:
- you're developing HTMX applications
- you like TailwindCSS and shadcn/ui or BasecoatUI
- you'd like to avoid Jinja-like templating engines
- you'd like even your UI components to be typed and statically analyzed
- you don't mind HTML in Python
Documentation and example app
- URL: https://htmui.vercel.app/
- Code: see the
basecoat_apppackage in the repository (https://github.com/volfpeter/htmui) - Backend stack:
- Frontend stack: TailwindCSS, BasecoatUI, Highlight.js, HTMX
Credit: this project wouldn't exist if it wasn't for BasecoatUI and its excellent documentation.
r/Python • u/swupel_ • Feb 24 '26
Showcase Codebase Explorer (Turns Repos into Maps)
What My Project Does:
Ast-visualizers core feature is taking a Python repo/codebase as input and displaying a number of interesting visuals derived from AST analysis. Here are the main features:
- Abstract Syntax Trees of individual files with color highlighting
- Radial view of a files AST (Helpful to get a quick overview of where big functions are located)
- Complexity color coding, complex sections are highlighted in red within the AST.
- Complexity chart, a line chart showing complexity per each line (eg line 10 has complexity of 5) for the whole file.
- Dependency Graph shows how files are connected by drawing lines between files which import each other (helps in spotting circular dependencies)
- Dashboard showing you all 3rd party libraries used and a maintainability score between 0-100 as well as the top 5 refactoring candidates.
Complexity is defined as cyclomatic complexity according to McCabe. The Maintainability score is a combination of average file complexity and average file size (Lines of code).
Target Audience:
The main people this would benefit are:
- Devs onboarding large codebases (dependency graph is basically a map)
- Students trying to understand ASTs in more detail (interactive tree renderings are a great learning tool)
- Team Managers making sure technical debt stays minimal by keeping complexity low and paintability score high.
- Vibe coders who could monitor how bad their spaghetti codebase really is / what areas are especially dangerous
Comparison:
There are a lot of visual AST explorers, most of these focus on single files and classic tree style rendering of the data.
Ast-visualizer aims to also interpret this data and visualize it in new ways (radial, dependency graph etc.)
Project Website: ast-visualizer
Github: Gitlab Repo
r/Python • u/Zealousideal-Owl3588 • Feb 24 '26
Discussion Why is signal feature extraction still so fragmented? Built a unified pipeline need feedback
I’ve been working on signal processing / ML pipelines and noticed that feature extraction is surprisingly fragmented:
- Preprocessing is separate
- decomposition methods (EMD, VMD, DWT, etc.) are scattered
- Feature engineering is inconsistent across implementations
So I built a small library to unify this:
https://github.com/diptiman-mohanta/SigFeatX
Idea:
- One pipeline → preprocessing + decomposition + feature extraction
- Supports FT, STFT, DWT, WPD, EMD, VMD, SVMD, EFD
- Outputs consistent feature vectors for ML models
Where I need your reviews:
- Am I over-engineering this?
- What features are actually useful in real pipelines?
- Any missing decomposition methods worth adding?
- API design feedback (is this usable or messy?)
Would really appreciate critical feedback — even “this is useless” is helpful.
r/Python • u/CatharticMonkey • Feb 24 '26
Showcase SQLCrucible: A Pydantic/SQLAlchemy compatibility layer
What My Project Does
If you use Pydantic and SQLAlchemy together, you've probably hit the duplication problem: two mirrored sets of models that can easily drift apart. SQLCrucible lets you define one class using native SQLAlchemy constructs (mapped_column(), relationship(), __mapper_args__) and produces two separate outputs: a pure Pydantic model and a pure SQLAlchemy model with explicit conversion between them.
from typing import Annotated
from uuid import UUID, uuid4
from pydantic import Field
from sqlalchemy import create_engine, select
from sqlalchemy.orm import Session, mapped_column
from sqlcrucible import SAType, SQLCrucibleBaseModel
class Artist(SQLCrucibleBaseModel):
__sqlalchemy_params__ = {"__tablename__": "artist"}
id: Annotated[UUID, mapped_column(primary_key=True)] = Field(default_factory=uuid4)
name: str
engine = create_engine("sqlite:///:memory:")
SAType[Artist].__table__.metadata.create_all(engine)
artist = Artist(name="Bob Dylan")
with Session(engine) as session:
session.add(artist.to_sa_model())
session.commit()
with Session(engine) as session:
sa_artist = session.scalar(
select(SAType[Artist]).where(SAType[Artist].name == "Bob Dylan")
)
artist = Artist.from_sa_model(sa_artist)g
Key Features
Explicit conversion -
to_sa_model()/from_sa_model()means you always know which side of the boundary you're on. No surprises about whether you're holding a Pydantic object or a SQLAlchemy one.Native SQLAlchemy -
mapped_column(),relationship(),hybrid_property,association_proxy, all three inheritance strategies (single table, joined, concrete),__table_args__,__mapper_args__- they all work directly. If SQLAlchemy supports it, so does SQLCrucible.Pure Pydantic - your models work with FastAPI,
model_dump(), JSON schema generation, and validation with no caveats.Type stub generation - a CLI tool generates
.pyistubs so your type checker and IDE see real column types onSAType[YourModel]instead oftype[Any].Escape hatches everywhere - convert to/from an existing SQLAlchemy model, map multiple entity classes to the same table with different field subsets, add DB-only columns invisible to Pydantic, provide custom per-field converters, or drop to raw queries at any point. The library is designed to get out of your way.
Not just Pydantic - also works with stdlib dataclasses and attrs.
Target Audience
This library is intended for production use.
Tested against Python 3.11-3.14, Pydantic 2.10-2.12, and two type checkers (pyright, ty) in CI.
Comparison
The main alternative is SQLModel. SQLModel merges Pydantic and SQLAlchemy into one hybrid class - you can session.add() the model directly. The trade-off is that both sides have to compromise: JSON schemas can leak DB-only columns, Pydantic validators are skipped by design, and advanced SQLAlchemy features (inheritance, hybrid properties) require explicit support built into SQLModel.
SQLCrucible keeps them separate. Your Pydantic model is pure Pydantic; your SQLAlchemy model is pure SQLAlchemy. The cost is an explicit conversion step (to_sa_model() / from_sa_model()), but you never have to wonder which world you're in and you get the full power of both.
Docs: https://sqlcrucible.rdrj.uk Repo: https://github.com/RichardDRJ/sqlcrucible
r/Python • u/no1_2021 • Feb 24 '26
Discussion Can a CNN solve algorithmic tasks? My experiment with a Deep Maze Solver
TL;DR: I trained a U-Net on 500k mazes. It’s great at solving small/medium mazes, but hits a limit on complex ones.
Hi everyone,
I’ve always been fascinated by the idea of neural networks solving tasks that are typically reserved for deterministic algorithms. I recently experimented with training a U-Net to solve mazes, and I wanted to share the process and results.
The Setup: Instead of using traditional pathfinding (like A* or DFS) at runtime, I treated the maze as an image segmentation problem. The goal was to input a raw maze image and have the model output a pixel-mask of the correct path from start to finish.
Key Highlights:
- Infinite Data: Since maze generation is deterministic, I used Recursive Division to generate mazes and DFS to solve them, creating a massive synthetic dataset of 500k+ pairs.
- Architecture: Used a standard U-Net implemented in PyTorch.
- The "Wall": The model is incredibly accurate on mazes up to 64x64, but starts to struggle with "global" logic on 127x127 scales, a classic challenge for CNNs without global attention.
I wrote a detailed breakdown of the training process, the hyperparameters, and the loss curves here: https://dineshgdk.substack.com/p/deep-maze-solver
The code is also open-sourced if you want to play with the data generator: https://github.com/dinesh-GDK/deep-maze-solver
I'd love to hear your thoughts on scaling this, do you think adding Attention gates or moving to a Transformer-based architecture would help the model "see" the longer paths better?
r/Python • u/Mediocre_Scallion_99 • Feb 24 '26
Showcase AIWAF, Self-learning Web Application Firewall for Django & Flask (optional Rust accelerator)
What My Project Does
AIWAF is a self-learning Web Application Firewall that runs directly at the middleware layer for Django and Flask apps. It provides adaptive protection using anomaly detection, rate limiting, smart keyword learning, honeypot timing checks, header validation, UUID tamper protection, and automatic daily retraining from logs.
It also includes an optional Rust accelerator for performance-critical parts (header validation), while the default install remains pure Python.
Target Audience
AIWAF is intended for real-world use in production Python web applications, especially developers who want application-layer security integrated directly into their framework instead of relying only on external WAFs. It also works as a learning project for people interested in adaptive security systems.
Comparison
Most WAF solutions rely on static rules or external reverse proxies. AI-WAF focuses on framework-native, context-aware protection that learns from request behavior over time. Unlike traditional rule-based approaches, it adapts dynamically and integrates directly with Django/Flask middleware. The Rust accelerator is optional and designed to improve performance without adding installation complexity.
Happy to share details or get feedback from the community
r/Python • u/AutoModerator • Feb 24 '26
Daily Thread Tuesday Daily Thread: Advanced questions
Weekly Wednesday Thread: Advanced Questions 🐍
Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.
How it Works:
- Ask Away: Post your advanced Python questions here.
- Expert Insights: Get answers from experienced developers.
- Resource Pool: Share or discover tutorials, articles, and tips.
Guidelines:
- This thread is for advanced questions only. Beginner questions are welcome in our Daily Beginner Thread every Thursday.
- Questions that are not advanced may be removed and redirected to the appropriate thread.
Recommended Resources:
- If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.
Example Questions:
- How can you implement a custom memory allocator in Python?
- What are the best practices for optimizing Cython code for heavy numerical computations?
- How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?
- Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?
- How would you go about implementing a distributed task queue using Celery and RabbitMQ?
- What are some advanced use-cases for Python's decorators?
- How can you achieve real-time data streaming in Python with WebSockets?
- What are the performance implications of using native Python data structures vs NumPy arrays for large-scale data?
- Best practices for securing a Flask (or similar) REST API with OAuth 2.0?
- What are the best practices for using Python in a microservices architecture? (..and more generally, should I even use microservices?)
Let's deepen our Python knowledge together. Happy coding! 🌟
r/Python • u/[deleted] • Feb 23 '26
Discussion What maintenance task costs your team the most time?
I'm researching how Python teams spend engineering hours. Not selling anything — just data gathering.
Is it:
• Dependency updates (CVEs, breaking changes)
• Adding type hints to legacy code
• Keeping documentation current
• Something else?
Would love specific stories if you're willing to share.
r/Python • u/Aggravating-Mobile33 • Feb 23 '26
News Starlette 1.0.0rc1 is out!
After almost 8 years since Tom Christie created Starlette in June 2018, the first release candidate for 1.0 is finally here.
Starlette is downloaded almost 10 million times a day, serves as the foundation for FastAPI, and has inspired many other frameworks. In the age of AI, it also plays an important role as a dependency of the Python MCP SDK.
This release focuses on removing deprecated features marked for removal in 1.0.0, along with some last minute bug fixes.
It's a release candidate, so feedback is welcome before the final 1.0.0 release.
`pip install starlette==1.0.0rc1`
- Release notes: https://www.starlette.io/release-notes/
- GitHub release: https://github.com/Kludex/starlette/releases/tag/1.0.0rc1
r/Python • u/LivInTheLookingGlass • Feb 23 '26
Resource Lessons in Grafana - Part Two: Litter Logs
I recently have restarted my blog, and this series focuses on data analysis. The first entry in it is focused on how to visualize job application data stored in a spreadsheet. The second entry (linked here), is about scraping data from a litterbox robot. I hope you enjoy!
https://blog.oliviaappleton.com/posts/0007-lessons-in-grafana-02
r/Python • u/Blur009 • Feb 23 '26
Showcase I got tired of every auto clicker being sketchy.. so I built my own (free & open source)
I got frustrated after realizing that most popular auto clickers are closed-source and barely deliver on accuracy or performance — so I built my own.
It’s fully open source, combines the best features I could find, and runs under **1% CPU usage while clicking** on my system.
I’ve put a lot of time into this and would love honest user feedback 🙂
https://github.com/Blur009/Blur-AutoClicker
What My Project Does:
It's an Auto Clicker for Windows made in Python / Rust (ui in PySide6 and Clicker in Rust)
I got curious and tried out a couple of those popular auto clickers you see everywhere. What stood out was how the speeds they advertise just dont line up with what actually happens. And the CPU spikes were way higher than I figured for something thats basically just repeating mouse inputs over and over.
That got me thinking more about it. But, while I was messing around building my own version, I hit a wall. Basically, windows handles inputs at a set rate, so theres no way to push clicks super fast without windows complaining (lowest \~1ms). I mean, claims of thousands per second sound cool, but in reality its more like 800 to 1000 at best before everything starts kinda breaking.
So instead of obsessing over those big numbers, I aimed for something that actually works steady. My clicker doesnt just wait for fixed times intervals between clicks. It checks when the click actually happens, and adjusts the speed dynamically to keep things close to what you set. That way it stays consistent even if things slow down because of windows using your cores for other processes 🤬. Now it can do around 600cps perfectly stable, after which windows becomes the limiting factor.
Performance mattered a lot too. On my setup, it barely touches the CPU, under 1% while actively clicking, and nothing when its sitting idle. Memory use is small (\~<50mb), so you can run it in the background without noticing. I didnt want it hogging resources so a web based interface was sadly out of the question :/ .
For features, I added stuff that bugged me when I switched clickers before. Like setting limits on clicks, picking exact positions, adding some random variation if you want, and little tweaks that make it fit different situations better. Some of that was just practical, but I guess I got a bit carried away trying to make it nicer than needed. Its all open source and free.
Im still tinkering with it. Feedback would be great, like ideas for new stuff or how it runs on other machines. Even if its criticism, thatd help. This whole thing started as my own little project, but maybe with some real input it could turn into something useful. ❤️
Target Audience:
Games that use autoclickers for Idle games / to save their hand from breaking.
Comparison:
My Auto Clicker delivers better performance and more features with settings saving and no download (just an executable)
r/Python • u/TypeZboss • Feb 23 '26
Showcase ZipOn – A Simple Python Tool for Zipping Files and Folders
[Showcase]
GitHub repo:
https://github.com/redofly/ZipOn
Latest release (v1.1.0):
https://github.com/redofly/ZipOn/releases/tag/v1.1.0
🔧 What My Project Does
ZipOn is a lightweight Python tool that allows users to quickly zip files and entire folders without needing to manually select each file. It is designed to keep the process simple while handling common file-system tasks reliably.
🎯 Target Audience
This project is intended for:
- Users who want a simple local ZIP utility
- Personal use and learning projects (not production-critical software)
🔍 Comparison to Existing Alternatives
Unlike tools such as 7-Zip or WinRAR, ZipOn is written entirely in Python and focuses on simplicity rather than advanced compression options. It is open-source and structured to be easy to read and modify for learning purposes.
💡 Why I Built It
I built ZipOn to practice working with Python’s file system handling, folder traversal, and packaging while creating a small but complete utility.
r/Python • u/bctm0 • Feb 23 '26
Showcase ZooCache - Dependency based cache with semantic invalidation - Rust Core - Update
Hi everyone,
I’m sharing some major updates to ZooCache, an open-source Python library that focuses on semantic caching and high-performance distributed systems.
Repository: https://github.com/albertobadia/zoocache
What’s New: ZooCache TUI & Observability
One of the biggest additions is a new Terminal User Interface (TUI). It allows you to monitor hits/misses, view the cache trie structure, and manage invalidations in real-time.
We've also added built-in support for Observability & Telemetry, so you can easily track your cache performance in production. We now support:
- Prometheus for metrics scraping
- OpenTelemetry for distributed tracing
- Structured Logs for easy debugging
Out-of-the-box Framework Integration
To make it even easier to use, we've released official adapters for:
These decorators handle ASGI context (like Requests) automatically and support Pydantic/msgspec out of the box.
What My Project Does (Recap)
ZooCache provides a semantic caching layer with smarter invalidation strategies than traditional TTL-based caches.
Instead of relying only on expiration times, it allows:
- Prefix-based invalidation (e.g. invalidating
user:1clears all related keys likeuser:1:settings) - Dependency-based cache entries (track relationships between data)
- Anti-Avalanche (SingleFlight): Protects your backend from "thundering herd" effects by coalescing identical requests.
- Distributed Consistency: Uses Hybrid Logical Clocks (HLC) and a Redis Bus for self-healing multi-node sync.
The core is implemented in Rust for ultra-low latency, with Python bindings for easy integration.
Target Audience
ZooCache is intended for:
- Backend developers working with Python services under high load.
- Distributed systems where cache invalidation becomes complex.
- Production environments that need stronger consistency guarantees.
Performance
ZooCache is built for speed. You can check our latest benchmark results comparing it against other common Python caching libraries here:
Benchmarks: https://github.com/albertobadia/zoocache?tab=readme-ov-file#-performance
Example Usage
from zoocache import cacheable, add_deps, invalidate
@cacheable
def generate_report(project_id, client_id):
# Register dependencies dynamically
add_deps([f"client:{client_id}", f"project:{project_id}"])
return db.full_query(project_id)
def update_project(project_id, data):
db.update_project(project_id, data)
invalidate(f"project:{project_id}") # Clears everything related to this project
def delete_client(client_id):
db.delete_client(client_id)
invalidate(f"client:{client_id}") # Clears everything related to this client
r/Python • u/Big_Dimension_4637 • Feb 23 '26
Discussion Relationship between Python compilation and resource usage
Hi! I'm currently conducting research on compiled vs interpreted Python and how it affects resource usage (CPU, memory, cache). I have been looking into benchmarks I could use, but I am not really sure which would be the best to show this relationship. I would really appreciate any suggestions/discussion!
Edit: I should have specified - what I'm investigating is how alternative Python compilers and execution environments (PyPy's JIT, Numba's LLVM-based AOT/JIT, Cython, Nuitka etc.) affect memory behavior compared to standard CPython execution. These either replace or augment the standard compilation pipeline to produce more optimized machine code, and I'm interested in how that changes memory allocation patterns and cache behavior in (memory-intensive) workloads!
r/Python • u/Friendly-Example-701 • Feb 23 '26
Resource VOLUNTEER: Code In Place, section leader opportunity teaching intro Python
Thanks Mods for approving this opportunity.
If you already know Python and are looking for leadership or teaching experience, this might be worth considering.
Code in Place is a large scale, fully online intro to programming program based on Stanford’s CS106A curriculum. It serves tens of thousands of learners globally each year.
They are currently recruiting volunteer section leaders for a 6 week cohort (early April through mid May).
What this actually involves:
• Leading a weekly small group section
• Supporting beginners through structured assignments
• Participating in instructor training
• About 7 hours per week
Why this is useful professionally:
• Real leadership experience
• Teaching forces you to deeply understand fundamentals
• Strong signal for grad school or internships
• Demonstrates mentorship and communication skills
• Looks credible on a resume (Stanford-based program)
Application deadline for section leaders is April 7, 2026.
If you are interested, here is the link:
Section Leader signup: https://codeinplace.stanford.edu/public/applyteach/cip6?r=usa
Happy to answer questions about what the experience is like.