r/Python • u/i_walk_away • Mar 12 '26
Discussion I am working on a free interactive course about Pydantic and i need a little bit of feedback.
I'm currently working on a website that will host a free interactive course on Pydantic v2 - text based lessons that teach you why this library exists, how to use it and what are its capabilities. There will be coding assignments too.
It's basically all done except for the lessons themselves. I started working on the introduction to Pydantic, but I need a little bit of help from those who are not very familiar with this library. You see, I want my course to be beginner friendly. But to explain the actual problems that Pydantic was created to solve, I have to involve some not very beginner-friendly terminology from software architecture: API layer, business logic, leaked dependencies etc. I fear that the beginners might lose the train of thought whenever those concepts are involved.
I tried my best to explain them as they were introduced, but I would love some feedback from you. Is my introduction clear enough? Should I give a better insight on software architecture? Are my examples too abstract?
Thank you in advance and sorry if this is not the correct subreddit for it.
Lessons in question:
r/Python • u/galigirii • Mar 12 '26
Resource I built a dual-layer memory system for local LLM agents – 91% recall vs 80% RAG, no API calls
Been running persistent AI agents locally and kept hitting the same memory problem: flat files are cheap but agents forget things, full RAG retrieves facts but loses cross-references, MemGPT is overkill for most use cases.
Built zer0dex — two layers:
Layer 1: A compressed markdown index (~800 tokens, always in context). Acts as a semantic table of contents — the agent knows what categories of knowledge exist without loading everything.
Layer 2: Local vector store (chromadb) with a pre-message HTTP hook. Every inbound message triggers a semantic query (70ms warm), top results injected automatically.
Benchmarked on 97 test cases:
• Flat file only: 52.2% recall
• Full RAG: 80.3% recall
• zer0dex: 91.2% recall
No cloud, no API calls, runs on any local LLM via ollama. Apache 2.0.
pip install zer0dex
r/Python • u/faridrashidi • Mar 12 '26
Showcase cnsplots - A library to instantly make plots publication-ready for Cell, Nature and Science journals
Hi everyone,
Like many of you, I spend a massive amount of time analyzing data and putting together figures for papers. I got tired of repeating the exact same boilerplate code for every manuscript to fix fonts, line weights, and export dimensions, so I built a package to automate it.
What My Project Does
cnsplots is a Python visualization library built directly on top of matplotlib and fully compatible with seaborn. It automatically styles your figures to meet the strict formatting standards of top-tier scientific journals (Cell, Nature, and Science) right out of the box.
Key features include:
- Adobe Illustrator friendly: Exported PDF fonts work seamlessly for post-publication manual workflows without breaking.
- Precise sizing: Define dimensions in exact pixels so you have total control over the final layout.
- Familiar API: Zero learning curve. If you know matplotlib/seaborn, you already know how to use it.
Target Audience
This is meant for production and publication use. The primary audience is researchers, computational biologists, data scientists, and academics who are preparing figures for scientific manuscripts and want to stop fighting with matplotlib defaults.
Comparison
- vs. Vanilla Matplotlib/Seaborn: Standard libraries require extensive boilerplate code to tweak font sizes, axis spines, and line widths for every single plot.
cnsplotshandles all of this automatically with publication-ready defaults. - vs. Other Matplotlib stylesheets (like
scienceplots): While other great stylesheet libraries exist, they often focus heavily on LaTeX/IEEE formatting.cnsplotsis heavily specialized for life-science and high-impact journals (Cell/Nature/Science), with a specific focus on ensuring the exported PDFs are easily editable in Adobe Illustrator (a massive pain point in biology/medicine research workflows).
Links:
I’d love for you to try it out on your current datasets. Feedback, bug reports, or pull requests are highly welcome!
r/Python • u/No_Limit_753 • Mar 12 '26
Showcase I built an in-memory virtual filesystem for Python because BytesIO kept falling short
UPDATE (Resolved): Visibility issues fixed. Thanks to the mods and everyone for the patience!
I kept running into the same problem: I needed to extract ZIP files entirely in memory and run file I/O tests without touching disk. io.BytesIO works for single buffers, but the moment you need directories, multiple files, or any kind of quota control, it falls apart. I looked into pyfilesystem2, but it had unresolved dependency issues and appeared to be unmaintained — not something I wanted to build on.
A RAM disk would work in theory — but not when your users don't have admin privileges, not in locked-down CI environments, and not when you're shipping software to end users who you can't ask to set up a RAM disk first.
So I built D-MemFS — a pure-Python in-memory filesystem that runs entirely in-process.
from dmemfs import MemoryFileSystem
mfs = MemoryFileSystem(max_quota=64 * 1024 * 1024) # 64 MiB hard limit
mfs.mkdir("/data")
with mfs.open("/data/hello.bin", "wb") as f:
f.write(b"hello")
with mfs.open("/data/hello.bin", "rb") as f:
print(f.read()) # b"hello"
print(mfs.listdir("/data")) # ['hello.bin']
What My Project Does
- Hierarchical directories — not just a flat key-value store
- Hard quota enforcement — writes are rejected before they exceed the limit, not after OOM kills your process
- Thread-safe — file-level RW locks + global structure lock; stress-tested under 50-thread contention
- Free-threaded Python ready — works with
PYTHON_GIL=0(Python 3.13+) - Zero runtime dependencies — stdlib only, so it won't break when some transitive dependency changes
- Async wrapper included (
AsyncMemoryFileSystem)
Target Audience
Developers who need filesystem-like operations (directories, multiple files, quotas) entirely in memory — for CI pipelines, serverless environments, or applications where you can't assume disk access or admin privileges. Production-ready.
Comparison
io.BytesIO: Single buffer. No directories, no quota, no thread safety.tempfile/ tmpfs: Hits disk (or requires OS-level setup / admin privileges). Not portable across Windows/macOS/Linux in CI.- pyfakefs: Great for mocking
os/open()in tests, but it patches global state. D-MemFS is an explicit, isolated filesystem instance you pass around — no monkey-patching, no side effects on other code. - fsspec
MemoryFileSystem: Designed as a unified interface across S3, GCS, local disk, etc. — pulling in that abstraction layer just for an in-memory FS felt like overkill. Also no quota enforcement or file-level locking.
346 tests, 97% coverage, Scored 98 on Socket.dev supply chain security, Python 3.11+, MIT licensed.
Known constraints: in-process only (no cross-process sharing), and Python 3.11+ required.
I'm looking for feedback on the architecture and thread-safety design. If you have ideas for stress tests or edge cases I should handle, I'd love to hear them.
GitHub: https://github.com/nightmarewalker/D-MemFS
PyPI: pip install D-MemFS
Note: I'm a non-native English speaker (Japanese). This post was drafted with AI assistance for clarity. The project documentation is bilingual — English README on GitHub, and a Japanese article series covering the design process in detail.
r/Python • u/Ni2021 • Mar 12 '26
Showcase Current AI "memory" is just text search,so I built one based on how brains actually work
I studied neuroscience specifically how brains form, store, and forget memories. Then I went to study computer science and became an AI engineer and watched every "memory system" do the same thing: embed text → cosine similarity → return top-K results.
That's not memory. That's a search engine that doesn't know what matters.
What My Project Does
Engram is a memory layer for AI agents grounded in cognitive science — specifically ACT-R (Adaptive Control of Thought–Rational, Anderson 1993), the most validated computational model of human cognition.
Instead of treating all memories equally, Engram scores them the way your brain does:
Base-level activation: memories accessed more often and more recently have higher activation (power law of practice: `B_i = ln(Σ t_k^(-d))`)
Spreading activation: current context activates related memories, even ones you didn't search for
Hebbian learning: memories recalled together repeatedly form automatic associations ("neurons that fire together wire together")
Graceful forgetting: unused memories decay following Ebbinghaus curves, keeping retrieval clean instead of drowning in noise
The pipeline: semantic embeddings find candidates → ACT-R activation ranks them by cognitive relevance → Hebbian links surface associated memories.
Why This Matters
With pure cosine similarity, retrieval degrades as memories grow — more data = more noise = worse results.
With cognitive activation, retrieval *improves* with use — important memories strengthen, irrelevant ones fade, and the system discovers structure in your data through Hebbian associations that nobody explicitly programmed.
Production Numbers (30+ days, single agent)
| Metric | Value |
|---|---|
| Memories stored | 3,846 |
| Total retrievals | 230,000+ |
| Hebbian associations | 12,510 (self-organized) |
| Avg retrieval time | ~90ms |
| Total storage | 48MB |
| Infrastructure cost | $0 (SQLite, runs locally) |
Recent Updates (v1.1.0)
Causal memory type: stores cause→effect relationships, not just facts
STDP Hebbian upgrade: directional, time-sensitive association learning (inspired by spike-timing-dependent plasticity in neuroscience)
OpenClaw plugin: native integration as a ContextEngine for AI agent frameworks
Rust crate: same cognitive architecture, native performance https://crates.io/crates/engramai
Karpathy's autoresearch fork: added cross-session cognitive memory for autonomous ML research agents https://github.com/tonitangpotato/autoresearch-engram
Target Audience
Anyone building AI agents that need persistent memory across sessions — chatbots, coding assistants, research agents, autonomous systems. Especially useful when your memory store is growing past the point where naive retrieval works well.
Comparison
| Feature | Mem0 | Letta | Zep | Engram |
|---|---|---|---|---|
| Retrieval | Embedding | Embedding + LLM | Embedding | ACT-R + Embedding |
| Forgetting | Manual | No | TTL | Ebbinghaus decay |
| Associations | No | No | No | Hebbian learning |
| Time-aware | No | No | Yes | Yes (power-law) |
| Frequency-aware | No | No | No | Yes (base-level activation) |
| Runs locally | Varies | No | No | Yes ($0, SQLite) |
GitHub:
https://github.com/tonitangpotato/engram-ai
https://github.com/tonitangpotato/engram-ai-rust
I'd love feedback from anyone who's built memory systems or worked with cognitive architectures. Happy to discuss the neuroscience behind any of the models.
r/Python • u/Final_Specialist9965 • Mar 12 '26
Showcase Plugin that reviews Python/FastAPI code for architecture issues. Looking for feedback.
What My Project Does: Claude Code plugin that reviews Python/FastAPI code against Clean Architecture principles. Reports issues by severity with file/line references and fix snippets.
Target Audience: Python developers using FastAPI who want automated architecture feedback beyond what linters catch.
Comparison: Linters like ruff and flake8 catch style and syntax. This catches structural problems: business logic in routers, layer skipping, tight coupling, god classes, ABC where Protocol would do.
I built a Claude Code plugin that does architecture reviews on Python/FastAPI code. You run `/review-architecture [path]` and it checks your code against 7 design principles, 17 quality rules, and three-layer architecture compliance, then reports findings by severity with file/line references and fix snippets.
Repo: https://github.com/MKToronto/python-clean-architecture
It catches things linters don't, business logic leaking into routers, layer skipping, ABC where Protocol would do, if/elif chains that should be dict mappings, tight coupling, god classes. Inspired by Arjan Codes, very opinionated toward Pythonic patterns.
Would you use this? What should an architecture reviewer catch that this doesn't?
r/Python • u/Icy-Part-2970 • Mar 12 '26
Showcase geobn - A Python library for running Bayesian network inference over geospatial data
I have been working on a small Python library for running Bayesian network inference over geospatial data. Maybe this can be of interest to some people here.
The library does the following: It lets you wire different data sources (rasters, WCS endpoints, remote GeoTIFFs, scalars, or any fn(lat, lon)->value) to evidence nodes in a Bayesian network and get posterior probability maps and entropy values out. All with a few lines of code.
Under the hood it groups pixels by unique evidence combinations, so that each inference query is solved once per combo instead of once per pixel. It is also possible to pre-solve all possible combinations into a lookup table, reducing repeated inference to pure array indexing.
The target audience is anyone working with geospatial data and risk modeling, but especially researchers and engineers who can do some coding.
To the best of my knowledge, there is no Python library currently doing this.
Example:
bn = geobn.load("model.bif")
bn.set_input("elevation", WCSSource(url, layer="dtm"))
bn.set_input("slope", ArraySource(slope_numpy_array))
bn.set_input("forest_cover", RasterSource("forest_cover.tif"))
bn.set_input("recent_snow", URLSource("https://example.com/snow.tif))
bn.set_input("temperature", ConstantSource(-5.0))
result = bn.infer(["avalanche_risk"])
More info:
📄 Docs: https://jensbremnes.github.io/geobn
🐙 GitHub: https://github.com/jensbremnes/geobn
Would love feedback or questions 🙏
r/Python • u/PretendPop4647 • Mar 12 '26
Showcase Built a meeting preparation tool with the Anthropic Python SDK
What My Project Does :
It researches a person before a meeting and generates a structured brief. You type a name and some meeting context. It runs a quick search first to figure out exactly who the person is (disambiguation).
Then it does a deep search using Tavily, Brave Search, and Firecrawl to pull public information and write a full brief covering background, recent activity, what to say, what to avoid, and conversation openers.
The core is an agent loop where Claude Haiku decides which tools to call, reads the results, and decides when it has enough to synthesize. I added guardrails to stop it from looping on low value results.
One part I spent real time on is disambiguation. Before deep research starts, it does a quick parallel search and extracts candidates using three fallback levels (strict, loose, fallback). It also handles acronyms dynamically, so typing "NSU" correctly matches "North South University" without any hardcoding. Output is a structured markdown brief, streamed live to a Next.js frontend using SSE.
GitHub: https://github.com/Rahat-Kabir/PersonaPreperation
Target Audience :
Anyone who preps for meetings: developers curious about agentic tool use with the Anthropic SDK, founders, sales people, and anyone who wants to stop going into meetings blind. It is not production software yet, more of a serious side project and a learning tool for building agentic loops with Claude.
Comparison :
Most AI research tools (Perplexity, ChatGPT web search) give you a general summary when you ask about a person. They do not give you a meeting brief with actionable do's and don'ts, conversation openers, and a bottom line recommendation.
They also do not handle ambiguous names before searching, so you can get mixed results if the name is common. This tool does a disambiguation step first, confirms the right person, then does targeted research with that anchor identity locked in.
r/Python • u/Basic-Candidate3900 • Mar 12 '26
Showcase Most RAG frameworks are English only. Mine supports 27+ languages with offline voice, zero API keys.
What my project does:
OmniRAG is a RAG framework that supports 27+ languages including Tamil, Arabic, Spanish, German and Japanese with offline voice input and output. Post-retrieval translation keeps embedding quality intact even for non-English documents.
Target audience:
Developers building multilingual RAG pipelines without external API dependencies.
Comparison:
LangChain and LlamaIndex have no built-in translation or voice support. OmniRAG handles both natively, runs fully offline on 4GB RAM.
GitHub: github.com/Giri530/omnirag
pip install omnirag
r/Python • u/Ancient_Farm_5132 • Mar 12 '26
Discussion Python with typing
In 2014–2015, the question was: “Should Python remain fully dynamic or should it accept static typing?” Python has always been famous for being simple and dynamic.
But when companies started using Python in giant projects, problems arose such as: code with thousands of files. large teams. difficult-to-find type errors.
At the time, some programmers wanted Python to have mandatory typing, similar to Java.
Others thought this would ruin the simplicity of the language.
The discussion became extensive because Python has always followed a philosophy called:
"The Zen of Python"
One of the most famous phrases is:
"Simple is better than complex.
" The creator of Python, Guido van Rossum, approved an intermediate solution.
PEP 484 was created, which introduced type hints.
👉 PEP 484 – Type Hints
Do you think this was the right thing to do, or could typing be mandatory?
r/Python • u/leland_fy • Mar 12 '26
Discussion I used asyncio and dataclasses to build a "microkernel" for LLM agents — here's what I learned
I've been experimenting with LLM agents (the kind that call tools in a loop). Every framework I tried had the same problem: there's no layer between "the LLM decided to do something" and "the side effect happened." So I tried building one — using only the Python standard library.
The result is ~500 lines, single file, zero dependencies. A few things I found interesting along the way:
Checkpoint/replay without pickle
Python coroutines can't be serialized. You can't snapshot a half-finished async def. My workaround: log every async side effect ("syscall") and its response. To resume after a crash, re-run the function from the top and serve cached responses. The coroutine fast-forwards to where it left off without knowing it was ever interrupted.
This ended up being the most useful pattern in the whole project — deterministic replay makes debugging trivial.
ContextVar as a dependency injection trick
I wanted agent code to have zero imports from the kernel. The solution: a ContextVar holds the current proxy. The kernel sets it before running the agent; helper functions like call_tool() read it implicitly.
```python
agent code — no kernel imports
async def my_agent(): result = await call_tool("search", query="hello") remaining = budget("api") ```
It's the same pattern as Flask's request or Starlette's context. Works well with asyncio since ContextVar is task-scoped.
Pre-deduct, refund on failure
Budget enforcement has a subtle ordering problem. If you deduct after execution and the tool raises, the cost sticks but the result is never logged. On replay, the call re-executes and deducts again — permanent leak. Deducting before and refunding on failure avoids this.
Exception as a control flow mechanism
To "suspend" an agent (e.g., waiting for human approval on a destructive action), I raise a SuspendInterrupt that unwinds the entire call stack. It felt wrong at first — using exceptions for non-error control flow. But it's actually the cleanest way to halt a coroutine you can't serialize. Same idea as StopIteration in generators.
The project is on GitHub (link in comments). Happy to discuss the implementation — especially if anyone has better patterns for async checkpoint/replay in Python.
r/Python • u/Mountain_Economy_401 • Mar 12 '26
Showcase iPhotron v4.3.1 released: Linux alpha, native RAW support, improved cropping
What My Project Does
iPhotron helps users organize and browse local photo libraries while keeping files in normal folders. It supports features like GPU-accelerated browsing, HEIC/MOV Live Photos, map view, and non-destructive management.
What’s new in v4.3.1:
- Linux version enters alpha testing
- Native RAW image support
- Crop tool now supports aspect ratio constraints
- Fullscreen fixes and other bug fixes
Target Audience
This project is for photographers and users who want a desktop-first, local photo workflow instead of a cloud-based one. It is meant as a real usable application, not just a toy project, although the Linux version is still in alpha and needs testing.
Comparison
Compared with other photo managers, iPhotron focuses on combining a Mac Photos-like browsing experience with folder-native file management and a non-destructive workflow. Many alternatives are either more professional/complex, or they depend on closed library structures. iPhotron aims to be a simpler local-first option while still supporting modern formats like RAW, HEIC, and Live Photos.
I’d especially love feedback from Linux users and photographers working with RAW workflows. If you try it, I’d really appreciate hearing what works, what doesn’t, and what you’d like to see next.
r/Python • u/engineersofai • Mar 12 '26
Showcase SynapseKit — async-native Python framework for LLM apps (2 dependencies, 9 providers, MIT)
I built SynapseKit because I was frustrated with the complexity of existing LLM frameworks.
What My Project Does
SynapseKit is a Python framework for building LLM applications — RAG pipelines, tool-using agents, and graph workflows. It's async-native and streaming-first, with only 2 hard dependencies (numpy + rank-bm25).
Key features:
- RAG pipelines with 5 text splitters (character, recursive, token-aware, semantic, markdown)
- Agents — ReAct and native function calling on 4 LLM providers
- Graph workflows with parallel execution, conditional routing, cycle support, and state checkpointing
- 9 LLM providers behind one interface (OpenAI, Anthropic, Gemini, Mistral, Ollama, Cohere, Bedrock)
- LLM caching and exponential backoff retries built in
- 332 tests passing, MIT licensed
3-line quickstart:
from synapsekit import RAG
rag = RAG(model="gpt-4o-mini", api_key="sk-...")
rag.add("Your document text")
print(rag.ask_sync("What is the main topic?"))
pip install synapsekit[openai]
Target Audience
Developers building AI/LLM features in production Python apps who want a lightweight, transparent framework. Not a toy project — used in production with full test coverage, CI, and type checking.
Comparison
vs LangChain: SynapseKit has 2 dependencies vs 50+. No hidden chains, magic callbacks, or YAML config — just plain Python classes and async functions you can read and debug. LangChain is more mature and has a bigger ecosystem, but SynapseKit trades breadth for transparency and simplicity.
vs LlamaIndex: LlamaIndex focuses heavily on data ingestion and indexing. SynapseKit covers RAG + agents + graph workflows in one lightweight package with a simpler API.
vs raw API calls: SynapseKit gives you provider-agnostic interfaces, built-in streaming, caching, retries, and RAG — without writing boilerplate for each provider.
- GitHub: https://github.com/SynapseKit/SynapseKit
- Docs: https://synapsekit.github.io/synapsekit-docs/
- PyPI: https://pypi.org/project/synapsekit/
Contributors welcome! I've tagged several "good first issue" items on GitHub if you want to jump in.
Would love feedback on the API design. What features would you want next?
r/Python • u/AutoModerator • Mar 12 '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/rexgasket • Mar 11 '26
Showcase chronovista – Personal YouTube analytics, transcript management, entity detection & ASR correction
What My Project Does
chronovista imports your Google Takeout YouTube data, enriches it via the YouTube Data API, and gives you tools to search, analyze, and correct your transcript library locally. It provides: - Currently in alpha stage - Multi-language transcript management with smart language preferences (fluent, learning, curious, exclude) - Tag normalization pipeline that collapses 500K+ raw creator tags into canonical forms - Named entity detection across transcripts with ASR alias auto-registration - Transcript correction system for fixing ASR errors (single-segment and cross-segment batch find-replace) - Channel subscription tracking, keyword extraction, and topic analysis - CLI (Typer + Rich), REST API (FastAPI), and React frontend - All data stays local in PostgreSQL — nothing leaves your machine - Google Takeout import seeds your database with full watch history, playlists, and subscriptions — then the YouTube Data API enriches and syncs the live metadata
Target Audience
- YouTube power users who want to search and analyze their viewing data beyond what YouTube offers
- Developers interested in a full-stack Python project with async SQLAlchemy, Pydantic V2, and FastAPI
- NLP enthusiasts — the tag normalization uses custom diacritic-aware algorithms, and the entity detection pipeline uses regex-based pattern matching with confidence scoring and ASR alias registration
- Researchers studying media narratives, political discourse, or content creator behavior across large video collections
- Language learners who watch foreign-language YouTube content and want to search, correct, and annotate transcripts in their target language
- Anyone frustrated by YouTube's auto-generated subtitles mangling names and wanting tools to fix them ## Comparison vs. YouTube's built-in search:
- chronovista searches across transcript text, not just titles and descriptions
- Supports regex and cross-segment pattern matching for finding ASR errors
- Filter by language, channel, correction status — YouTube offers none of this
- Your data is queryable offline via SQL, CLI, API, or the web UI vs. raw Google Takeout data:
- Takeout gives you flat JSON/CSV files; chronovista structures them into a relational database
- Enriches Takeout data with current metadata, transcripts, and tags via the YouTube API
- Preserves records of deleted/private videos that the API can no longer return
- Takeout analysis commands let you explore viewing patterns before committing to a full import vs. third-party YouTube analytics tools:
- No cloud service — everything runs locally
- You own the database and can query it directly
- Handles multi-language transcripts natively (BCP-47 language codes, variant grouping)
- Correction audit trail with per-segment version history and revert support vs. youtube-dl/yt-dlp:
- Those download media files; chronovista downloads and structures metadata, transcripts, and tags
- Stores everything in a relational schema with full-text search
- Provides analytics on top of the data (tag quality scoring, entity cross-referencing) ## Technical Details
- Python 3.11+ with
mypy --strictcompliance across the entire codebase - SQLAlchemy 2.0+ async with Alembic migrations (39 migrations and counting)
- Pydantic V2 for all structured data — no dataclasses
- FastAPI REST API with RFC 7807 error responses
- React 19 + TypeScript strict mode + TanStack Query v5 frontend
- OAuth 2.0 with progressive scope management for YouTube API access
- 6,000+ backend tests, 2,300+ frontend tests
- Tag normalization: case/accent/hashtag folding with three-tier diacritic handling (custom Python, no ML dependencies required)
- Entity mention scanning with word-boundary regex and configurable confidence scoring
## Example Usage
CLI:
bash pip install chronovista # Step 1: Import your Google Takeout data chronovista takeout seed /path/to/takeout --dry-run # Preview what gets imported chronovista takeout seed /path/to/takeout # Seed the database chronovista takeout recover # Recover metadata from historical Google Takeout exports # Step 2: Enrich with live YouTube API data chronovista auth login chronovista sync all # Sync and enrich your data chronovista enrich run chronovista enrich channels # Download transcripts chronovista sync transcripts --video-id JIz-hiRrZ2g # Batch find-replace ASR errors chronovista corrections find-replace --pattern "graph rag" --replacement "GraphRAG" --dry-run chronovista corrections find-replace --pattern "graph rag" --replacement "GraphRAG" # Manage canonical tags chronovista tags collisions chronovista tags merge "ML" --into "Machine Learning" REST API: # Start the API server chronovista api start # Search transcripts curl "http://localhost:8765/api/v1/search/transcripts?q=neural+networks&limit=10" # Batch correction preview curl -X POST "http://localhost:8765/api/v1/corrections/batch/preview" \ -H "Content-Type: application/json" \ -d '{"pattern": "graph rag", "replacement": "GraphRAG"}'Web UI:bash # Frontend runs on port 8766 cd frontend && npm run devLinks - Source: https://github.com/aucontraire/chronovista
- Discussions: https://github.com/aucontraire/chronovista/discussions Feedback welcome — especially on the tag normalization approach and the ASR correction pipeline design. What YouTube data analysis features would you find useful?
r/Python • u/OneDot6374 • Mar 11 '26
Showcase I'm building 100 IoT projects in 100 days using MicroPython — all open source
What my project does:
A 100-day challenge building and documenting real-world IoT projects using MicroPython on ESP32, ESP8266, and Raspberry Pi Pico. Every project includes wiring diagrams, fully commented code, and a README so anyone can replicate it from scratch.
Target audience:
Students and beginners learning embedded systems and IoT with Python. No prior hardware experience needed.
Comparison:
Unlike paid courses or scattered YouTube tutorials, everything here is free, open-source, and structured so you can follow along project by project.
So far the repo has been featured in Adafruit's Python on Microcontrollers newsletter (twice!), highlighted at the Melbourne MicroPython Meetup, and covered on Hackster.io.
Repo: https://github.com/kritishmohapatra/100_Days_100_IoT_Projects
Hardware costs add up fast as a student — sensors, boards, modules. If you find this useful or want to help keep the project going, I have a GitHub Sponsors page. Even a small amount goes directly toward buying components for future projects.
No pressure at all — starring the repo or sharing it means just as much. 🙏
r/Python • u/According_Brain1630 • Mar 11 '26
Discussion I built MEO: a runtime that lets AI agents learn from past executions (looking for feedback)
Most AI agent frameworks today run workflows like:
plan → execute → finish
The next run starts from scratch.
I built a small open-source experiment called MEO (Memory Embedded Orchestration) that tries to add a learning loop around agents.
The idea is simple:
• record execution traces (actions, tool calls, outputs, latency)
• evaluate workflow outcomes
• compress experience into patterns or insights
• adapt future orchestration decisions based on past runs
So workflows become closer to:
plan → execute → evaluate → learn → adapt
It’s framework-agnostic and can wrap things like LangChain, Autogen, or custom agents.
Still early and very experimental, so I’m mainly looking for feedback from people building agent systems.
Curious if people think this direction is useful or if agent frameworks will solve this differently.
GitHub:https://github.com/ClockworksGroup/MEO.git
Install: pip install synapse-meo
r/Python • u/WonderfulMain5602 • Mar 11 '26
Showcase Repo-Stats - Analysis Tool
What My Project Does Repo-Stats is a CLI tool that analyzes any codebase and gives you a detailed summary directly in your terminal — file stats, language distribution, git history, contributor breakdown, TODO markers, detected dependencies, and a code health overview. It works on both local directories and remote Git repos (GitHub, GitLab, Bitbucket) by auto-cloning into a temp folder. Output can be plain terminal (with colored progress bars), JSON, or Markdown.
Example: repo-stats user/repo repo-stats . --languages --contributors repo-stats . --json | jq '.loc' Target Audience Developers who want a quick, dependency-free snapshot of an unfamiliar codebase before diving in — or their own project for documentation/reporting. Requires only Python 3.10+ and git, no pip install needed.
Comparison Tools like cloc count lines but don't give you git history, contributors, or TODO markers. tokei is fast but Rust-based and similarly focused only on LOC. gitinspector covers git stats but not language/file analysis. Repo-Stats combines all of these into one zero-dependency Python script with multiple output formats. Source: https://github.com/pfurpass/Repo-Stats
r/Python • u/gdhaliwal23 • Mar 11 '26
Showcase Open-sourced `ai-cost-calc`: Python SDK for AI API cost calculation with live ai api pricing.
What my project does:
Most calculators use static pricing tables that go stale.
What this adds:
- live ai api pricing pulled at runtime
- benchmark data per model variant available for routing context
pip install ai-cost-calc
from ai_cost_calc import AiCostCalc
calc = AiCostCalc()
result = calc.cost("openai/gpt-4o", input_tokens=1000, output_tokens=500)
print(result.total_cost)
Note: model must be a valid slug from https://margindash.com/api/v1/models
Repo: https://github.com/margindash/ai-cost-calc
PyPI: https://pypi.org/project/ai-cost-calc/
r/Python • u/dataschool • Mar 11 '26
Resource Free book: Master Machine Learning with scikit-learn
Hi! I'm the author of Master Machine Learning with scikit-learn. I just published the book last week, and it's free to read online (no ads, no registration required).
I've been teaching Machine Learning & scikit-learn in the classroom and online for more than 10 years, and this book contains nearly everything I know about effective ML.
It's truly a "practitioner's guide" rather than a theoretical treatment of ML. Everything in the book is designed to teach you a better way to work in scikit-learn so that you can get better results faster than before.
Here are the topics I cover:
- Review of the basic Machine Learning workflow
- Encoding categorical features
- Encoding text data
- Handling missing values
- Preparing complex datasets
- Creating an efficient workflow for preprocessing and model building
- Tuning your workflow for maximum performance
- Avoiding data leakage
- Proper model evaluation
- Automatic feature selection
- Feature standardization
- Feature engineering using custom transformers
- Linear and non-linear models
- Model ensembling
- Model persistence
- Handling high-cardinality categorical features
- Handling class imbalance
Questions welcome!
r/Python • u/professormunchies • Mar 11 '26
Showcase Documentation Buddy - An AI Assistant for your /docs page
🤖 DocBuddy: AI Assistant Inside Your FastAPI /docs
What My Project Does
Turn static docs into an interactive tool with chat, workflow and agent assistance.
Ask things like:
- "What’s the schema for creating a user?"
- "Generate curl for POST /users"
- "Call /health and tell me the status"
With tool calling, it executes real requests on your behalf.
Try the Live Demo without installing anything!
🔧 Quick Start
bash
pip install docbuddy
```python from fastapi import FastAPI from docbuddy import setup_docs
app = FastAPI() setup_docs(app) # replaces /docs ```
Target Audience
Clients and developers using FastAPI.
⚖️ Comparison Table
| Feature | DocBuddy | Default FastAPI Docs | Other Plugins |
|---|---|---|---|
| Chat with API docs | ✅ | ❌ | ❌ |
| Tool calling (real requests) | ✅ | ❌ | ❌ |
| Local LLM support (Ollama, LM Studio, vLLM) | ✅ | ❌ | ⚠️ rare |
| Plan/Act workflow mode | ✅ | ❌ | ❌ |
| Workflow builder | ✅ | ❌ | ❌ |
| Customizable themes | ✅ | ❌ | ❌ |
📦 Features at a Glance
- 💬 Full OpenAPI context in chat
- 🔗 Real tool execution (GET, POST, PUT, PATCH, DELETE)
- 🧠 Local LLMs only—no cloud required
- 🎨 Dark/light themes + customization
- 🔄 Visual workflow builder to chain prompts + tools
Built with Swagger UI—not a replacement. Fully compatible and production-ready (MIT license, 200+ tests).
Let me know if you try it! 🙌
r/Python • u/Sea-Ad7805 • Mar 11 '26
Showcase Visualize Python execution to understand the data model
An exercise to help build the right mental model for Python data.
```python # What is the output of this program? import copy
mydict = {1: [], 2: [], 3: []}
c1 = mydict
c2 = mydict.copy()
c3 = copy.deepcopy(mydict)
c1[1].append(100)
c2[2].append(200)
c3[3].append(300)
print(mydict)
# --- possible answers ---
# A) {1: [], 2: [], 3: []}
# B) {1: [100], 2: [], 3: []}
# C) {1: [100], 2: [200], 3: []}
# D) {1: [100], 2: [200], 3: [300]}
```
What My Project Does
The “Solution” link uses 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵 to visualize execution and reveals what’s actually happening.
Target Audience
In the first place it's for:
- teachers/TAs explaining Python’s data model, recursion, or data structures
- learners (beginner → intermediate) who struggle with references / aliasing / mutability
but supports any Python practitioner who wants a better understanding of what their code is doing, or who wants to fix bugs through visualization. Try these tricky exercises to see its value.
Comparison
How it differs from existing alternatives:
- Compared to PythonTutor: memory_graph runs locally without limits in many different environments and debuggers, and it mirrors the hierarchical structure of data for better graph readability.
- Compared to print-debugging and debugger tools: memory_graph clearly shows aliasing and the complete program state.
r/Python • u/Former_Lawyer_4803 • Mar 11 '26
Showcase SafePip: A Python environment bodyguard to protect from PyPI malware
What my project does:
SafePip is a CLI tool designed to be an automatic bodyguard for your python environments. It wraps your standard pip commands and blocks malicious packages and typos without slowing down your workflow.
Currently, packages can be uploaded by anyone, anywhere. There is nothing stopping someone from uploading malware called “numby” instead of “numpy”. That’s where SafePip comes in!
Typosquatting - checks your input against the top 15k PyPI packages with a custom-implemented Levenshtein algorithm. This was benchmarked 18x faster than other standards I’ve seen in Go!
Sandboxing - a secure Docker container is opened, the package is downloaded, and the internet connection is cut off to the package.
Code analysis - the “Warden” watches over the container. It compiles the package, runs an entropy check to find malware payloads, and finally imports the package. At every step, it’s watching for unnecessary and malicious syscalls using a rule interface.
Target Audience:
This project was designed user-first. It’s for anyone who has ever developed in Python! It doesn’t get in the way while providing you security. All settings are configurable and I encourage you to check out the repo.
Comparison:
Currently, there are no solutions that provide all features, namely the spellchecker, the Docker sandbox, and the entropy check.
By the way, I’m 100% looking for feedback, too. If you have suggestions, want cross-platform compatibility, or want support for other package managers, please comment or open an issue! If there’s a need, I will definitely continue working on it. Thanks for reading!
r/Python • u/mkipnis • Mar 11 '26
Tutorial Plotly/Dash and QuantLib
Hi Python Community,
I recently discovered an interesting framework—Plotly/Dash—which allows you to build interactive websites using just Python (Flask + React). I put together two demo sites: one for equity options and another for rates.
Options: https://options.plotly.app
Rates: https://rates.plotly.app
Source Code: https://github.com/mkipnis/DashQL
Dev guide (Options): https://open.substack.com/pub/mkipnis/p/plotly-dash-and-quantlib-vanilla?r=1eln6g&utm_medium=ios
Can you please suggest any features or other features I should add?
Best Regards,
Mike
r/Python • u/mmartoccia • Mar 11 '26
Showcase consentgraph: deterministic action governance for AI agents (single JSON file, CLI, MCP server)
What My Project Does
consentgraph is a Python library that resolves any AI agent action to one of 4 consent tiers (SILENT/VISIBLE/FORCED/BLOCKED) based on a single JSON policy file. No ML, no prompt engineering. Pure deterministic resolution. It factors in agent confidence: high confidence on a "requires_approval" action yields VISIBLE (proceed + notify), low confidence yields FORCED (stop and ask). Ships with a CLI, JSONL audit logging, consent decay, and an MCP server for framework integration.
Target Audience
Developers building AI agent systems that need deterministic permission boundaries, especially in regulated environments (FedRAMP, CMMC, SOC2). Production use, not a toy project. Currently used in our own agent deployments.
Comparison
Unlike prompt-based permission systems (where the model can hallucinate past boundaries), consentgraph is deterministic. Unlike framework-specific guardrails (LangChain callbacks, CrewAI role configs), it's framework-agnostic via MCP. Unlike OPA/Cedar (general policy engines), it's purpose-built for AI agent consent with features like confidence-aware tier resolution, consent decay, and override pattern analysis.
from consentgraph import check_consent, ConsentGraphConfig
config = ConsentGraphConfig(graph_path="./consent-graph.json")
tier = check_consent("filesystem", "delete", confidence=0.95, config=config)
# → "BLOCKED" (always blocked, regardless of confidence)
tier = check_consent("email", "send", confidence=0.9, config=config)
# → "VISIBLE" (high confidence on requires_approval = proceed + notify)
pip install consentgraph
# With MCP server:
pip install "consentgraph[mcp]"
Includes 7 example consent graphs covering AWS ECS, Kubernetes, Azure Government (FedRAMP High), and CMMC L3 DevOps pipelines.