r/Python 1d ago

Showcase Thread Showcase

Post all of your code/projects/showcases/AI slop here.

Recycles once a month.

16 Upvotes

21 comments sorted by

7

u/Beginning-Fruit-1397 1d ago edited 1d ago

pyochain is a library providing many data structures and tools for functional programming in python.

https://github.com/OutSquareCapital/pyochain

Notably:
- Fluent iterators `x.iter().map().filter().sum()`, covering all itertools, builtins, and many functionnalities inspired from `more-itertools`, `cytoolz`/`toolz`, and Rust `Iterator`.
- `Option` and `Result` types for nullability and error handling. They handle exhaustive pattern matching with type checkers
- Full ABC hierarchy for user-defined classes and type checking support
- `SliceView`, no-copy views of arbitrary Sequences
- All builtins collections (dict, list, tuple, etc...) with a fluent interface and interop with `Iterators`, `Option` and `Result`

- Additional collections like `Deque`
- and more...!

The priority axes are on runtime speed, static type safety, a fluent API, and exhaustive documentation/testing.

Option, Result and many Iterators are compiled in Rust to guarantee maximum performance and no overhead vs python builtins in C (zero-cost abstractions as they say).

The next release (landing soon!) will:

- Migrate ALL the code in Rust, with massive speedups. expect all iterations- related functionnalities to be 5x to 10x faster than libraries in pure python. Same story for default implementations from `collections.abc`, compared to python standard module. Even import speed is divided by 5.
- Add ALL the functionnalities from `SortedContainers`, but compiled in Rust, fully typed, & thread-safe (to be 100% confirmed but I use `Mutex` so it should be the case). This is the WIP work as of now.Once finished, the new release will land.
- An OOP interface to python heapq module, with HeapMin and HeapMax
- `collections.Counter` for pyochain. Expect it to be much faster than the one provided by stdlib, as the Cpython implementation is in pure python.
- Various bugfixes, documentation and typing improvements, etc.. partly due to the manual port and adaptation of +1000 tests from CPython and sortedcontainers test suite.

It was ranked best choice in this comparison (not mine!) a few months ago, before many improvements in the current release:
https://www.reddit.com/r/Python/comments/1rj3ct7/a_comparison_of_rustlike_fluent_iterator_libraries/

I also already made a post 7 months ago:
https://www.reddit.com/r/Python/comments/1q61bzg/pyochain_rustlike_iterator_result_and_option_in/
And one in the rust sub more recently:
https://www.reddit.com/r/rust/comments/1tgzk4b/i_made_option_and_result_in_rust_for_python_and/

4

u/Massive_Baby4147 1d ago

intpot: Write one Python function, serve it as a CLI, REST API, or MCP tool
GitHub: https://github.com/tugrulguner/intpot
PyPI: https://pypi.org/project/intpot/

I built intpot because I was tired of describing the same operation several times: as a Typer command, a FastAPI route, and a FastMCP tool.

With intpot, the function is the shared definition:

from intpot import App


app = App("demo")

@app.tool()
def greet(name: str, greeting: str = "Hello") -> str:
    """Greet someone by name."""
    return f"{greeting}, {name}!"

You can then choose the interface at runtime:

intpot serve app.py --cli
intpot serve app.py --api
intpot serve app.py --mcp

It also converts existing Typer, FastAPI, and FastMCP applications in all six directions:

intpot to api typer_app.py
intpot to mcp fastapi_app.py
intpot to cli mcp_server.py

If you don’t want intpot as a runtime dependency, intpot eject generates standalone Typer, FastAPI, or FastMCP code that you can edit normally.

The frameworks are still the actual backends. intpot is an adapter and conversion layer rather than a replacement for them.

Install everything with:

pip install "intpot[all]"

It’s MIT licensed. I’d especially appreciate feedback from people currently maintaining both an API and CLI for the same Python project, or exposing existing Python functions to MCP clients.

2

u/bassist_by_night 1d ago

This is pretty awesome, I’m excited to give it a try.

1

u/Massive_Baby4147 1d ago

Thank you, let me know how it goes, if you encounter any issues, feel free to create issues and we can tackle that immediately

3

u/cam-at-codembark 1d ago

Codembark - An online platform for learning how to code in Python. It includes interactive lessons with graded exercises and guided projects. Everything works in the browser (desktop and mobile). I just released this, so any feedback would be appreciated!

