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 • • 1h ago

Fire till it glows!

0 Upvotes

r/madeinpython • • 1h ago

I built AlphaEngine: A quantitative portfolio optimization and financial analysis web app in Python

1 Upvotes

I wanted to share a project I've been developing: AlphaEngine, an interactive web application built with Python and Flask that computes optimal asset allocations using Modern Portfolio Theory (MPT).

Instead of manually guessing asset weights, the app fetches real-time market data, calculates daily and annual returns, and uses mathematical optimization to find the minimum-variance portfolio configuration.

Key features:

  • Real-Time Data Integration: Automatically pulls historical close prices using the Yahoo Finance API (yfinance).
  • Mathematical Optimization: Leverages SciPy's SLSQP algorithm to minimize portfolio variance subject to asset weight constraints.
  • Interactive Dashboard: Features a clean web interface built with Flask, dynamic JavaScript input fields, and pre-filled popular stock tickers.
  • Visual Analytics: Renders a responsive, customized donut chart using Plotly to visualize the ideal asset distribution.

I'll drop the GitHub repository link in the first comment below. I'd love to hear your feedback or thoughts on the implementation!


r/madeinpython • • 2h ago

I built a handwritten AI calculator with real-time learning in Python

1 Upvotes

Hey everyone,

I wanted to share an AI project I've been working on: a handwritten math calculator powered by a Keras/TensorFlow neural network and a Tkinter drawing interface.

Unlike standard digit-only classifiers, this model recognizes both digits (0–9) and basic mathematical operators (+, -), allowing users to hand-draw expressions and compute results. It also features live incremental learning, so you can instantly correct the model if it misidentifies a symbol.

Key features:

  • Multi-class recognition for digits and operators from 28x28 grayscale images.
  • Interactive Tkinter drawing canvas with automatic color normalization (to match the MNIST format).
  • Live on-device correction using train_on_batch: clicking a correction button immediately updates the neural network's weights and saves the model.
  • Real-time equation building and evaluation.

I'll drop the link to the GitHub repository in the first comment below if anyone wants to check out the code or test it. I'd love to hear your feedback or ideas for new features!


r/madeinpython • • 15h ago

πŸš€ PSP (Python Scaffolding Projects) v0.11.0 Released!

Thumbnail
camo.githubusercontent.com
2 Upvotes

πŸš€ PSP (Python Scaffolding Projects) v0.11.0 Released!

We're excited to announce the release of PSP v0.11.0, packed with new features, improvements, and fixes to make your Python project scaffolding even faster and more powerful!

πŸ”₯ What's New in v0.11.0?

✨ Added

  • ProjectResult type – Better structured output for project generation results.
  • prj_ai function – AI-assisted project scaffolding for smarter defaults.
  • toml_edit dependencies – Enhanced TOML file manipulation.
  • read_toml and write_toml functions – Easier TOML file handling.
  • PSP_AI environment variable – Control AI-assisted scaffolding behavior.

πŸ”§ Changed

  • Updated pyproject.toml for better compatibility.
  • Added rewrite parameter to render_template for more flexible templating.
  • Added pytest dependencies in prj_tox for better test integration.

πŸ› Fixed

  • Fixed GitLab CI name for proper remote repository support.
  • Improved code style consistency.

πŸ“Œ Why Use PSP?

PSP is the fastest way to scaffold Python projects, with:

βœ… 1-100x faster than other tools

βœ… AI-optimized templates (SKILLS.md, AGENTS.md, llms.txt)

βœ… Full Python ecosystem support (pip, conda, uv, poetry, hatch, maturin)

βœ… CI/CD integration (GitHub Actions, GitLab CI, CircleCI, TravisCI)

βœ… Docker & Container support

βœ… Pause/Resume project creation

βœ… Customizable profiles for different project types

πŸ“₯ Installation

Get started in seconds:

# Quick install (Linux/MacOS)
curl --proto '=https' --tlsv1.2 -fsSL https://raw.githubusercontent.com/MatteoGuadrini/psp/main/install.sh | bash
# Windows
iwr https://raw.githubusercontent.com/MatteoGuadrini/psp/main/install.ps1 | iex

Or install via pip:

pip install psp-scaffold --upgrade

πŸ“– Full Documentation

πŸ”— https://psp.readthedocs.io/

🀝 Contribute

PSP is open-source! Contributions are welcome: πŸ”— GitHub Repository


r/madeinpython • • 19h 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 • • 22h ago

Python's Hidden Traps! 😱 NumPy, Data Types & Floating Point Errors | Day 3 #iitian

Thumbnail
youtu.be
1 Upvotes

You can relate to this for growing python skills


r/madeinpython • • 1d ago

The python library "Beautiful Soup", from where did it gets that name from?

Thumbnail reddit.com
0 Upvotes

r/madeinpython • • 1d ago

my python flight search now builds google flights links by encoding the tfs protobuf by hand

1 Upvotes

i maintain viajante, a free open source flight search in python. until 1.7.0 the google flights links it returned opened the flights home page, so you had to type the search again.

now they go to /travel/flights/search?tfs=. the tfs value is a base64 protobuf message with the airports, dates, passengers, cabin and carry-on count.

there's no .proto file for it, so tfs.py writes the bytes itself. it has a varint writer, a length-delimited writer and a constant for each field number. 13 is the origin airport, 14 is the destination and 8 is passengers.

the field numbers came from probing google flights. checked bags are field 3, and google never echoed that filter back in the probes, so the encoder only writes the zero it saw.

repo: https://github.com/felipebasurto/viajante


r/madeinpython • • 1d ago

Built a FastAPI service for B2B lead scoring and outreach generation with Pytest

0 Upvotes

Hey everyone β€” I put together autodev-dispatcher, a lightweight FastAPI service for scoring B2B leads and generating personalized outreach messages, backed by a Pytest test suite.

How it works:

  • API & Schema Validation: FastAPI endpoints using Pydantic v2 models to validate incoming lead/context payloads and keep request/response shapes predictable.
  • Scoring & Template Logic: Separated lead scoring and message/template generation from the HTTP route handlers so rules and templates can be adjusted cleanly.
  • Testing: Pytest tests covering valid payloads, validation/error handling, and template/scoring behavior.

Repo:https://github.com/autosur00/autodev-dispatcher

Still iterating on how to keep template/prompt logic and test fixtures clean as the service growsβ€”would love any feedback or thoughts on how you structure similar FastAPI services.


r/madeinpython • • 1d ago

7-state propagation + sparse $\mathbb{F}_7$ Exact-1 pre-processing for conflict auditing and causal traces

Thumbnail reddit.com
0 Upvotes

r/madeinpython • • 1d ago

Feedback on my python project

Thumbnail reddit.com
0 Upvotes

r/madeinpython • • 2d 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 • • 2d 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 • • 2d 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 • • 2d 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 • • 2d 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 • • 2d ago

DCR: a wishlist idea has come to life

Post image
0 Upvotes

r/madeinpython • • 2d 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 • • 3d 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 • • 3d ago

npcpy reaches 50 contributors

Thumbnail
github.com
1 Upvotes

r/madeinpython • • 3d ago

Stormy weather, but the job still needs doing.

1 Upvotes