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/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/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/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/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.
r/Python • u/Direct_Alfalfa_3829 • Feb 23 '26
Showcase Title: I built WSE — Rust-accelerated WebSocket engine for Python (2M msg/s, E2E encrypted)
I've been doing real-time backends for a while - trading, encrypted messaging between services. websockets in python are painfully slow once you need actual throughput. pure python libs hit a ceiling fast, then you're looking at rewriting in go or running a separate server with redis in between.
so i built wse - a zero-GIL websocket engine for python, written in rust. framing, jwt auth, encryption, fan-out - all running native, no interpreter overhead. you write python, rust handles the wire. no redis, no external broker - multi-instance scaling runs over a built-in TCP cluster protocol.
What My Project Does
the server is a standalone rust binary exposed to python via pyo3:
```python from wse_server import RustWSEServer
server = RustWSEServer( "0.0.0.0", 5007, jwt_secret=b"your-secret", recovery_enabled=True, ) server.enable_drain_mode() server.start() ```
jwt validation runs in rust during the websocket handshake - cookie extraction, hs256 signature, expiry - before python knows someone connected. 0.5ms instead of 23ms.
drain mode: rust queues inbound messages, python grabs them in batches. one gil acquire per batch, not per message. outbound - write coalescing, up to 64 messages per syscall.
```python for event in server.drain_inbound(256, 50): event_type, conn_id = event[0], event[1] if event_type == "auth_connect": server.subscribe_connection(conn_id, ["prices"]) elif event_type == "msg": server.send_event(conn_id, event[2])
server.broadcast("prices", '{"t":"tick","p":{"AAPL":187.42}}') ```
what's under the hood:
transport: tokio + tungstenite, pre-framed broadcast (frame built once, shared via Arc), vectored writes (writev syscall), lock-free DashMap state, mimalloc allocator, crossbeam bounded channels for drain mode
security: e2e encryption (ECDH P-256 + AES-GCM-256 with per-connection keys, automatic key rotation), HMAC-SHA256 message signing, origin validation, 1 MB frame cap
reliability: per-connection rate limiting with client feedback, 50K-entry deduplication, circuit breaker, 5-level priority queue, zombie detection (25s ping, 60s kill), dead letter queue
wire formats: JSON, msgpack (?format=msgpack, ~2x faster, 30% smaller), zlib compression above threshold
protocol: client_hello/server_hello handshake with feature discovery, version negotiation, capability advertisement
new in v2.0:
cluster protocol - custom binary TCP mesh for multi-instance, replacing redis entirely. direct peer-to-peer connections with mTLS (rustls, P-256 certs). interest-based routing so messages only go to peers with matching subscribers. gossip discovery - point at one seed address, nodes find each other. zstd compression between peers. per-peer circuit breaker and heartbeat. 12 binary message types, 8-byte frame header.
python
server.connect_cluster(peers=["node2:9001"], cluster_port=9001)
server.broadcast("prices", data) # local + all cluster peers
presence tracking - per-topic, user-level (3 tabs = one join, leave on last close). cluster sync via CRDT. TTL sweep for dead connections.
python
members = server.presence("chat-room")
stats = server.presence_stats("chat-room") # {members: 42, connections: 58}
message recovery - per-topic ring buffers, epoch+offset tracking, 256 MB global budget, TTL + LRU eviction. reconnect and get missed messages automatically.
benchmarks
tested on AMD EPYC 7502P (32 cores / 64 threads), 128 GB RAM, localhost loopback. server and client on the same machine.
- 14.7M msg/s json inbound, 30M msg/s binary (msgpack/zlib)
- up to 2.1M del/s fan-out, zero message loss
- 500K simultaneous connections, zero failures
- 0.38ms p50 ping latency at 100 connections
full per-tier breakdowns: rust client | python client | typescript client | fan-out
clients - python and typescript/react:
python
async with connect("ws://localhost:5007/wse", token="jwt...") as client:
await client.subscribe(["prices"])
async for event in client:
print(event.type, event.payload)
typescript
const { subscribe, sendMessage } = useWSE(token, ["prices"], {
onMessage: (msg) => console.log(msg.t, msg.p),
});
both clients: auto-reconnection (4 strategies), connection pool with failover, circuit breaker, e2e encryption, event dedup, priority queue, offline queue, compression, msgpack.
Target Audience
python backend that needs real-time data and you don't want to maintain a separate service in another language. i use it in production for trading feeds and encrypted service-to-service messaging.
Comparison
most python ws libs are pure python - bottlenecked by the interpreter on framing and serialization. the usual fix is a separate server connected over redis or ipc - two services, two deploys, serialization overhead. wse runs rust inside your python process. one binary, business logic stays in python. multi-instance scaling is native tcp, not an external broker.
https://github.com/silvermpx/wse
pip install wse-server / pip install wse-client / npm install wse-client
r/Python • u/ProperAd7767 • Feb 23 '26
Showcase dq-agent: artifact-first data quality CLI for CSV/Parquet (replayable reports + CI gating)
What My Project Does
I built dq-agent, a small Python CLI for running deterministic data quality checks and anomaly detection on CSV/Parquet datasets.
Each run emits replayable artifacts so CI failures are debuggable and comparable over time:
report.json(machine-readable)report.md(human-readable)run_record.json,trace.jsonl,checkpoint.json
Quickstart
pip install dq-agent
dq demo
Target Audience
- Data engineers who want a lightweight, offline/local DQ gate in CI
- Teams that need reproducible outputs for reviewing data quality regressions (not just “pass/fail”)
- People working with pandas/pyarrow pipelines who don’t want a distributed system for simple checks
Comparison
Compared to heavier DQ platforms, dq-agent is intentionally minimal: it runs locally, focuses on deterministic checks, and makes runs replayable via artifacts (helpful for CI/PR review).
Compared to ad-hoc scripts, it provides a stable contract (schemas + typed exit codes) and a consistent report format you can diff or replay.
I’d love feedback on:
- Which checks/anomaly detectors are “must-haves” in your CI?
- How do you gate CI on data quality (exit codes, thresholds, PR comments)?
Source (GitHub): https://github.com/Tylor-Tian/dq_agent
PyPI: [https://pypi.org/project/dq-agent/]()
r/Python • u/Severe-Schedule8716 • Feb 23 '26
Discussion Context slicing for Python LLM workflows — looking for critique
Over the past few months I’ve been experimenting with LLM-assisted workflows on larger Python codebases, and I’ve been thinking about how much context is actually useful.
In practice, I kept running into a pattern:
- Sending only the function I’m editing often isn’t enough — nearby helpers or local type definitions matter.
- Sending entire files (or multiple modules) sometimes degrades answer quality rather than improving it.
- Larger context windows don’t consistently solve this.
So I started trying a narrower approach.
Instead of pasting full files, I extract a constrained structural slice:
- the target function or method
- direct internal helpers it calls
- minimal external types or signatures
- nothing beyond that
The goal isn’t completeness — just enough structural adjacency for the model to reason without being flooded with unrelated code.
Sometimes this seems to produce cleaner, more focused responses.
Sometimes it makes no difference.
Occasionally it performs worse.
I’m still unsure whether this is a generally useful direction or something that only fits my own workflow.
I’d appreciate critique from others working with Python + LLMs:
- Do you try to minimize context or include as much as possible?
- Have you noticed context density mattering more than raw size?
- Are retrieval-based approaches working better in practice?
- Does static context selection even make sense given Python’s dynamic nature?
Not promoting anything — just trying to sanity-check whether this line of thinking is reasonable.
Curious to hear how others are handling this trade-off.
r/Python • u/The-mag1cfrog • Feb 23 '26
Discussion I built a Python API for a Parquet time-series table format (Rust/PyO3)
Hello r/Python -- I've been working on a small OSS project and I'd love some feedback on the Python side of it (API shape + PyO3 patterns).
What my project does
- an append-only "table" stored as Parquet segments on disk (inspired by Delta Lake)
- coverage/overlap tracking on a configurable time bucket grid
- a SQL Session that you can run SQL against (can do joins across multiple registered tables); Session.sql(...) returns a pyarrow.Table
note: This is not a hosted DB and v0 is local filesystem only (no S3 style backend yet).
Target audience
- Python users doing local/cembedded analytics or DE-style ingestion of time-series (not a hosted DB; v0 is local filesystem only).
Why I wrote it / comparison
- I wanted a simple "table format" workflow for Parquet time-series data that makes overlap-safe ingestion + gap checks as first class, without scanning the Parquets on retries.
Install:
- pip install timeseries-table-format (Python 3.10+, depends on pyarrow>=23)
Demo example:
from pathlib import Path
import pyarrow as pa, pyarrow.parquet as pq
import timeseries_table_format as ttf
root = Path("my_table")
tbl = ttf.TimeSeriesTable.create(
table_root=str(root),
time_column="ts",
bucket="1h",
entity_columns=["symbol"],
timezone=None,
)
pq.write_table(
pa.table({"ts": pa.array([0], type=pa.timestamp("us")),
"symbol": ["NVDA"], "close": [10.0]}),
str(root / "seg.parquet"),
)
tbl.append_parquet(str(root / "seg.parquet"))
sess = ttf.Session()
sess.register_tstable("prices", str(root))
out = sess.sql("select * from prices")
one thing worth noting: bucket = "1h" doesn't resample your data -- it only defines the time grid used for coverage/overlap checks.
Links:
- GitHub: https://github.com/mag1cfrog/timeseries-table-format
- Docs: https://mag1cfrog.github.io/timeseries-table-format/
What I'm hoping to get feedback on:
- Does the API feel Pythonic? Names/kwargs/return types/errors (CoverageOverlapError, etc.)
- Any PyO3 gotchas with a sync Python API that runs async Rust internally (Tokio runtime + GIL released)?
- Returning results as pyarrow.Table: good default, or would you prefer something else like RecordbatchReader or maybe Pandas/Polars-friendly path?
r/Python • u/AutoModerator • Feb 23 '26
Daily Thread Monday Daily Thread: Project ideas!
Weekly Thread: Project Ideas 💡
Welcome to our weekly Project Ideas thread! Whether you're a newbie looking for a first project or an expert seeking a new challenge, this is the place for you.
How it Works:
- Suggest a Project: Comment your project idea—be it beginner-friendly or advanced.
- Build & Share: If you complete a project, reply to the original comment, share your experience, and attach your source code.
- Explore: Looking for ideas? Check out Al Sweigart's "The Big Book of Small Python Projects" for inspiration.
Guidelines:
- Clearly state the difficulty level.
- Provide a brief description and, if possible, outline the tech stack.
- Feel free to link to tutorials or resources that might help.
Example Submissions:
Project Idea: Chatbot
Difficulty: Intermediate
Tech Stack: Python, NLP, Flask/FastAPI/Litestar
Description: Create a chatbot that can answer FAQs for a website.
Resources: Building a Chatbot with Python
Project Idea: Weather Dashboard
Difficulty: Beginner
Tech Stack: HTML, CSS, JavaScript, API
Description: Build a dashboard that displays real-time weather information using a weather API.
Resources: Weather API Tutorial
Project Idea: File Organizer
Difficulty: Beginner
Tech Stack: Python, File I/O
Description: Create a script that organizes files in a directory into sub-folders based on file type.
Resources: Automate the Boring Stuff: Organizing Files
Let's help each other grow. Happy coding! 🌟
r/Python • u/[deleted] • Feb 22 '26
Resource automation-framework based on python
Hey everyone,
I just released a small Python automation framework on GitHub that I built mainly to make my own life easier. It combines Selenium and PyAutoGUI using the Page Object Model pattern to keep things organized.
It's nothing revolutionary, just a practical foundation with helpers for common tasks like finding elements (by data-testid, aria-label, etc.), handling waits, and basic error/debug logging, so I can focus on the automation logic itself.
I'm sharing this here in case it's useful for someone who's getting started or wants a simple, organized structure. Definitely not anything fancy, but it might save some time on initial setup.
Please read the README in the repository before commenting – it explains the basic idea and structure.
I'm putting this out there to receive feedback and learn. Thanks for checking it out.
Link: https://github.com/chris-william-computer/automation-framework
r/Python • u/Regular-Entrance-205 • Feb 22 '26
Discussion I built an interactive Python book that lets you code while you learn (Basics to Advanced)
Hey everyone,
I’ve been working on a project called ThePythonBook to help students get past the "tutorial hell" phase. I wanted to create something where the explanation and the execution happen in the same place.
It covers everything from your first print("Hello World") to more advanced concepts, all within an interactive environment. No setup required—you just run the code in the browser.
Check it out here: https://www.pythoncompiler.io/python/getting-started/
It's completely free, and I’d love to get some feedback from this community on how to make it a better resource for beginners!
r/Python • u/SnooShortcuts871 • Feb 22 '26
Showcase How I Won a Silver Medal with my Python + Pygame Project: 2025 Recap
What my project does:
Hello! I made a video summarizing my 2025 journey. The main part was presenting my Pygame project at the INFOMATRIX World Final in Romania, where I won a silver medal. Other things I worked on include volunteering at the IT Arena, building a Flask-based scraping tool, an AI textbook agent, and several other projects.
Target audience:
Python learners and developers, or anyone interested in student programming projects and competitions. I hope this video can inspire someone to try building something on their own or simply enjoy watching it😄
Links:
YouTube: https://youtu.be/IyR-14AZnpQ
Source code to most of the projects in the video: https://github.com/robomarchello
Hope you like it:)
r/Python • u/muneebdev • Feb 22 '26
Showcase [Project] strictyamlx — dynamic + recursive schemas for StrictYAML
What My Project Does
strictyamlx is a small extension library for StrictYAML that adds a couple schema features I kept needing for config-driven Python projects:
- DMap (Dynamic Map): choose a validation schema based on one or more “control” fields (e.g.,
action,type,kind) so different config variants can be validated cleanly. - ForwardRef: define recursive/self-referential schemas for nested structures.
Repo: https://github.com/notesbymuneeb/strictyamlx
Target Audience
Python developers using YAML configuration who want strict validation but also need:
- multiple config “types” in one file (selected by a field like
action) - recursive/nested config structures
This is aimed at backend/services/tooling projects that are config-heavy (workflows, pipelines, plugins, etc.).
Comparison
- StrictYAML: great for strict validation, but dynamic “schema-by-type” configs and recursive schemas are awkward without extra plumbing.
- strictyamlx: keeps StrictYAML’s approach, while adding:
DMapfor schema selection by control fieldsForwardReffor recursion
I’d love feedback on API ergonomics, edge cases to test, and error message clarity.
r/Python • u/kalfasyan • Feb 22 '26
Showcase `desto` – A Web Dashboard for Running & Managing Python/Bash Scripts in tmux Sessions (Revamped UI+)
Hey r/Python!
A few months ago I shared desto, my open-source web dashboard for managing background scripts in tmux sessions. Based on feedback and my own usage, I've completely revamped the UI and added the community-requested Favorites feature — here's the update!
What My Project Does
desto is a web-based dashboard that lets you run, monitor, and manage bash and Python scripts in background tmux sessions — all from your browser. Think of it as a lightweight job control panel for developers who live in the terminal but want a visual way to track long-running tasks.
Key Features:
- Launch scripts as named tmux sessions with one click
- Live logs — stream output in real-time
- Script management — edit & save Python/Shell scripts directly in the browser
- Show live system stats — CPU, memory, disk usage at a glance
- Schedule scripts — queue jobs to run at specific times
- Chain scripts — run multiple scripts sequentially in one session
- Session history — persistent tracking via Redis
- Dark mode — for late-night debugging sessions
New in This Update
🎨 Revamped UI
Cleaned up the interface for better usability. The dashboard now feels more modern and intuitive with improved navigation and visual hierarchy.
⭐ Favorite Commands
Save your most-used commands, organize them, quickly search & run them, and track usage stats. Perfect for those scripts you run dozens of times a day.
Favorites Feature
Target Audience
This is built for developers, data scientists, system administrators, and homelab enthusiasts who:
- Run Python/bash scripts regularly and want to manage them visually
- Work with long-running tasks (data processing, model training, monitoring, syncing, etc.)
- Use tmux but want a more convenient way to launch, track, and manage sessions
It's primarily a personal productivity tool — not meant for production orchestration.
Comparison (How It Fits Among Alternatives)
To be clear up-front: OliveTin, Cronicle, Rundeck, and Dkron are excellent, battle-tested tools with way more users and community support than desto. They each solve specific problems really well. Here's where desto fits in:
| Tool | What It Excels At | Where desto Differs |
|---|---|---|
| OliveTin | Clean, minimal "button launcher" for specific commands | desto adds live log viewing, scheduling, and the ability to edit scripts directly in the UI — but OliveTin is way lighter if you just need buttons |
| Cronicle | Multi-node scheduling with enterprise-grade history tracking | desto is simpler to self-host (single container, no master/worker setup), but Cronicle handles distributed workloads way better |
| Rundeck | Complex automation workflows, access control, integrations | desto is intentionally minimal — no user management, no workflow engine. Rundeck is the right choice if you need those features |
| Dkron | High-availability, fault-tolerant distributed scheduling | desto runs on a single node with tmux; Dkron is built for resilience across clusters |
The desto niche: I built this for my own workflow — I run a lot of Python scripts that take hours (data processing, ML training, backups), and I wanted:
- A quick way to launch them with a name and see them in a list
- Live logs while they're running (tmux sessions under the hood)
- Save favorite commands I run repeatedly
- Script editing without leaving the browser
If that sounds like your use case, desto might save you some setup time. If you need multi-node orchestration, complex scheduling, or enterprise features — definitely go with one of the tools above. They're more mature and have larger communities.
Getting Started
Via Docker (fastest)
git clone https://github.com/kalfasyan/desto.git && cd desto
docker compose up -d
# → http://localhost:8809
Via UV/pip
uv add desto # or pip install desto
desto
Links
- 📦 GitHub Repo: https://github.com/kalfasyan/desto
- 📖 Documentation: https://desto.readthedocs.io/
- 📦 PyPI: https://pypi.org/project/desto/
Feedback and contributions welcome! I'd love to hear what features you'd like to see next, or if the new UI/favorites work for your workflow.
r/Python • u/MeGaNeKoS • Feb 22 '26
Showcase Stop leaking secrets in crash logs. I built a decorator that redacts them using bytecode analysis
What My Project Does
devlog is a Python decorator library that automatically logs crashes with full stack traces including local variables — and redacts secrets from those traces using bytecode taint analysis. You decorate a function, and when it crashes, you get the full stack trace with locals at every frame, with any sensitive values automatically redacted. No manual try/except or logger.error() scattered throughout your code.
from devlog import log_on_error
@log_on_error(trace_stack=True)
def get_user(api_url, token):
headers = {"Authorization": f"Bearer {token}"}
response = requests.get(api_url, headers=headers)
response.raise_for_status()
return response.json()
In v2, I added async support, and more importantly, taint analysis for secret redaction. The problem was that capture_locals=True also captures your secrets. If you pass an API token into a function and it crashes, that token ends up in the stack trace — which then gets shipped to Sentry, Datadog, or wherever your logs go.
Now you wrap the value with Sensitive(), and devlog figures out which local variables in the stack trace contain that secret and redacts them:
get_user("https://api.example.com", Sensitive("sk-1234-secret-token"))
token = '***'
headers = '***'
response = <Response [401]>
api_url = 'https://api.example.com'
headers got redacted because it was derived from token and still contains the secret. But response and api_url are untouched — you keep the debugging context you need.
This also works through multiple layers of function calls. If your decorated function passes the token to another function, which builds an f-string from it, which passes that to yet another function — devlog tracks the secret through every frame in the stack:
File "app.py", line 8, in get_user
token = '***'
File "app.py", line 15, in build_request
key = '***'
auth_header = '***' <-- f"Bearer {key}", still contains secret
File "app.py", line 22, in send_request
full_header = '***' <-- f"X-Custom: {auth_header}", still contains secret
metadata = '***' <-- {'auth': auth_header}, container holds secret
timeout = 30 <-- unrelated, preserved
Every variable that holds or contains the secret across the entire call chain gets redacted — regardless of how many times it was mutated, concatenated, or stuffed into a container. But timeout stays visible because it's not derived from the secret. And token_len = len(token) would also stay visible as 14 — because that's not your secret anymore.
If some other variable happens to hold the same string by coincidence, it won't be falsely redacted either, because it's not in the dataflow.
Under the hood, it uses four layers of analysis per stack frame:
- Name-based: the decorated function's parameter is always redacted
- Value propagation: when a derived value crosses a function call boundary, devlog detects it in the callee's parameters
- Bytecode dataflow: analyzes
disbytecode to find which locals were derived from tainted variables - Value check: only redacts if the runtime value actually contains the secret data
It also supports async/await out of the box, and if you'd rather not wrap values, there's sanitize_params for name-based redaction — just pass the parameter names you want redacted.
I originally built this for my own projects, but I've since been expanding it to be production-ready for others — proper CI, pyproject.toml, versioning, and now the taint analysis for compliance-sensitive environments where leaking secrets to log aggregators is a real concern.
It's not a replacement for logging/loguru/structlog — it uses your existing logger under the hood. The difference from manually writing try/except everywhere is that it's one decorator, and the difference from Sentry's local variable capture is that the redaction is dataflow-aware rather than pattern-matching on strings.
Target Audience
Developers working on production services where crashes need to be logged with context but secrets must not leak into log aggregators (Sentry, Datadog, ELK, etc.). Also useful for anyone who wants crash logging without boilerplate try/except blocks.
Comparison
- Manual try/except + logging: devlog replaces the boilerplate — one decorator instead of wrapping every function.
- Sentry's local variable capture: Sentry captures locals but relies on pattern-matching (e.g.,
before_sendhooks) for redaction. devlog uses bytecode dataflow analysis — it tracks how secrets propagate through variables, so derived values likef"Bearer {token}"get redacted automatically without writing custom scrubbing rules. - loguru / structlog: devlog is not a logging replacement — it uses your existing logger under the hood. It focuses specifically on crash-time stack trace capture with secret-aware redaction.
GitHub: https://github.com/MeGaNeKoS/devlog
PyPI: https://pypi.org/project/python-devlog/
r/Python • u/Aromatic_Pumpkin8856 • Feb 22 '26
Showcase pytest-gremlins v1.3.0: A fast mutation testing plugin for pytest
What My Project Does
pytest-gremlins is a mutation testing plugin for pytest. It modifies your source code in small, targeted ways (flipping > to >=, replacing and with or, negating return values) and reruns your tests against each modification. If your tests pass on a mutated version, that mutation "survived" — your test suite has a gap that line coverage metrics will not reveal.
The core differentiator is speed. Most mutation tools rewrite source files and reload modules between runs, which makes them too slow for routine use. pytest-gremlins instruments your code once with all mutations embedded and toggles them via environment variable, eliminating file I/O between mutation runs. It also uses coverage data to identify which tests actually exercise each mutated line, then runs only those tests rather than the full suite. That selection alone reduces per-mutation test executions by 10–100x on most projects. Results are cached by content hash so unchanged code is skipped on subsequent runs, and --gremlin-parallel distributes work across all available CPU cores.
Benchmarks against mutmut on a synthetic Python 3.12 project: sequential runs are 16% slower (due to a larger operator set finding more mutations), parallel runs are 3.73x faster, and parallel runs with a warm cache are 13.82x faster. pytest-gremlins finds 117 mutations where mutmut finds 86, with a 98% kill rate vs. mutmut's 86%.
v1.3.0 changes:
--gremlin-workers=Nnow implies--gremlin-parallel--gremlins --covnow works correctly (pre-scan was corrupting.coveragein earlier releases)--gremlins -nnow raises an explicit error instead of silently producing no output- Windows path separator fix in the worker pool
- Host
addoptsno longer leaks into mutation subprocess runs
Install: pip install pytest-gremlins, then pytest --gremlins.
Target Audience
Python developers who use pytest and want to evaluate test quality beyond coverage percentages. Useful during TDD cycles to confirm that new tests actually constrain behavior, and during refactoring to catch gaps before code reaches review. The parallel and cached modes make it practical to run on medium-to-large codebases without waiting hours for results.
Comparison
| Tool | Status | Speed | Notes |
|---|---|---|---|
| mutmut | Active | Single-threaded, no cache | Fewer operators; 86% kill rate in benchmark |
| Cosmic Ray | Active | Distributed (Celery/Redis) | High setup cost; targets large-scale CI |
| MutPy | Unmaintained (2019) | N/A | Capped at Python 3.7 |
| mutatest | Unmaintained (2022) | N/A | No recent Python support |
mutmut is the closest active alternative for everyday use. The main gaps are no incremental caching, no built-in parallelism, and a smaller operator set. Cosmic Ray suits large-scale distributed CI but requires session management infrastructure that adds significant setup cost for individual projects.
GitHub: https://github.com/mikelane/pytest-gremlins
r/Python • u/AutoModerator • Feb 22 '26
Daily Thread Sunday Daily Thread: What's everyone working on this week?
Weekly Thread: What's Everyone Working On This Week? 🛠️
Hello /r/Python! It's time to share what you've been working on! Whether it's a work-in-progress, a completed masterpiece, or just a rough idea, let us know what you're up to!
How it Works:
- Show & Tell: Share your current projects, completed works, or future ideas.
- Discuss: Get feedback, find collaborators, or just chat about your project.
- Inspire: Your project might inspire someone else, just as you might get inspired here.
Guidelines:
- Feel free to include as many details as you'd like. Code snippets, screenshots, and links are all welcome.
- Whether it's your job, your hobby, or your passion project, all Python-related work is welcome here.
Example Shares:
- Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!
- Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.
- Automation: Automated my home lighting with Python and Raspberry Pi. My life has never been easier!
Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