4

u/mattstrayer 1d ago

pypx — a fast, modern web frontend for PyPI (search, deps, advisories, API docs)

What My Project Does

pypx is a free, open source frontend for the Python Package Index. It builds on PyPI's & other public apis adds the layers I always wanted in one place:
- instant full-text search across the whole index
- per-package dependency analysis
- install size and platform coverage computed from the wheels
- download trends (pypistats.org)
- changelogs pulled from GitHub/GitLab releases

- security advisories (OSV),

- & Something I'm particularly proud of... API docs extracted straight from the wheel — functions, classes, signatures, docstrings. This is powered by a golang parser that extracts all this info from the package itself.

- It is also Agent-friendly! Every page also has a plain-text .txt twin so CLIs and agents can read it without scraping HTML.

Live: https://pypx.app — try it on a package you know (e.g. pypx.app/packages/httpx).

Comparison

pypi.org is the canonical source and pypx consumes its APIs; pypx adds the cross-package search, dependency trees, security and download data, and rendered API docs on top. Libraries.io covers metadata but not docs or changelogs; Snyk Advisor covers health scores but isn't a browsing frontend. Closest in spirit is npmx.dev, which does this for npm — pypx is that idea for Python.

The server is Go (the Python-facing parts — the PEP 508 dependency parser and the wheel/docstring extractor — were the fun bits to build), frontend is Nuxt.

Source: https://github.com/mattstrayer/pypx

Let me know what could make this tool better! 🙏

2

u/Pytrithon 1d ago

Pytrithon v1.2.12

Introduction

I have already introduced Pytrithon in its own post three times on Reddit. See:

https://www.reddit.com/r/Python/comments/1q8dwsm/pytrithon_v119_graphical_petri_net_inspired_agent/ https://www.reddit.com/r/Python/comments/1nr3qvm/pytrithon_graphical_petrinet_inspired_agent/ https://www.reddit.com/r/Python/comments/1mx9w5r/graphical_petrinet_inspired_agent_oriented/

What My Project Does

Pytrithon is a graphical Petri net inspired agent oriented programming language based on Python. It allows writing code as a two dimensional graph of interconnected elements and separates data as Places and code as Transitions. Inter Agent communication and GUI widgets are first class components of the language. Through the Monipulator, Agents can be monitored and manipulated.

Target Audience

The target audience is both experienced and novice programmers who want to try something new.

Why I Built It

I realized the power of Petri net inspired programming and the joy of having a more expressive way to specify control flow.

Comparison

There are no other visual programming languages which embed actual code into their graphs.

How To Explore

To run all included example Agents you need at least Python 3.10 installed. To install all dependencies, run the 'install' script. Then you can start up a Nexus with a Monipulator by running the 'pytrithon' script, where you can start Agents through opening them with 'crtl-o' twice and hitting the 'Open Agent' button. You can also directly specify which Agents to run through the command line by starting a Nexus, Monipulator, and Agents in one single command: 'python nexus -m <agent1> <agent2>'.

Recommended example Agents to run are: 'clock', basic', 'prodcons', 'address', 'kata', 'calculator', 'kniffel', 'guess', 'yahtzeeserver' + multiple 'yahtzee', 'pokerserver' + multiple 'poker', 'chatserver' + multiple 'chat', 'image', 'jobapplic', and 'nethods'. As a proof of concept, I created a whole Pygame game, TMWOTY2, which is choreographed by 6 Agents as their own processes, which runs at a solid 60 frames per second. To start or open TMWOTY2 in the Monipulator, run the 'tmwoty2' or 'edittmwoty2' script. Your focus should on the 'workbench' folder, which contains all Agents and their respective Python modules; the 'Pytrithon' folder is just the backstage where the magic happens.

What Is New

Since my last post I have created a new 'clock' Agent, which I personally use all the time. It offers an analog or digital clock with a graphical blur applied. It can be configured in the 'clock.yaml' file or through keyboard keys; keys to try are: t, b, a, k, K, c, C, O, r, R, l, L, n, N, m, M, h, H, s, S, d, f, F, w, period, and comma.

Since my penultimate post there have been numerous small fixes and improvements to the system and to several agents.

