r/madeinpython • • 14d ago

speedrunner: keep a Python CLI imported in a daemon and fork it for each call

1 Upvotes

What My Project Does

I wrote speedrunner. One daemon per tool imports the CLI once, then forks for each call, so the interpreter start and the imports are skipped. A small Rust client hands over argv, the environment and the terminal. There is nothing to set up per tool: `srr black --check sample.py` goes from 92 ms to 12 ms on a 2-vCPU VPS.

Over 96 commands in Python, Ruby, PHP and Node: geometric mean x5.6, median x4.8. 69 of those only print a version or help text, so they measure start-up alone.

Target Audience

People who run Python CLIs many times a day or from scripts: black, pytest, aws, ansible. Linux and macOS only. The first call of a tool runs natively while its daemon starts, each daemon stays in memory, and the work a tool does after loading is no faster.

Comparison

Lazy imports change a tool's code and load less; this leaves the code alone and keeps everything loaded. dmypy and blackd are daemons for one tool each: the README has a table against them on one small file, blackd with curl comes out ahead, and large projects are not measured.

Where the time goes and how I measured it: https://anthonygosme.github.io/


r/madeinpython • • 14d ago

Built a modular desktop core in PyQt6 with dynamic ZIP plugin loading & Frameless MDI windows

1 Upvotes

Hello everyone!

I am working on a modular desktop application kernel built on PyQt6. My goal was to create a robust core application that can be extended exclusively through standalone, independent plugins without having to modify the core code.

In this short video, I demonstrate how the core starts up, how the custom MDI window manager behaves, and how new modules can be installed at runtime directly from a .ZIP archive.

How the plugin system works under the hood:

  • Contract via Metadata: Each plugin declares its metadata, roles/permissions, dependencies on other modules, and widgets.
  • 1-Click ZIP Installation: The application extracts the archive, verifies the module's integrity and dependencies, writes the path to modules.ini, and registers it in the system.
  • Dynamic Menu and Window Generation: The core reads the module settings and automatically creates items in the menu bar and sub-menus, assigning actions (including login and user permission checks).
  • Independent Communication: Modules never import the core directly via hard imports. They communicate via a bus (IoC bridge), have secure settings storage, and isolated namespaces for translations (i18n).
  • Dependency Protection on Shutdown and Deletion: The module manager does not allow disabling or uninstalling a module if other active modules depend on it.

UI / UX Highlights:

  • Completely custom frameless design via QSS styles.
  • Custom frameless MDI sub-windows with smooth dragging (utilizing a native "ghost" window with a snapshot during movement, which completely eliminates lag and stuttering during QMdiArea repainting).
  • Boundary guarding (dynamic coordinate recalculation so windows and dialogs never overflow outside the workspace or under bars).

Technologies used: Python 3, PyQt6, QSS.


r/madeinpython • • 14d ago

Built an agent security layer that enforces at the tool call, not the prompt. Python, open source.

Post image
1 Upvotes

r/madeinpython • • 14d ago

I made wheelgap: find which of your dependencies will compile from source (or fail) on ARM, Alpine or Python 3.14t, before your Docker build does

1 Upvotes

A common way a deploy breaks: everything installs fine on your laptop, then the Docker build on an ARM server or an Alpine image sits there compiling some package from source for ten minutes, or dies because there's no wheel for that platform at all.
wheelgap checks that up front. Point it at your lockfile and the platforms you ship to, and it tells you, package by package, whether pip/uv will get a prebuilt wheel, have to build from source, or can't install at all.

uvx wheelgap -t linux-aarch64,musl-aarch64 -p 3.13

