r/madeinpython • • May 05 '20

Meta Mod Applications

28 Upvotes

In the comments below, you can ask to become a moderator.

Upvote those who you think should be moderators.

Remember to give reasons on why you should be moderator!


r/madeinpython • • 37m ago

Feedback on my python project

Thumbnail reddit.com
1 Upvotes

r/madeinpython • • 4h ago

made a termux tool that checks your code for llama.cpp 1.0 breaking changes before you get burned by them

1 Upvotes

llama.cpp hit 1.0 a few days ago and quietly dropped a bunch of stuff people's scripts depend on, a few functions gone, a flag removed, a header that moved. went looking for something that'd just scan my code and tell me what's gonna break and couldn't find anything, so i built it instead.

its called llamadoctor, one python file, no deps, runs fine in termux since thats literally where i wrote the whole thing on my phone. point it at a folder and it tells you whats broken, severity sorted, links to the actual github PR for each one so your not just trusting some random script. if theres an easy mechanical fix it offers to do it for you, asks first obviously, and refuses to touch anything if your git tree is dirty unless you force it.

install is just(after cloning ofc.):

pip install -e .

llamadoctor yourfolder

repo's here if anyone wants to poke at it or tell me what i missed, pretty sure theres edge cases i haven't hit yet since i only had my own stuff and some test projects to throw at it

github.com/hunzo1/llamadoctor


r/madeinpython • • 7h ago

I’m learning Python by building a tiny character model from scratch

Thumbnail
github.com
1 Upvotes

I’m documenting my AI-learning journey by turning the lessons into one small Python project. This is the first milestone where everything from the earlier lessons connects into a runnable program.

It learns character-to-character patterns from a short text file, then samples those learned counts to generate a continuation. I used only Python’s standard library. The output can be awkward, which is useful to see: it’s a simple statistical model, not a neural network and not a finished chatbot.

The GitHub repository is linked above. I’m also posting the lessons here: https://www.youtube.com/channel/UCWMERaecgKZmrqPUHLqWuow

I’d appreciate feedback from people who remember learning Python: is the project layout understandable, and what would you improve next?


r/madeinpython • • 8h ago

I built a lightning simulator in Python using Pygame!

Post image
1 Upvotes

Hey everyone!

I've been building a collection of physics and simulation projects lately, and I wanted to share my latest one: a real-time 2D Lightning Simulator built completely from scratch using Python and Pygame.

The main challenge was simulating realistic electrical discharge patterns and dynamic branching structures on a 2D canvas while keeping the rendering smooth.

What it does:

  • Real-time procedural lightning generation with dynamic branching.
  • Interactive controls to trigger electrical storms directly on the screen.
  • Lightweight architecture built purely with Python and Pygame.

I'll drop the link to the GitHub repository in the comments if anyone wants to check out the source code or test it out. I'd love to get your feedback on the visual rendering or any ideas for new features!


r/madeinpython • • 8h ago

I built a 2D N-body gravitational solar system and accretion disk simulator from scratch in Python

Post image
1 Upvotes

Hey everyone,

I wanted to share a physics simulation project I built using Python and Pygame: a real-time 2D N-body solar system and accretion disk simulator.

Instead of hardcoding circular orbits, the simulation models true gravitational interactions, collision mechanics, and particle accretion between thousands of bodies in real time.

Key features:

  • Real-time N-body gravitational force calculations using Newton's law.
  • Dynamic particle merging and accretion (smaller dust particles clump together into larger asteroids and planetoids while conserving momentum).
  • Procedural nebula generation with randomized orbital speeds and chaos factors around a massive central sun.
  • Lightweight and smooth rendering entirely built from scratch with Python and Pygame.

I'll drop the link to the GitHub repository in the comments below. Let me know what you think or what orbital mechanics features I should add next!


r/madeinpython • • 15h ago

Sorting rare-disease medicines into approved, in trials and worth-reading-about with plain Python rules over Open Targets data

1 Upvotes

In a lot of the world, a family facing a rare diagnosis has no easy way to see which medicines are licensed for it, which are in trials, and where those trials are. The records exist, but they sit in regulator labels, trial registries and research portals written for specialists. Moonlight is our attempt to put them on one page: type a condition, get medicine cards, each linked to the record it came from.