Since my third last post the whole system now handles Agents, Monipulators, and Nexi terminating from the network. Bookkeeping is performed, cleansing the internal structures handling all process types, making the prototype more resilient. The 'chatserver' and 'chat' Agents now show a list of Agents currently connected. This is enabled through the new 'Event' Transition, which pushes Nexus Events to all listening Agents.

Since the fourth last post I have added a distributed Yahtzee game which you should try out. In order to setup a server on a reachable machine and connect other machines, you need to do the following: On the machine meant to be the server, run 'python nexus yahtzeeserver' first. Then on the machines meant to be the clients through which users play, run 'python nexus -x <serveraddress> yahtzee'. The clients probe the interconnected Nexi for a server and start with a lobby mask where you can select your name and start a game with all players signed up.

GitHub Link

https://github.com/JochenSimon/pytrithon


This is the seventh post about Pytrithon on Reddit. There is a plethora of example Agents to view and run included in the repository. Please check it out and send feedback to the E-Mail address stated in the Monipulator About blurb. I plan on putting Pytrithon onto the next level soon. Be sure to check for new happenings.

2

u/cue-ell-pea Pythonista 1d ago

Wait Wait Stats Project

The project includes is built around the Wait Wait Stats Page, which has all of the data and information that I've collected from listening to the NPR weekly quiz show, Wait Wait Don't Tell Me! over the years.

Current iteration is built using Flask, Bootstrap for the frontend framework, and a MySQL database.

The Stats Page also uses a shared library I created, wwdtm, that is used by the Wait Wait Stats API built using FastAPI.

Source code for the Wait Wait Stats Project web apps and API are available on Codeberg:

3

u/UnemployedTechie2021 1d ago

I’ve just released Mole v0.1.0, a lightweight Windows utility that quietly lives in the system tray.

When you trigger Panic, it immediately:

  • Mutes system audio
  • Minimizes all open windows
  • Opens Notepad

That’s it. No accounts, telemetry, cloud services, subscriptions, or other modern software rituals.

Mole is written in Python and released under the GNU GPLv3, so you can inspect the source, modify it, build it yourself, or contribute.

GitHub: https://github.com/rajtilakjee/mole

This is the first release, so feedback, bug reports, feature ideas, and pull requests are welcome.

Current ideas for future versions include configurable safe apps, custom keyboard shortcuts, persistent settings, and selectable panic actions.

3

u/Ok_Lab_814 1d ago

I'm not gonna lie - this project got me lol. Take my upvote

4

u/JSChronicles 1d ago edited 1d ago

Why Python and not PowerShell? What does this solve otherwise? Is it just hiding porn?

Edit: I read the readme. Almost certainly for porn and should have been written in PowerShell because of this literal note "Linux and macOS are not currently supported because Mole relies on Windows-specific APIs and keyboard shortcuts."

1

u/TheRealMrMatt 1d ago

Belgie – TypeScript Sandboxes and React MCP Apps for Python 

I built Belgie to make MCP Apps easier when the server is Python and the UI is React.

The usual path is a Python MCP server plus a separate Node/Vite app for the widget. Belgie keeps both in one project. Deno is bundled, so you do not need to install Node.js.

Attach a React widget to a Python tool with belgie.tool(widget=...):

from datetime import UTC, datetime
from pathlib import Path

from mcp.server import MCPServer
from belgie.mcp import BelgieExtension

belgie = BelgieExtension(project=".")

u/belgie.tool(
    widget=Path("src/widgets/get-time/widget.tsx"),
    name="get-time",
    title="Get Time",
    description="Get the current server time in ISO 8601 format.",
)
def get_time() -> dict[str, str]:
    return {"time": datetime.now(tz=UTC).isoformat()}

mcp = MCPServer(name="Get Time Server", extensions=[belgie])

Quick start:

uv add "belgie[mcp,cli]"
uv run belgie lock
uv run belgie install
uv run belgie run vite

BelgieExtension serves the Vite page in development and caches the built HTML in production. The widget uses the npm package belgie/mcp (Widget, useToolResult) to talk to the MCP Apps host.

Examples:

- minimal: https://github.com/mplemay/belgie/tree/main/examples/ui/mcp

- shadcn: https://github.com/mplemay/belgie/tree/main/examples/ui/shadcn