Reads uv.lock, pylock.toml, poetry.lock, pdm.lock, Pipfile.lock and requirements.txt, and finds them on its own
Covers Linux (glibc and musl), macOS, Windows, iOS, Android and Pyodide, plus free-threaded 3.14t
--dockerfile Dockerfile reads the target straight from your final FROM line
--explain shows every rejected wheel and why ("manylinux_2_17_aarch64 is a glibc wheel; musl needs musllinux")
--json / --markdown output, a GitHub Action and a pre-commit hook
--offline for CI with no network
One dependency (packaging)
There's also a tracker that runs it nightly against the top 5,000 PyPI packages across 42 platform/Python combinations: https://wheelgap.github.io/tracker/
The part I'm most proud of isn't the code. wheelgap is two days old and has had 78 PRs merged from 21 contributors, many of them first-timers. Every issue says which files to touch and what to test, you can ask to have one assigned to you, and reviews usually land within hours. If you're learning Python and want your first real PR merged into a tool people use, there are good first issues waiting.
Coming in the next release: private package indexes (--index-url) and checking only the uv extras/groups you actually install.
GitHub: https://github.com/wheelgap/wheelgap
PyPI: https://pypi.org/project/wheelgap/
Feedback is very welcome, especially a package wheelgap gets wrong. That's the bug I most want to hear about.


r/madeinpython • • 15d ago

I built a free, open-source scanner that reads agent skills, Claude Code plugins and MCP configs before your agent does. Runs locally, no account, no LLM

Thumbnail github.com
1 Upvotes

r/madeinpython • • 15d ago

I built a Python quant research toolkit, couldn't validate a profitable strategy, so I open-sourced the tooling

Post image
0 Upvotes

Spent quite a while building a quant trading project, mostly focused on backtesting, research and avoiding misleading results.

Never found a strategy I could confidently validate, but the tooling seemed worth sharing.

It includes Python backtesting code, risk and reconciliation logic, research workflows, and offline demos.

It's MIT-licensed, with no live trading or profitability claims.

GitHub: https://github.com/privEgem/open-quant-trading-lab

If you work with Python, what would you improve or add?


r/madeinpython • • 16d ago

Spug: a Python/Django app for recurring SSH tasks in a web UI

2 Upvotes

I'm one of the maintainers of Spug, a self-hosted operations app for small and midsize teams. Its backend is Python/Django, the interface is React, and Paramiko handles SSH connections to Linux hosts. No Spug agent is needed on managed hosts.

The goal is to bring recurring operations into one web interface:

  • Host inventory, batch commands, an online terminal and file management
  • Application releases, deployment pipelines and scheduled tasks
  • A configuration center, monitoring and alerts

For example, select several hosts, run the same SSH command and inspect each host's output in the browser. This is an operations application rather than a Python library.

For a look at the Python code, start with the execution views and host models:
https://github.com/openspug/spug/tree/master/spug_api/apps/exec
https://github.com/openspug/spug/blob/master/spug_api/apps/host/models.py

Spug is free and open source (AGPL-3.0), with Docker installation and English/Chinese interfaces. The three screenshots show the English interface with sample data.

Source: https://github.com/openspug/spug
English guide: https://ops.spug.cc/en/docs/about-spug/
Demo: https://demo.spug.cc/ (admin / spug.cc; resets hourly). Please don't enter real credentials.

SSH private keys are stored without application-level encryption, so treat the panel and database as privileged systems.

Which Python-side workflow would you be interested in exploring: SSH execution, deployment pipelines or scheduled tasks?

Host management — grouped inventory with sample hosts.
Pipeline editor — a sample workflow.
Monitoring — example site, port, process and ping checks.

r/madeinpython • • 16d ago

hi

3 Upvotes

this is self-promotion btw. But just once JUST ONCE.

I have a project called "Worse Code" here it is. Its adjustable programming language.. made in python. Yea its sounds weird. But click the link and maybe you will like it.. Thanks guys for letting me (i hope so) self-promote.


r/madeinpython • • 16d ago

I built a Material 3 carousel extension for Flet (Python)

Post image
1 Upvotes

r/madeinpython • • 16d ago

wheelgap: find which of your dependencies will compile from source on ARM, Alpine, Windows ARM or 3.

0 Upvotes

What My Project Does