The reason we keep going: someone in Kochi, in southern India, living with limb-girdle muscular dystrophy, used it to find a trial recruiting in the US (they are happy for us to say so). If you already see a specialist at a big research hospital, this adds little. Where specialists are thin on the ground, it can be the first time someone sees the options laid out.

How it is put together

It is a small Python package, moonlight/, served by FastAPI and Uvicorn, with a single static HTML/JS page in front.

  • translate.py turns an everyday or misspelt name into a disease Open Targets knows (MONDO, EFO or HP IDs). Gemini proposes up to three candidate names, each is looked up in Open Targets, and only Open Targets' own name and ID are used. Gemini's text is never shown, and the page only offers "Did you mean"; it never picks a disease for you.
  • fetch.py calls the Open Targets Platform GraphQL API for the disease's linked protein targets and the drugs acting on them. Open Targets is the only source of record; there is no private database behind it.
  • filter.py, engine.py and rank.py do the sorting with ordinary rules, not a model: approved for this disease goes to Approved, in a trial for it goes to Being studied, approved for something else but acting on a linked protein goes to New clues, and unapproved compounds go to Left out. Salt forms collapse into one card, and the ranking is deterministic (linked-protein score, then number of reports, then alphabetical).
  • protein.py and explain.py add a UniProt function line and a plain-English sentence per card.
  • cache.py keeps three layers: in memory, /tmp on the container, and Firestore for raw Open Targets responses, so a cold Cloud Run instance (asia-south1, Docker) does not hammer the upstream API.
  • Hand-checked fixes live in versioned JSON next to the code (corrections.json, approvals.json, withdrawals.json, left_out.json and a few more), each pinned by a pytest test that runs against saved Open Targets fixtures, so a fix cannot quietly regress after an upstream release.

Where else AI comes in: never to decide what a card says. Offline batch scripts use model calls to read FDA, EMA, DailyMed and PMDA labels and flag cards whose "approved" status has no matching label. A human decides each fix. Corrections people post on Reddit become numbered tickets, get checked against a regulator label, and land in those JSON files with a test.

What has worked so far

  • Besides the Kochi trial find, Open Targets confirmed seven wrong approval records we reported and has scheduled the fix for release 26.12 (thread 2105 on their community forum).
  • 17 tickets so far have come straight from patient communities pointing out mistakes, and a 124-disease audit found 724 of 2,096 "approved" entries had no DailyMed, FDA or EMA report attached. Those cards are now marked as weakly proven rather than hidden.

What is hard

  • One upstream source means its gaps are ours. Medicines licensed in the UK, EU or India but not by the FDA can show up as "in trials" only, and fixing that properly means pulling more regulators in.
  • Label checking across thousands of drug-disease pairs costs model API money, which we pay ourselves. There are no ads and no data selling, and we want to keep it that way.

Live site: https://www.moonlightclues.com Code (MIT): https://github.com/Moonlight-Clues/moonlight. A star helps if you find it useful.

The ask: the thing that would move us fastest is AI model credits, or a pointer to a credit programme (or a person) that backs open-source public-interest work. Separately, if you have worked with regulator data in Python, especially CDSCO or EMA, I would be glad of advice on parsing it, or a pull request.


r/madeinpython • • 20h ago

DCR: a wishlist idea has come to life

Post image
0 Upvotes

r/madeinpython • • 1d ago

my first cybersecurity project

Thumbnail
github.com
1 Upvotes

yo this is my first project

its a python security tool that checks python files for risky stuff and scans project packages for known vulnerabilities then it puts the results in a report it doesnt run your code or change any packages

still working on it so let me know what you think


r/madeinpython • • 1d ago

I built a local, no-cloud highlight finder for long gameplay recordings and stream VODs (CLI + MCP, MIT)

Thumbnail
github.com
1 Upvotes

Cloud clipping tools want you to upload hours of footage and pay per minute. I wanted something that runs on my own box, so I wrote highlight-detector.

What it does

Scans a video (anything FFmpeg reads) and ranks the most intense moments: loud spikes, gunfire/explosion-like hits, fast motion, scene cuts, flashes

Optional: your chat replay (TwitchDownloader JSON, CSV or plain text) and subtitles for hype words

Gives a reason for every pick, outputs JSON / CSV / YouTube chapters / EDL, and can cut the clips to MP4

MCP server included, so a local AI assistant can call it

Self-hosting details