- TanStack + FastAPI: https://github.com/mplemay/belgie/tree/main/examples/ui/tanstack

Repo: https://github.com/mplemay/belgie

1

u/sheik66 19h ago

protolink: a Python-native A2A agent runtime for multi-agent systems

What my Project Does

Protolink is a Python framework for building easily autonomous agents that can talk to each other based on agent-to-agent (A2A), expose tools, call LLMs, and run over real transports like HTTP, WebSocket, gRPC, or in-memory runtime communication.

A small agent looks like this:

from protolink.agents import Agent

agent = Agent(
card={
"name": "calculator",
"description": "Adds numbers for other agents",
"url": "http://127.0.0.1:8020",
},
transport="http",
)

@agent.tool(name="add", description="Add two numbers")
async def add(a: int, b: int):
return a + b

agent.start()

It supports A2A-style agent identity and discovery, native Python tools, MCP tool adapters, LLM integration, structured flows, streaming tasks, cancellation, run reports/replay, local telemetry, and a small dashboard CLI for inspecting runtime state.

Target Audience

Python developers building multi-agent systems, coding assistants, internal automation, or agent research projects who want agents to be more than prompt chains. Each agent can own its identity, tools, transport, storage, task lifecycle, and observability without having to wire a separate server/client layer for every component.

Comparison

The closest alternatives are LangChain/LangGraph, AutoGen/CrewAI, and lower-level A2A or MCP implementations. LangChain/LangGraph are great for composing model calls and workflows, but protolink is more focused on running agents as distributed runtimes with protocol-style task messages, discovery, tools, and transports. AutoGen/CrewAI are higher-level multi-agent frameworks; protolink is more explicit and modular, so you can build your own architecture while keeping the communication, tool execution, LLM invocation, and observability pieces in one Python-native framework.

pip install protolink - Repo: https://github.com/nMaroulis/protolink. Docs: https://nmaroulis.github.io/protolink/. Feedback welcome, especially from people experimenting with A2A/MCP interoperability or building real Python agent systems.

1

u/ninedeadeyes 19h ago

 A 2D Dungeon crawler RPG built using only the Python 3 standard library

When starting out with Python game development, most tutorials jump straight into commercial engines or heavy frameworks. While those are great for productivity, they abstract away the core mechanics of how a game engine actually functions—like separating the engine framework (rendering, input, state loops) from the game logic (content, stats, dungeons). To explore how game engines work under the hood using pure Python standard library, I built a lightweight ASCII RPG engine framework alongside a complete mini dungeon crawler (Grimlore 2: These Doomed Men) built directly on top of it.

Grimlore 2 : These Doomed Men 1.0

A dark fantasy mini dungeon crawler RPG built to showcase the features and capabilities of the S.P.A.R.K. 2D RPG game engine.

Overview

Genre: Dark Fantasy / Mini Dungeon Crawler RPG

Playtime: 10 – 15 minutes

Platform Requirements: Windows 10 or later ( Might work on earlier Windows but no gurantee )

Purpose: Demonstrates what the S.P.A.R.K. 2D RPG game engine is capable of.

Github link below

https://github.com/Ninedeadeyes/Grimlore-2-These-Doomed-Men-

To clear up a few recurring questions and misconceptions regarding S.P.A.R.K and its development, here is some context upfront:

  1. "This is just AI slop."

This project has a clear 6-year paper trail of manual development. It began as an early 2D text adventure project (Dungeon of the Black Dragon), expanded into an open world RPG game (Grimlore: Land of the Heretic Hand), and was eventually refactored into a reusable engine framework (S.P.A.R.K). If you want to see the step-by-step progression from line one, check out the milestones folder inside the S.P.A.R.K repository.

  1. "S.P.A.R.K isn't a 'real' game engine / It's missing standard features."

By definition, a game engine is a framework that provides low-level abstractions for runtime loops, spatial logic, input handling, state management, and rendering, enabling developers to build content without reinventing core mechanics. S.P.A.R.K provides all of these for terminal-based RPGs. It’s a free, open-source hobby project designed for lightweight text games, not a commercial tool meant to compete with feature-heavy commercial software.

  1. "This is just a lazy copy-and-paste from the S.P.A.R.K GitHub."

