r/madeinpython • u/sebalhag • 56m ago
I make a blog where we highlight peoples python code
r/madeinpython • u/Cool_doggy • May 05 '20
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 • u/sebalhag • 56m ago
r/madeinpython • u/pedronokia • 9h ago
BlockGuard is a small circuit breaker for rate limits imposed by the server you're calling. When an API answers 429 (or blocks you silently), you call breaker.trip("some_api"). Until a cooldown passes, breaker.in_cooldown("some_api") returns True, so you can skip the request instead of hitting a server that already said no. Each new block doubles the cooldown (60s, 120s, 240s...) up to a ceiling, and keys are tracked independently, so one blocked endpoint doesn't stop the others.
It also ships a pytest plugin that resets breaker state between tests. Without it, a test that simulates a 429 leaves a real cooldown behind that silently breaks the next test.
Source: https://github.com/pdrleite/blockguard
Install: pip install blockguard
TARGET AUDIENCE
People who scrape or integrate with APIs that have undocumented, IP-scoped or time-varying limits, and people building AI agents whose tools call external APIs. Agents retry failed tool calls fast and repeatedly, which is exactly what extends a block. The README has a section and a runnable example for that case.
I built it after a hobby tool against the Steam Community Market got blocked: retrying during an active block kept extending it, and a block that should have lasted minutes ran for hours. It's v0.1: in-memory, single process, MIT, no dependencies, 14 tests. Not production-hardened for multi-worker setups yet.
COMPARISON
Libraries like ratelimit or django-ratelimit throttle how fast you call out (e.g. max 10 calls/second). tenacity and backoff retry a failing call with a delay. BlockGuard does neither: it remembers that a block is active across calls and tells you not to send the request at all until the cooldown ends. You can use it alongside them.
AI disclosure: built with Claude Code. The design came from a real rate-limit incident in my own project, and I reviewed and tested it.
r/madeinpython • u/PanelReader • 13h ago
I've been learning how neural networks work, especially the mathematics behind training.
To understand the process better, I implemented a small XOR network using Python and NumPy.
Here's what I worked on:
Architecture: Used 2 inputs, 3 hidden neurons with ReLU, and 1 sigmoid output.
Forward propagation: Used matrix multiplication to calculate the hidden layer and output values.
Loss: Used Mean Squared Error (MSE) to measure prediction errors.
Backpropagation: Applied the chain rule to calculate gradients for all weights and biases.
Gradient descent: Updated the parameters using a learning rate of 0.05 for 5,000 epochs.
Verification: Compared all 13 analytical gradients with numerical gradients using finite differences.
Results:
- Final MSE: 0.004715
- Correct predictions: 4/4 on the XOR training data
- Added automated checks for training and gradient calculations
The main goal was to understand how matrix operations, derivatives, and parameter updates work together.
GitHub: https://github.com/Vaibh37/Neural-Network
Technical feedback is welcome.
Note: before anyone starts a war in the comments, yes, i used ai to help structure this post. the mathematics, implementation, and testing are my own work. i understand the code and ran everything on my machine. ai helped with the writing.
r/madeinpython • u/PythonWithJames • 15h ago
Hi all, I run: Python With James and I've just released a ton of new coding challenges if anyone wants to give them a go? I'm aiming to put the site as a step below Leetcode in terms of challenge level, so it's a bit more beginner friendly.
Would love some feedback :)
r/madeinpython • u/titojff • 21h ago
r/madeinpython • u/undercover_fts • 22h ago
A while back I wanted to run a news channel on YouTube Shorts, then did the math on editing even one 30-second video by hand every day and gave up on that idea within a week. So I wrote a pipeline that does the whole thing instead. It's now about 7.8k lines of Python, 9 channel profiles, and a Telegram bot I use to approve videos from my phone.
What it does
Topic -> script (via a research tool of mine, with Google News RSS as a fallback) -> text cleanup -> voice (edge-tts, gTTS as backup) -> 1080×1920 video -> upload to YouTube. Frames are drawn with Pillow and piped as raw RGB straight into ffmpeg's stdin, so there are no temp PNGs on disk. Subtitles are karaoke-style with highlighted words.
A few things I'm weirdly proud of (or at least learned the hard way)
- A scheduler that works while my PC is off. The video gets uploaded as private with publishAt, and YouTube publishes it at the right time even if my machine is shut down by then. Weekends extend the buffer window because the PC sleeps.
- Trimming scripts from the middle, not the end. Cutting by length killed the closing question and the call to action, which is exactly what holds viewers. Now the first and last two sentences stay, and the middle gets dropped.
- Stock photos lie. Searching Pexels for "saturn planet" gave me a neon sign. "Venus planet" gave me a sunset with a crescent moon. For the space channel I switched to the NASA image library and wrote a filter for maps, diagrams, and greyscale raw frames.
- TTS reads exactly what you give it. Footnote markers like [1], big numbers, and Latin words in Russian text all sound awful, so the text preprocessor ended up bigger than I expected.
The honest part
Making the videos turned out to be the easy part. Getting people to watch them is not. My first 19 Shorts on the space channel were bimodal: either ~1,100–1,500 views, or 1–61. Nothing in between. After digging into it I rebuilt the format: hook visible from frame 0, hard cuts in the first 3 seconds, shorter scripts, one video a day. I haven't got enough data on the new format yet to tell you if it works, so I won't pretend I do.
I also don't have many tests (a fthe hook logic), and channels.py
has more copy-paste than I'd like
Who this might help
Anyone who has wired Pillow to ffied to schedule YouTube uploadsfrom a machine that isn't always on.
Repo MIT https://gittub.com/kuanysh228/autoy
I'd love feedback on the architecAt buffer approach, or if someonehas dealt with Shorts retention better than I have. Happy to answer questions.
r/madeinpython • u/ag3ntsc4rn • 1d ago
r/madeinpython • u/SignificantGlass7040 • 1d ago
Most Python file-transfer examples use TCP, so I built the other side: reliability implemented by hand on top of UDP sockets.
What is inside:
Benchmark result at 20% simulated packet loss: the sliding window moves about 2.4x the throughput of stop-and-wait.
Source: https://github.com/askmeanythin/Reliable_UDP_File_Transfer - feedback welcome!
r/madeinpython • u/Low-Alternative-6604 • 1d ago
**What My Project Does**
Pupovina is a PyQt6 desktop GUI for [gnirehtet](https://github.com/Genymobile/gnirehtet): it lets an Android phone use the computer's internet over a USB cable, without root. The app downloads gnirehtet and adb (SHA-256 verified), lists connected phones with real-time speed and traffic, starts or stops the tunnel per device, can auto-start on plug-in, and lives in the system tray with notifications. UI in English, Italian and Russian.
**Target Audience**
People who need wired internet on their phone (broken mobile network, no Wi-Fi, office PCs on Ethernet) and don't want to use the terminal. It's meant for daily use, not as a toy project. Windows and Linux builds are produced with PyInstaller and GitHub Actions (.exe and AppImage).
**Comparison**
gnirehtet itself is CLI-only. Other GUIs exist; this one focuses on several devices at once with live per-device traffic, autorun, process cleanup and adb self-update.
Repo: https://github.com/Dmitrij-Anatolievic/pupovina (Apache 2.0)
(The name is Russian for "umbilical cord": the cable that feeds the phone.)
r/madeinpython • u/TerrorGandhi69 • 1d ago
Given two images, a human eye can find the similarities between them by recognising the distinct features.
To a computer, those images are just two big grids of numbers from 0 to 255.
So how does it find the match? My new blog shows this in Python code using OpenCV. Check it out:
#ComputerVision #OpenCV #Python #ImageProcessing
r/madeinpython • u/stlynnxx • 1d ago
Hello!
This is dwnloaderr, my yt-dlp wrapper. :) It can be ran from the terminal or with cross platform GUI helpers! It should work with a wide array of websites as it is utilizing yt-dlp, and has build in customization options and support for playlist downloading. :)
If you like it leave a star! Thanks!
r/madeinpython • u/PanelReader • 2d ago
hey everyone!
recently built a 2 → 3 → 1 XOR neural network using just Python and NumPy, without any deep learning frameworks.
implemented backpropagation and gradient descent manually, trained it for 5,000 epochs, and got all four XOR combinations correct.
also documented the mathematics, added 12 editable diagrams, and published a detailed Medium article explaining the process.
GitHub: https://github.com/Vaibh37/Neural-Network
would appreciate feedback, and if you find the repo useful, consider starring it 🍀
r/madeinpython • u/amaarx • 2d ago
r/madeinpython • u/ScallionNo2755 • 3d ago
r/madeinpython • u/Intelligent_Rice7138 • 3d ago
r/madeinpython • u/OkMonitor8069 • 3d ago
r/madeinpython • u/xanthium_in • 3d ago
I made this Python Matplotlib Plotting tutorial for beginners.
Source codes can be downloaded from the link below
The tutorial is designed for beginners who want to learn Matplotlib for building Data Acquisition and Data Logging applications using Arduino, Raspberry Pi, and other embedded systems. Learn how to create a Line Graph using Python and Matplotlib for visualizing data coming from an Arduino, Raspberry Pi, or other Embedded Systems.
Things Covered in This Video
By the end of this tutorial, you will have a better understanding of how Matplotlib works and how its different components can be used to create customized line graphs.
r/madeinpython • u/Material-Switch5380 • 4d ago
Hi everyone,
I'm pretty new to programming, and this is the biggest thing I've built so far, so I wanted to share it and hopefully learn from your feedback.
**What it does**
Log Guard is a command-line tool that scans log files (and .xlsx spreadsheets) and masks emails, phone numbers, API keys, IP addresses, and credit card numbers before you share them with someone. It runs completely locally and never touches the network. I built it because the online "paste your log here to clean it" tools kind of defeat the purpose when you're uploading the sensitive stuff to someone else's server.
pip install logguard-cli
log-guard server.log
That writes a server.masked.log next to the original. There's also a --check mode that exits with code 1 if it finds anything, so it can be used as a pre-commit hook or in CI.
GitHub: https://github.com/apurvaraj9/log-guard
**What I learned along the way**
I'd used git on a handful of smaller projects before, but this is the first one I took all the way from "script on my laptop" to something other people can install. Along the way, I learned:
- writing tests with pytest (67 of them now) and running them automatically on GitHub Actions across Python 3.9 to 3.12
- packaging and publishing to PyPI. The name log-guard was already taken, and so were about ten other names I tried, so it ended up as logguard-cli
- doing a practice release on TestPyPI first, because PyPI never lets you re-upload the same version number
- adding Excel support in v0.2.0, which turned out to be a lot more than adding "xlsx" to a list, since .xlsx files are actually zip files full of XML
**Being upfront**
I used an AI assistant (Claude) while building this. It wrote some of the code, and I worked through every step myself: running it, testing it, debugging when things didn't match what I expected, and learning what each part does. I'm sharing it because I'd like real people to look at it and tell me what's wrong.
**Where I'd love feedback**
- the detection is regex-based, so if you can spot false positives or things it misses, please tell me
- the code is all in one file. Is that bad at this size?
- anything about the tests, packaging, or README that looks off
Since this is my first project at this scale, I'm sure I've made mistakes. Please point them out. I'm genuinely happy to understand what I got wrong and make it better.
Thanks for reading!
r/madeinpython • u/Creepy_Sherbert_1179 • 4d ago
Enable HLS to view with audio, or disable this notification
r/madeinpython • u/xanthium_in • 4d ago
The tutorial is designed for beginners who want to learn Matplotlib for building Data Acquisition and Data Logging applications using Arduino, Raspberry Pi, and other embedded systems. Learn how to create a Line Graph using Python and Matplotlib for visualizing data coming from an Arduino, Raspberry Pi, or other Embedded Systems.
Things Covered in This Video
By the end of this tutorial, you will have a better understanding of how Matplotlib works and how its different components can be used to create customized line graphs.
r/madeinpython • u/Pristine_Fish_9619 • 4d ago
here is my self-made python module. for all the pocket option users.
r/madeinpython • u/TrainingVisual9917 • 4d ago
I made an online python interpreter that can run your python code online without downloading anything.
Features:
\- supports matplotlib (pyodide engine)
\- material design (cuz i like it)
\- supports exporting your files
\- has layouts for mobile and desktop
\- Code highlighting
\---
I built it mainly focused on mobile since python is kinda messed up in phones and other web apps have weird ui.
Site link: https://pypad-bay.vercel.app
(I used AI to build js and work with material design, the idea and implementation was mine. I test every change before publishing)
GitHub repo: https://github.com/chomuloll69-oss/pypad
r/madeinpython • u/False_Actuator_6236 • 4d ago
r/madeinpython • u/FarPut5833 • 4d ago
hey everyone! recently built a terminal tool that turns github issues into timed coding quests with rpg progression.
it can detect and automatically open your ide. currently supports vs code and cursor.
written in python and uses a github repo scoped token and a gemini api key. it follows a byok approach and i'm planning to add support for more models.
docs: https://runedocs.vercel.app
would appreciate it if you checked it out. feedback and suggestions are welcome!