Python 3.10+, NumPy, FFmpeg. No GPU, no API keys, no telemetry, nothing leaves your machine

Streams the decode, so a 10-hour VOD doesn't need 10 hours of RAM

14 min of 1080p: 41 s with video analysis, 1.4 s audio-only (4 vCPU VM)

Easy to cron over a recordings folder: highlight-detector "$f" -f chapters > "${f%.*}.chapters.txt"

Install: pipx install git+https://github.com/uralozden/highlight-detector

Repo: https://github.com/uralozden/highlight-detector

Limits: it measures intensity, not humour or meaning, and loud intro music can rank high. Feedback and per-game weight presets very welcome.


r/madeinpython • • 1d ago

I Built A C++ Powered Python Library Using pybind11 - way faster than python loops

Thumbnail reddit.com
1 Upvotes

Please have a look to this library

pip install kaptandanuj-easyhelper


r/madeinpython • • 1d ago

npcpy reaches 50 contributors

Thumbnail
github.com
1 Upvotes

r/madeinpython • • 1d ago

Stormy weather, but the job still needs doing.

1 Upvotes

r/madeinpython • • 1d ago

[Python] a 507-name scientific library with no dependencies, and a CLI that goes from constants to a dashboard

1 Upvotes

Repo: https://github.com/Furox-Art/scientific-computing-system - 2.2.23, MIT, Python 3.11+, zero runtime dependencies.

Everything in it is standard library. src/cds/ holds 34 subpackages plus causal.py and sensitivity.py - 35 feature modules, with the CLI entry point as the 36th - exporting 507 names total (343 functions, 164 classes). tests/test_readme_surface.py derives those counts from the package, so the README cannot drift without a test failing.

The CLI is the part that makes it usable without opening an editor. cds calc ke for a kinetic-energy calculation, cds stats 1,2,3,4 for descriptive statistics, cds sample normal, cds integrate, cds plot (ASCII by default, PNG with the [plot] extra), cds modules and cds info for the catalog and health summary, cds benchmark, and cds dashboard for a Streamlit dashboard behind the [dashboard] extra.

Underneath: SVD/QR/Cholesky/LU, ODE and PDE solvers (Euler through adaptive RK45, implicit stiff methods, symplectic integrators, 1-D heat and wave), quadrature from trapezoid to Gauss-Legendre, optimization from Newton to Nelder-Mead, statistics/probability/conjugate Bayes, Monte Carlo, and an educational ML module.

Install:

pip install scientific-computing-system

Latest commit is a good example of the numerical care: the ODE solvers now stop when a time step cannot advance, instead of continuing with a step that cannot progress.

One honest limit: pure standard library puts the speed ceiling at Python's, and the ML module says itself that it is educational rather than production. When you need compiled numerics the same API exists as scientific-computing-system-2.0 on NumPy/SciPy.


r/madeinpython • • 1d ago

HOCON for Python (oh ..., here we go again)

1 Upvotes

Hi all,

in my profession I am using HOCON format, but the native pyhocon has so many issues, and I wanted to try something new, so I started learning Zig. As initial project, I decided to implement HOCON for Zig. During the implementation it turned out the Zig is not issue, but HOCON with lacking official and checkable specification is.

My first part was to set into the stone what is HOCON actually, and created transferable Conformance suite.

Since Zig is wonderful language and allows very simple way of building sharable C libraries which can be easily ported to other languages I decided to prepare even Python package. This brings to the Python parsing immersive performance and great compatibility with HOCON specification better than what other python implementations provide..

Will be more than happy for feedback, and till you write me.

Enjoy: https://github.com/lejmr/zig-hocon


r/madeinpython • • 1d ago

Python Detective: Look closely at these dependency tree screenshots. What looks "impossible" or strictly violates standard Python/pip logic?

Thumbnail
gallery
0 Upvotes

Every one of us knows pipdeptree, poetry show --tree, or pip list.

Here is the tree of one virtual environment. At first glance, an ordinary GUI, but when you look at the data and relationships from the perspective of how Python and site-packages work, there are immediately 5 things that an ordinary Python tool cannot, by principle, display or would mark as an error.

Hints – focus on:

- The item moj_test_balicek and its occurrence in the tree vs. the right panel.
- How requests and its buddy PySocks are recorded and broken down in the tree.
- What the "Linker" category is doing in the package tree? (Since when does Python have a linker?)
- What the mysterious "Kept alive by (Owners)" in the package detail means?
- Look at the root categories above – how can the system know what was installed manually, what via a manifest, and what is an "Orphan"?