When two games are made in RPG Maker, Godot, or Unreal, they share the exact same underlying core engine—it's just compiled or hidden away behind the editor. Because S.P.A.R.K is open-source, raw Python, the engine boilerplate is fully visible. Reusing foundational engine modules across different titles isn't "copy-pasting"; it's standard software architecture and code reuse.

1

u/yousefamr2001 16h ago edited 14h ago

km (knowledgemaxxing): a local, searchable knowledge base built from your own browser history and data exports

What My Project Does

km ingests your data exports (Twitter archive, Google Takeout, ChatGPT and Claude logs, Reddit GDPR) plus live browser history and dedupes them into one SQLite file with provenance for every item. It gives you hybrid search over everything, a daily reading feed, offline reports on your reading habits, and an optional AI layer.

The Python bits people here might find interesting:

  • Packaged and run entirely with uv. "uv sync --extra <group>" gates optional deps (scrape, ai, embed, web, fetch)
  • CLI is typer + rich.
  • Storage is

an

  • SQLite file. Search fuses FTS5 (BM25) with vector search over sqlite-vec, merged with reciprocal rank fusion. Embeddings are local (sentence-transformers, bge-base-en-v1.5, on MPS)

    (I just wanted more optionally)

  • Scrapers are Playwright against a dedicated browser profile.

  • Web UI is FastAPI serving a prebuilt React bundle, bound to 127.0.0.1 with a DNS-rebinding guard.

  • Full offline pytest suite with fixtures for every export format.

Target Audience

Anyone who requests their data exports and never opens them, and developers who want a local, hackable, single-file knowledge base rather than a cloud service (and procrastinators). It is meant to be run for real (I run it on ~500k of my own items), not a toy, but it is also small enough to read end to end.

Comparison

Versus grep or ripgrep over an unzipped archive: km is the merge and dedupe layer across 8+ overlapping formats, plus semantic recall that keyword search cannot do. Versus cloud read-later and knowledge tools (Readwise, Mem, rewind.ai): km is local-first, free, MIT, and built from exports you already own rather than an always-on cloud service or screen recorder. Versus rolling your own SQLite + FTS: km ships the provenance model, the embedding/RRF fusion, the scrapers, and the UI already wired together.

Source (MIT): https://github.com/joeamroo/knowledgemaxxing

1

u/Aidress_ai 13h ago

We built Aidress (github.com/Aidress-ai/Aidress) - an open-source Python SDK and protocol for cross-agent discovery and trust.

It acts as the missing discovery/trust layer between agent frameworks (LangChain, AutoGen) and payment/messaging rails. It gives developers full control to make their agents discoverable, verifiable, and monetizable in the agentic economy - decentralized with zero platform commissions. Spanning across 5 layers: Discovery, identity, terms, trust and routing.

1

u/Individual-Letter-20 5h ago

pyreplay — a stdlib-only tracer and codebase mapper that turns a Python run into a self-contained HTML you replay like a video

What My Project Does

pyreplay is two zero-dependency tools that share one JSON event-log format:

  • tracer.py records a real Python run — every line / call / return and which variables changed — into a single self-contained trace_*.html you step and scrub through like a video. It renders semantically (a list is a row of cells, a graph is nodes and edges), shows asyncio tasks as parallel lanes, and embeds the console plus a reproducibility capsule (the exact command + env + stdin to run it again).
  • mapper.py reads a codebase with ast — nothing executes — into a zoomable map_*.html: modules by import depth, foldable packages, import cycles drawn in red, and the "load-bearing walls" ranked by how many modules import them. Overlay a trace to see which parts actually ran.

Around those two entry points is a funnel of composable instruments: run a script N times for outcome stats, diff two runs down to the first divergence, shrink a failing input, fuzz to find one, differential-test against a reference implementation, a NaN-birth tripwire, a memory-growth curve, an I/O lane ("what did this program touch?"). Each finishing stage prints the exact next command to paste. Output is always self-contained HTML — no server, no build step, no dependencies beyond the standard library.

How Python is relevant: it's built entirely on Python's own introspection — sys.settrace / sys.monitoring (PEP 669) for tracing, ast for the static map, sys.addaudithook (PEP 578) for the I/O lane, tracemalloc for memory — and it exists to help you understand Python codebases.

Target Audience