wheelgap reads your lockfile (`uv.lock`, `poetry.lock`, `pylock.toml`, or a pinned `requirements.txt`) and checks every pinned package against the platforms you ship to: `linux-aarch64`, Alpine/musl, macOS, `win-arm64`, and free-threaded Python 3.14t. For each one it reports a compatible wheel ✓, "builds from source", or "can't install". It runs offline from the lockfile in about a second, respects environment markers (so a Windows-only `pywin32` isn't flagged on Linux), and exits non-zero on gaps, so it also works as a CI check. There's a GitHub Action too.

uvx wheelgap -p 3.13 -t alpine-arm64

Target Audience

Anyone shipping Python to more than one platform: Docker images on ARM/Graviton or Alpine, apps with Windows-on-ARM users, and people trying out free-threaded 3.14t. It's small, tested on 3.11–3.14 across Linux, macOS and Windows, and fine to put in CI today.

Comparison

pyreadiness.org and hugovk's free-threaded-wheels tracker cover the top few hundred PyPI packages for one question each. wheelgap checks *your* dependency set, at *your* pinned versions, for any mix of platforms. The manual alternative is `pip download --only-binary=:all: --platform ... --python-version ...` once per target, which stops at the first failure and doesn't understand lockfiles.

Repo (MIT): https://github.com/patrickballard/wheelgap

Feedback welcome, especially wheel filenames it gets wrong.


r/madeinpython • • 16d ago

Native Python setup for AutoGPT Classic without using Docker

1 Upvotes

Running AutoGPT locally without Docker often trips people up because the official maintainers shifted primary development to AutoGPT Platform, which requires containerization. However, if your goal is running the agent loop natively on your host machine, AutoGPT Classic inside the classic directory still supports direct Python execution.

​The setup requires Python 3.12, Git, and Poetry. A common mistake is attempting to launch Poetry commands from the repository root or trying to install dependencies via standard global pip, which breaks the environment locked inside poetry.lock. You must execute all Poetry commands directly from the classic subfolder, verify Poetry targets the correct Python 3.12 interpreter, and configure your model provider credentials inside classic/original_autogpt/.env.

​I put together a complete technical breakdown that walks through dependency resolution, workspace directory isolation, Llamafile local endpoint routing, and diagnosing environment failures across Linux, macOS, and WSL 2.

​Check out the full walkthrough: https://interconnectd.com/blog/335/how-to-run-autogpt-without-docker-step-by-step-python-guide/


r/madeinpython • • 17d ago

A dependency map you can generate from your Python project's imports

0 Upvotes

For anyone whose Python project has grown past a few files: I added dependency graph exports to ArchUnitPython so you can inspect how the pieces actually connect.

I maintain the library. Its main job is checking architecture rules through tests, but the graph is useful before you even decide which rules to write.

You can generate an HTML report and a Mermaid diagram from the same project:

from archunitpython import project_graph

graph = (
    project_graph("src/")
    .titled("My Python project")
    .collapse_to_folder_depth(2)
)
graph.export_as_html("reports/dependencies.html")
graph.export_as_mermaid("reports/dependencies.mmd")

Point project_graph at your import root. Collapsing the graph to folders keeps a larger project readable instead of giving you one box for every file.

You can keep the Mermaid output with your documentation or attach the HTML report as a CI artifact. It gives you something concrete to inspect when a supposedly separate feature has acquired dependencies on half the project.

The graph follows imports the analysis can resolve. It's an import graph, not a runtime call trace, so it won't explain every relationship created dynamically while the program runs.

This is available in the published Python package, with no separate diagramming service to set up.

Repo: https://github.com/LukasNiessen/ArchUnitPython


r/madeinpython • • 17d ago

Pipeverify: compare a table before and after a pipeline change and get PASS / REVIEW / BLOCK

2 Upvotes

**What My Project Does**

pipeverify takes two snapshots of a table (CSV, Parquet, JSON, DuckDB or any SQLAlchemy source) and checks what a change did to the data: lost or duplicate keys, row count shifts, null creep, changed values on matched rows, column totals and new category codes. It returns PASS, REVIEW or BLOCK, with a plain-English report. Runs on DuckDB, ships as a CLI, a Python API (\`pipeverify.verify(before, after, key="id")\`) and a GitHub Action.

**Target Audience**

Data engineers and analytics engineers who ship pipeline, SQL or dbt changes, including changes written by AI coding agents. It's alpha but usable in CI.

**Comparison**

dbt tests and Great Expectations check rules you write in advance. pipeverify checks what a specific change did, so it catches problems nobody wrote a test for. Unlike row-diff tools, it turns the diff into a verdict with thresholds, so it can gate a merge.

**Repo**: https://github.com/akshaysharma1088/pipeverify (Apache-2.0, free). Feedback very welcome, and there are small good-first-issues if anyone wants to contribute.


r/madeinpython • • 17d ago

I built a Python CLI that turns printable-product research into reviewable Etsy drafts

2 Upvotes

I built etsy-engine as a staged Python CLI for a workflow that otherwise spans research, page generation, mockups and listing copy.

The part I'd most like Python developers to look at is the separation between stages. Ideas are scored and checked against live Etsy listings before generation starts. The workflow then plans the product format, generates pages, prepares mockups using those pages as references, and writes listing copy. SQLite keeps pipeline state, and the CLI exposes individual stages rather than only an end-to-end command.

The code is free and open source under MIT: GitHub repository

It requires Python 3.11+. The demo can produce a small bundle without an Etsy account, but it needs paid image and language-model API access. I also built Raywake, the default image service, so I want to be explicit that free code does not mean free generation.

If Etsy is connected, the workflow creates a listing draft only. A person still reviews the files, marks Etsy's AI-generation disclosure and publishes manually.

I'd appreciate feedback on the CLI structure and setup documentation. Are the stage boundaries clear enough for someone who wants to inspect or replace one part of the workflow?


r/madeinpython • • 17d ago

dature: a config loader that returns your plain dataclass from files, env, CLI and cloud secret stores, with errors that show file and line

1 Upvotes

What it is

dature is a config loader I wrote in Python. It reads configuration from many sources, merges them, and returns your own stdlib @dataclass. There is no base class and no framework, and it has 1 required dependencies (extras are optional). It needs Python 3.12+.

Sources: YAML, JSON, JSON5, TOML, INI, .env, environment variables, Docker secrets, CLI arguments, and remote stores (Vault, Consul, etcd, ZooKeeper, AWS SSM and Secrets Manager, Azure, GCP). The same dataclass works with all of them.

Why I made it

My setup is a .env for local dev, real env vars in Docker/Kubernetes, and sometimes a few YAML/TOML files on top (defaults plus one per environment). I kept hitting the same things with the tools I tried: merging per field turned into custom code, validation errors named the field but not the file or line, and it was hard to tell which source set a value in prod.

How it looks

from dataclasses import dataclass

import dature


@dataclass
class Config:
    host: str
    port: int


config = dature.load(
    dature.Yaml12Source(file="defaults.yaml"),
    dature.Toml11Source(file="config.toml", skip_if_missing=True),
    dature.EnvFileSource(file=".env", skip_if_broken=True),
    dature.EnvSource(prefix="APP_"),
    schema=Config,
)

Sources are merged in order (last wins by default). Other strategies are first_wins, first_found and raise_on_conflict, and you can set rules for individual fields, for example extend a list instead of replacing it.

When a value is wrong, the error points at the exact place:

  | dature.errors.exceptions.FieldLoadError:   [host]  Invalid variant: 'development'
  |    ├── host: "development"
  |    │          ^^^^^^^^^^^
  |    └── FILE 'config.yaml', line 1

What else it does

- debug=True shows which source each final value came from, and dature validate / dature inspect do the same from the command line for CI
- Field groups: if an override changes db_host, it must change db_port too, or loading fails
- Strict mode catches typo'd keys (databse_host) instead of silently ignoring them
- Sources can reference each other (${@env.config_path}) and be enabled conditionally (when=), so there's no glue code per environment
- Validators via Annotated, secrets masked in errors and output (SecretStr)
- Cached decorator mode with background reload when a file changes.
- Custom sources are a subclass with one method
- And much more

Status

It's a young and fairly small library, much smaller than pydantic-settings, but it's already production ready. I'd love feedback, especially on the API.

GitHub: https://github.com/reagento/dature
Doc: https://dature.readthedocs.io/en/stable/


r/madeinpython • • 17d ago

I hate using extra files so I made my own pixel art render

1 Upvotes
import pygame


pygame.init()
screen = pygame.display.set_mode((1000, 672))
pygame.display.set_caption("ME GAMING :3")
running = True
clock = pygame.time.Clock()
pixel = 0


color = {
    "grass": [(0, 200, 0), (0, 0, 0), (255, 255, 255)]
}


txtr = {
    "grass": [
        0, 2, 0, 0, 0, 0, 0, 0,
        0, 0, 2, 0, 0, 0, 0, 0,
        0, 0, 0, 2, 0, 0, 0, 0,
        0, 0, 0, 0, 2, 0, 0, 0,
        0, 0, 0, 0, 0, 2, 0, 0,
        0, 0, 0, 0, 0, 0, 2, 0,
        0, 0, 0, 0, 0, 0, 0, 2,
        0, 0, 0, 0, 0, 0, 0, 0,
    ]
}



def draw_txtr(choise, x, y):
    pixel = 0
    for q in range(len(txtr[choise])//8):
        for z in range(8):
            if txtr[choise][pixel] > 0:
                clr = color[choise][txtr[choise][pixel - 1]]
                pygame.draw.rect(
                    screen,
                    clr,
                    (x+(z*4), y+(q*4), 4, 4)
                )   
            pixel += 1


        #################
        ##  MAIN CODE  ##
        #################


while running:
    screen.fill((0, 0, 0))
    draw_txtr("grass", 10, 10)


    for event in pygame.event.get():   
        if event.type == pygame.QUIT:
            running = False


    pygame.display.flip()
    clock.tick(60)

r/madeinpython • • 18d ago

Made in Python: VulnPath-AI — offline scanner for AI/agent code risks

1 Upvotes

I've been learning application security with a focus on AI/agent-style code (tool calling, shell use, secrets in source, unsafe deserialization, etc.).

I built VulnPath-AI as a practice project:

- Offline Python hybrid scanner (pattern + AST)

- Looks for common issues like hardcoded secrets, command-injection patterns, eval/exec, pickle, SSRF-style fetches, and path/SQL string issues

- Shows path-style context and fix suggestions only (no exploit features)

- Includes sample vulnerable/safe files and a benchmark so I can test detection quality

Repo: https://github.com/zenithVeil/vulnpath-ai

**Quick try:**

git clone https://github.com/zenithVeil/vulnpath-ai.git

cd vulnpath-ai

pip install -e .

vulnpath-ai samples/sqli_example.py

I'm sharing mainly to learn from others:

- What false positives would you expect?

- Which agent-related risks are most important to cover next?

- Any feedback on making the reports clearer for beginners?

Not claiming this replaces professional SAST tools. It's a focused learning/engineering project.


r/madeinpython • • 18d ago

stu.py: a free Python learning environment that runs in your browser

0 Upvotes

Hi everyone,

I've built stu.py, a Python learning environment that's completely free, needs no sign-up and runs right in your browser. Python runs client-side via Brython, so your code never leaves your device, and it also works offline. It's online at https://stu-py.com

For learners:

  • A "Code Trail" with 2,000+ exercises and more than ten exercise types: predict the output, trace tables, find the bug, fill in the gaps, put lines in order, structograms/flowcharts and coding tasks with automatic checking
  • Each topic ends with a short room exam including an independent programming task
  • only then does the next room open - Targeted hints, a cheat sheet and a Spyder-like sandbox with console and variable explorer
  • XP, badges, a skills profile and a little robot called Stew who levels up with you

For instructors (what makes it different):

  • A built-in instructor area with course codes, ready-made room exams, a skills overview of your learners and badges you can award
  • Learners hand in a small account file, so you see progress and skills without any server, login or personal data stored online
  • More tools (exam generator with A/B groups, task creator, worksheets, projector view) are already built and will be opened on the website step by step

How Python is used:

  • Learners' code runs as real Python in the browser via Brython
  • The whole build pipeline is written in Python: it checks all 2,000+ exercises against their solutions, generates the trace tables and step-by-step explainer clips by running the code in CPython, and translates structograms/flowcharts into Python code

Right now the Basics chapter is open; the rest follows step by step. I'd be really glad for honest feedback: what's confusing, what's broken, what's missing?

Cheers!
Stew


r/madeinpython • • 19d ago

PyOffice Devolpment has started!

Post image
2 Upvotes

PyOffice is basically Microsoft Office but aimming to show How Python can turn into such connected and centrilzied that makes it great for real use : quick tweak of PyX (aka Excel)


r/madeinpython • • 19d ago

apple-llm: a Python library for macOS speech recognition, system voices, and the on-device LLM

1 Upvotes

I am the author of apple-llm, a Python and Node library for accessing Apple’s on-device language model. I recently added speech synthesis and transcription to the Python package, using the voices and speech recognition already in macOS.

Install with: pip install apple-llm

The Python API provides AppleSpeech for playback, synthesizing files, transcribing recordings, word timings and microphone recognition, plus AppleLLM for text and structured output. AsyncAppleSpeech and AsyncAppleLLM are available too. For example, use speech.transcribe("meeting.m4a", language="en-US", words=True), then pass result.text to an AppleLLM(tier="device") client for a summary.

The Python wheel has no required runtime dependencies. Both bindings compile and cache a shared Swift helper on first use. The project uses Apple’s native facilities; it does not bundle another speech model.

On my M4 Air running macOS 27.2, 30 minutes of narration rendered in about 18 seconds, and a 30-minute recording transcribed in about 28 seconds. These are single-machine measurements, and my accuracy tests used clean synthetic speech.

Requirements: macOS 26+ on Apple Silicon and Xcode Command Line Tools. Speech works without Apple Intelligence; the device LLM needs it enabled. Some recognition languages download on first use. Name the recognition language or it uses the Mac’s default; WebM input and MP3/Opus output are not supported. The optional cloud tier sends prompts off the Mac.

GitHub and Python examples: https://github.com/jagdishpal02000/apple-llm

Video: https://jagdishpal02000.github.io/apple-llm/#speech

I would especially appreciate compatibility reports from macOS 26 and results on real recordings.


r/madeinpython • • 19d ago

Somebody built an actual deep learning framework all in numpy!

1 Upvotes

GH: https://github.com/Yehor-Mishchyriak/PureML
Paper at JOSS: https://joss.theoj.org/papers/10.21105/joss.09631

Stars, contribution, and/or feedback are very welcome


r/madeinpython • • 19d ago

I made a package to pause/stop a running training loop from another terminal (or the Mac menu bar)

Post image
1 Upvotes

For my research I train models on my MacBook and kept opening a terminal every hour just to see what epoch a run was on more so when my agent runs a queue of training runs. So I made this.

You wrap your loop:

```python
import epochcontrol

for epoch in epochcontrol.loop(range(400), name="my run"):
train_one_epoch()
```

and then from another terminal `epochcontrol ls` shows what's running, how far along and the ETA, and `epochcontrol pause "my run"` pauses it at the end of the current epoch (resume / stop work the same). On a Mac there's a menu bar app that shows the same with a loss chart, that's the screenshot.

No server or socket, each run just writes a few JSON files to a folder and commands are files the loop checks between epochs. If anything in the package breaks it warns once and gets out of the way, it never crashes your training. No dependencies, Python 3.10+.

`pip install epochcontrol`
https://github.com/catalystdream/epochcontrol

It's early (0.1.0), happy to hear what's missing.


r/madeinpython • • 20d ago

[Web] I built a browser game where you script stickman combat in Python!

Thumbnail
reddit.com
1 Upvotes