Just for fun, who among you will decipher what architecture is running under the hood of this graph and why it is not an ordinary pip output? Write your theories in the comments!


r/madeinpython • • 2d ago

[Python] polyguard 0.5.1: the test gate that treats an all-skipped run as a failure

1 Upvotes

Repo: https://github.com/Furox-Art/polyglot-code-guard - 0.5.1, the command is polyguard verify.

One opinion, implemented carefully: exit code 0 is not evidence that tests ran. Polyguard detects the project type, runs the build and test plan, and only prints PASS when it can find positive test-execution evidence in the runner's own output - pytest's passed line, cargo test result blocks, Go test events in the JSON stream, JUnit/Surefire/TRX counters, Swift Testing or XCTest summaries, per-test CTest Passed records.

0.5.1 tightened three things that used to be soft: an all-skipped or zero-test run cannot produce PASS, ambiguous runner evidence now fails closed instead of inferring that tests ran, and C/C++ plans on MSVC multi-config generators pass an explicit --config Debug / ctest -C Debug so CTest reports real verdicts instead of "Not Run". Timeouts kill the process tree so runner children do not survive the check, and captured output is capped at the final 256 KiB per command.

Eleven language identifiers are supported, and monorepos are discovered recursively with Maven modules, Gradle includes, Cargo workspaces, npm workspaces or a .sln delegated to the native workspace command once rather than being run twice.

Install:

python -m pip install --upgrade polyglot-code-guard

One honest limit: PASS means the built-in plan succeeded and genuine test-pass evidence was recognised, not that the code is correct or well covered. Because it executes your build scripts and package managers, an untrusted repository belongs in a disposable container - polyguard provides no OS isolation of its own.


r/madeinpython • • 2d ago

[Showcase] Pydantic Views: derive operation-specific schemas from one model

0 Upvotes

Hi everyone — I’m building pydantic-views, an open-source Python library for deriving operation-specific schemas from a single Pydantic model.

The goal is to avoid duplicating models for common API workflows such as:

  • create requests
  • update and patch (partial-update) requests
  • load/response models
  • create-result models
  • nested and generic models

Example:

from pydantic import BaseModel
from pydantic_views import CreatePreset, LoadPreset, View, ReadOnly, WriteOnly


class Account(BaseModel):
    id: Annotated[int, ReadOnly]
    username: str
    password: Annotated[str, WriteOnly]


class AccountCreate(View[Account], preset=CreatePreset):
    pass


class AccountLoad(View[Account], preset=LoadPreset):
    pass

The views inherit Pydantic validation and serialization while selecting fields according to access rules. They can be declared explicitly or generated dynamically with builders. Add this after the example:

If you’re coming from TypeScript, PartialPreset is roughly the equivalent of Partial<T>:

from pydantic_views import PartialPreset

class AccountPartial(View[Account], preset=PartialPreset):
    pass

Unlike a plain type transformation, the generated view remains a validated Pydantic model and can be used for partial updates. But you should look at UpdatePreset, I think is more useful.

The project also includes:

  • a mypy plugin for declared views
  • .pyi stub generation for Pyright and Pylance
  • support for nested models, containers, generics, and computed fields
  • runtime helpers such as is_view_of()
  • full documentation and executable examples

Install it with:

pip install pydantic-views

Links:

It’s an independent project and is not affiliated with or endorsed by Pydantic. Feedback, use cases, and suggestions are very welcome.


r/madeinpython • • 2d ago

I built a local MCP server that searches my papers, code and repos with page citations, and shares one memory across Claude Code, Cursor and Codex - Helps write better Code - More context building, less tokens, understands your work

Thumbnail
reddit.com
0 Upvotes

r/madeinpython • • 2d ago

[Python] plan-auditor: a requirement only counts as met when a command and its output say so

0 Upvotes

Repo: https://github.com/Furox-Art/plan-auditor - 2.6.5, MIT, no required runtime dependencies.

It exists for one failure: an agent says "done" in confident prose, and nothing in the transcript proves it. Here you write a plan whose requirements are declarable, and each step has to end with a recorded verification - a file check or a command with its real output. The evidence record is HMAC-chained, so a later edit shows up as an edit, and a requirement that cannot be reduced to a deterministic check is handed to a human instead of guessed.