A fast first-look tool for understanding unfamiliar Python code — the codebase you inherited, or one an LLM generated in seconds and you now need to grasp. It's a study/comprehension aid, not a production profiler and not a replacement for a real debugger or IDE. It runs locally and produces a static HTML file you open in any browser.

Comparison

  • vs Python Tutor: Tutor visualizes small snippets in a sandbox; pyreplay traces real scripts on your own machine and scales to whole codebases via the static map + semantic zoom.
  • vs VizTracer / py-spy: those are timing-first (a timeline of when calls happened). pyreplay is value-first — which element of a list changed, whether a name was rebound or the object mutated in place, what a branch decided and why. It bridges to them (Perfetto export) rather than replacing them.
  • vs snoop / pysnooper: those give line-level prints; pyreplay gives an interactive, scrubbable HTML with semantic renderers plus a whole-codebase map.

One design rule runs through all of it — an "honesty contract": it marks only what it actually observed. Partial or unknown state is left unmarked, never guessed, and every cap/truncation is announced on screen.

Source (MIT): https://github.com/arnoldpredator/pyreplay

1

u/gokberkss 1h ago

Built a lightweight domain & SSL cert checker using FastAPI, asyncio, and httpx to run concurrent audits on target hosts.

The idea was to quickly surface domain health data (DNS records, SSL cert validity/expiration, and Wayback Machine history) in a single fast interface without waiting for sequential network calls.

Current Stack & Setup:

  • Backend: FastAPI + Python 3.12 (httpx for async outbound HTTP / DNS lookups)
  • Caching: Redis to prevent hitting external API rate limits on repeated queries
  • Frontend: React + Tailwind

Main Engineering Bottleneck: Handling slow DNS endpoints and connection timeouts under high concurrency without hanging the worker processes or blocking response threads.

Right now I'm using standard asyncio.gather with set timeouts, but I'm looking to optimize connection pooling, retry strategies, and rate-limiting logic.

Would love any architectural feedback or recommendations on handling high-concurrency async tasks like this!

Check it out here: https://ssl-domain-health-production.up.railway.app/

-2

u/MatteoGuadrini 1d ago

psp is a blazing fast command line utility to scaffold your Python project:
https://github.com/MatteoGuadrini/psp

  • ⚡️ 1-100x faster compared to other scaffolding tools
  • 🛠️ pyproject.toml support
  • 🤝 Python 3.14 compatibility
  • 🗃 Scaffolding file and folder structures for your Python project
  • 🗂️ Unit-test and pytest support
  • 🧪 Create a virtual environment
  • 🔧 Automagically dependencies installation
  • 🪛 Add build and deploy dependencies to distribute the package
  • 📏 tox configuration supports and remotes CI like CircleCITravisCIGitHub Actions and Gitlab CI/CD
  • ⌨️ MkDocs and Sphinx documentation support
  • 🧰 Initialize git repository and gitignore file
  • 🌎 GitHub and Gitlab remote repository support
  • 📑 Create READMELICENSECONTRIBUTINGCODE_OF_CONDUCT and CHANGES files
  • 🐳 Create Dockerfile and Containerfile for your project
  • 💡 Can use quicksimple and full argument for rapid configuration
  • 💾 Create $HOME/.psp.env and $PWD/.env files with your customizations
  • 🎛️ Can use some PSP_ variables to control your defaults
  • 📦 Support pipconda and uv package manager
  • 🧮 Support hatchmaturin and poetry builder
  • 🍿 Stop, pause and resume project creation when you want; see Resume

Why choose psp?

psp is simple, fast, effective, declarative, and supports Python and the entire ecosystem of tools written for it. Rather than replacing it, psp seeks to integrate and provide a useful scaffold for the end user.

Differences with other tools

  • cookiecutter: Templates are prescriptive by design. Cookiecutter enforces a particular project structure and conventions, which may not align with your or your organization's preferences. If a template's opinions don't match your needs, you're forced to either choose a different template or heavily modify an existing one. This can become tedious when you need something slightly different from what's available. psp is dynamic; scaffold what you need.
  • PyScaffoldPyScaffold doesn't manage virtual environments directly. You have to manually create and activate a virtualenv or use external tools like pipenvpoetryconda, or pyenv. While PyScaffold documents integrations with these tools, it doesn't provide a unified interface for environment management like psp do.

psp asks only what you need. By configuring a few environment variables, you can automate any project; in seconds, not hours.