It installs three console scripts: plan-auditor, plan-auditor-migrate-seal and plan-auditor-formal. The gate is also usable directly:

pip install plan-auditor
python hooks/gate_hook.py .

hooks/gate_hook.py is the single authoritative gate; scripts/stop_gate.py is the Claude Code side and delegates to it. The repo's own CI runs the README quick start and compares the transcript to real output, hashes included, so the example cannot drift.

One honest limit: it is not an OS sandbox - agent and verifier run as the same OS user - the evidence is tamper-evident rather than tamper-proof since HMAC is only as strong as the key staying secret, and domain meaning that resists a deterministic check stays a human decision.


r/madeinpython • • 2d ago

[Python] eq-layer: tone control as explicit states you can print, assert and route on

0 Upvotes

Repo: https://github.com/Furox-Art/eq-layer - 0.2.6.

"Be more empathetic" is a style instruction, and the failure is structural: you get the same flat warmth for a mild annoyance and for someone escalating. This library replaces the instruction with states.

Per turn it keeps an affect state - valence, arousal, escalation_delta, stance, subtext - so a trend exists as data instead of being re-guessed from each message. An intent classifier keeps the whole posterior over six intents instead of one number, and a one-step Bayes-risk router decides from that distribution whether to act or ask. The two states pick one policy family (mirror, validate_redirect, direct, ask, deflate, repair, hold, boundary), which is then split into orthogonal controls - task_move, social_move, repair_move, realization - so a tone change can't silently drop the actual request. The factored action compiles into a system instruction and prompt prefix.

There is a structural audit after generation too: question budget, required clarification, unsupported privacy promises, repeated repair, low-verbosity overrun. It checks the contract, not facts.

Install:

pip install "eq-layer[ml]"
npm install -g eq-layer

One honest limit: the core claim is untested. No real-model A/B run has been rated, the pre-registered protocol in eval/AB_PROTOCOL.md is pending with zero adjudicated labels, and the steering stays at prompt level - the logit_bias field is a placeholder that is never populated or applied.


r/madeinpython • • 2d ago

I built a tool to turn prospect research into a pitch you can check

1 Upvotes

Developers selling their own products struggle to turn prospect research into a relevant proposal. So I built VentureOS, a swarm of agents that prepares a sourced sales brief, a one-page proposal and an idea for what to build.

It checks that quoted evidence appears in the collected sources and asks for review when important context is missing, rather than silently filling the gaps. The source is free under MIT, live services cost money, and the recommendations still need your judgment.

Looking to any feedback, and if you like it, please star the project:

GitHub: https://github.com/efolley/Venture-OS
X post: https://x.com/_efolley/status/2124259294807797909


r/madeinpython • • 3d ago

[Python] scientific-reasoning-auditor: recompute the reported statistics, abstain when the inputs are ambiguous

1 Upvotes

Repo: https://github.com/Furox-Art/scientific-reasoning-auditor - Python 0.11.0 (HEAD d9f0e14), Node adapter 0.4.0. No required Python dependencies; the PDF/statistics extras bring the optional backends.

It takes a manuscript, extracts the reported statistics and method claims, and recomputes the ones that are checkable: statistic consistency against the stated degrees of freedom, multiple-testing corrections, regression and meta-analysis inputs, power and sample size, declared-DAG adjustment, MCMC diagnostics, ML split manifests. The manuscript stays read-only and findings land in separate report files:

sra audit manuscript.md --out reports/sample

The behaviour that makes it usable is abstention. The newest commit is exactly that: when a discrepancy sits under an undeclared tail or degrees-of-freedom correction, it now abstains instead of declaring a reporting error. Same for the SymPy/Pint/SciPy toolkit checks and the spaCy sentence candidates - they are candidates a human confirms, never truth claims.

Install:

python -m pip install --upgrade "scientific-reasoning-auditor[pdf,statistics]"

There is an npm adapter too, but it is a thin wrapper around the Python engine and the engine has to be installed first.

One honest limit: the published-reference pilot compared the unchanged 0.9.0 engine against historical manual labels for 1120 selected psychology results - 60% decision coverage, 34 of 49 reference errors flagged, 34 of 54 flags agreeing with the reference. That is retrospective conditional agreement on third-party input strings, not whole-paper validation, and it does not test the text extraction.