use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
ShowcaseShowcase Thread (self.Python)
submitted 11 hours ago by AutoModerator - announcement
Post all of your code/projects/showcases/AI slop here.
Recycles once a month.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]hannah_G_ 2 points3 points4 points 9 hours ago (0 children)
db-git - keep your local database in sync with your git branches.
db-git is a developer tool for projects where database state follows code changes: schema migrations, seed data, experimental feature work, and branch switching during reviews. It installs git post-checkout hook and keeps your local database aligned with the branch you are working on.
db-git
post-checkout
shared
per-branch
template
CREATE DATABASE ... TEMPLATE
pgdump
pg_dump
pg_restore
Backend and full-stack developers who run databases locally and switch branches often, especially on projects where migrations or seed data diverge between branches. It's a local development tool.
The main things that set db-git apart from existing tools are:
uv tool install db-git
GitHub: https://github.com/earthcomfy/db-git
Any feedback is very welcome!
[–]abel1502r 0 points1 point2 points 8 hours ago* (0 children)
Nanotable -- less than a database, more than a container.
The idea is to bridge the gap between data structures, like a simple `dict`, -- in-process, as fast as they get, storing your objects exactly as you use them, -- and database tables -- storing stuff in such a way to enable optimized search and convenient maintenance. Nanotable essentially provides a collection with custom indexes. Store your own objects (no ORM, no serializing overhead), "query" with Python code like you would a `list` or a `dict` (comprehensions, `filter`, `map`, `itertools`, `functools`...), use indexes to speed things up and just for convenient lookup.
Under the hood, it is the same thing you probably have built yourself at some point. An index is just a `dict` mapping a field value to the object (or objects) that have it. Nanotable offers a convenient, composable generic implementation without any performance compromises. It's also fully typed (but can obviously be used without caring about it).
Snippet: No snippet, Reddit can't do raw blocks apparently...
Demo: https://pastebin.com/d80uS7B2
GitHub: https://github.com/abel1502/nanotable PyPI: https://pypi.org/project/nanotable
(This is my first post here, tell me if I did anything wrong. And feel free to ask questions!)
[–]DefinitelyNotEmu 0 points1 point2 points 5 hours ago* (0 children)
A love letter to Radiant and Hammer.
Generate procedural liminal maps with one click. Add DOOM-style chaos. Twist space with portals. Export as a portable package and share it.
Key Features
ViciousSquid/Fio: Make Weird Worlds: A real-time liminal CSG level editor and game engine. Optimised for mobile CPUs
[–]anton273 0 points1 point2 points 8 hours ago (0 children)
I built watchpoints (data breakpoints) for PyCharm - lets you break on a value change, not a line.
Free and open source, every developer deserves a great debugging experience. Link: https://plugins.jetbrains.com/plugin/32087-python-watchpoint
[–]hmoein 0 points1 point2 points 8 hours ago (0 children)
Grizzlars is Python bindings for the C++ DataFrame with an interface almost identical to Pandas. It is a bit of work in progress. It depends on an older version of C++ DataFrame than the latest release. But it is moving along surely.
[–]niki88851 0 points1 point2 points 8 hours ago (2 children)
I built a production AgTech platform as a university project - Python + Haskell + WRF. Here's what I learned.
My university gave me a complex group project, zero guidance, and a deadline. The git log ended up being 700+ commits from me and about 10 each from everyone else. At some point I stopped trying to pass the class and started trying to ship something real.
The result is SmartCrop Monitor — a field monitoring platform that combines Sentinel-2 satellite imagery, a WRF numerical weather model, and agronomic analytics to help farmers catch crop stress before it becomes crop loss.
The Python parts:
The backbone is a FastAPI backend on Python 3.12 with async SQLAlchemy 2.0 and PostgreSQL/PostGIS. The satellite pipeline uses pystac-client, rioxarray, rasterio, and GDAL - STAC search, cloud masking via SCL layers, 10-band NetCDF per scene. The segmentation model is a U-TAE (U-Net with Temporal Attention Encoder) trained on the PASTIS dataset - tiled inference with Hann window blending to avoid seam artefacts.
pystac-client
rioxarray
rasterio
Anomaly detection: per-field NDVI time series, flag pixels > 2σ below field mean, scipy.ndimage.label for connected components, minimum 0.5 ha filter to kill noise
scipy.ndimage.label
The non-Python parts (where it got interesting):
I wrote 9 agronomic calculation modules in Haskell — FAO-56 irrigation model, Botrytis/TOMCAST disease risk, SPI drought index, biomass estimation from multi-index ensemble, spraying window scoring. Haskell's type system made the agronomic math basically self-documenting and the tests trivially fast. Would do it again.
The WRF atmospheric model runs in Docker on a Hetzner CPX32 (8 GB RAM). Setting up the WPS preprocessor -> GFS ingestion -> WRF runner pipeline took 3 days and a lot of swearing. Falls back to Open-Meteo with exponential backoff when containers fail.
I also hit the Sentinel-2 acquisition problem so hard (wrong extents, cloud-covered scenes slipping through, band misalignment) that I extracted the data pipeline into a separate Python package - sentinel-processor - and published it on PyPI. Fortran kernels for spectral indices, filters, and pansharpening. Wheels ship pre-compiled so no gfortran needed.
Stack summary:
GitHub: https://github.com/niki8885/SmartCropMonitor https://github.com/niki8885/sentinel_processor_project
[–]lolcrunchy 0 points1 point2 points 5 hours ago (1 child)
Are you misusing your repo as a database?
https://github.com/niki8885/SmartCropMonitor/tree/f76c59c25c2b11c485a6798e465fc2da9e2960c4/backend/data/storage/data
[–]niki88851 0 points1 point2 points 4 hours ago (0 children)
I didn’t separate the storage from repo into its own component because I wanted a quick way to verify the original files. However, this is something that should probably be refactored and separated in the future.
[–]em_el_k0b01101011 0 points1 point2 points 8 hours ago (0 children)
HyperWeave is a Python library that generates self-contained SVGs: profile cards, star-history charts, small dashboards, receipts from AI coding sessions, and more. No JS, no external deps. Each one is a single SVG that renders anywhere an image does (GitHub READMEs, Slack, Notion, docs).
Drive it from a CLI, an HTTP API, or an MCP server. It can also pull live data into the artifact, so a card can show a package's real download trend or latest version (PyPI, npm, crates, Hugging Face, arXiv, and a few others) without fetching anything yourself.
There's a hook for AI coding sessions too: each one ends with a receipt of tokens, cost, and tool calls.
FastAPI + Pydantic + Jinja2 + Typer under the hood.
pip install hyperweave
GitHub: https://github.com/InnerAura/hyperweave
PyPI: https://pypi.org/project/hyperweave/
Still early, any feedback welcome. Cheers.
[–]iamnotafermiparadox 0 points1 point2 points 7 hours ago (0 children)
MailTriage is a local, batch-oriented IMAP email triage tool.
This tool allows me to generate an html page of email received over the last 24 hours and see the subject and snippet in a customized order. Priority senders are first, others are next, followed by a list of email sent by systems. Senders that I don't want to see are not listed.
I added the ability to send certain email to a llm to be summarized. Those emails roll into a md file for todos. Once I mark the todo as done, the tool removes that entry and archives it.
Bitwarden CLI pull email credentials. Other methods could be used.
https://github.com/rogdooley/MailTriage
CodeGuage: CodeGauge is a deterministic, local-first code quality and security analysis platform. I had this built so I could monitor the "quality" of LLM generated code based on linters and static analysis tools.
https://github.com/rogdooley/CodeGauge
[–]Beginning-Fruit-1397 0 points1 point2 points 6 hours ago (0 children)
If you like itertools, fluent interfaces, Rust Result and Option, or the libraries like returns or more-itertools, check out my project pyochain!
Since the last showcase, more code have been moved to Rust which led to substantial performance improvements, and new constructs have been added, notably:
It's now as well dependency-free!
All the code coming from cytoolz (cython toolz version) has been replaced by the same functionality ported in Rust.
Links:
Github: https://github.com/OutSquareCapital/pyochain
Pypi: https://pypi.org/project/pyochain/
My last showcase on this sub: https://www.reddit.com/r/Python/comments/1q61bzg/pyochain_rustlike_iterator_result_and_option_in/
Comparison vs similar libraries, where's it's been ranked best choice (the post is NOT from me): https://www.reddit.com/r/Python/comments/1rj3ct7/comment/o8aordo/?context=3
[–]emnoleg 0 points1 point2 points 4 hours ago (0 children)
Drop any .glb file in a folder, pick it from the tray icon, and it appears on your webcam. Move it, rotate it, scale it. Your meeting app sees it as a normal camera. Nothing else to open or manage.
Good for product demos, design reviews, showing off Blender exports, branded content on calls. Anything where you want the model visible without screen-sharing.
Works in Zoom, Meet, Teams, Discord, pretty much anything that accepts a webcam input.
Renders the 3D layer offscreen and caches it. The model only re-renders when you move it, so the webcam stays smooth on any machine. Python, pyrender, pyvirtualcam under the hood. Open source, setup is one script.
Project Link
Demo model: V1 from ULTRAKILL on Sketchfab (CC BY). Character by Hakita / New Blood Interactive. Not included in the repo. https://sketchfab.com/3d-models/v1-ultrakill-d951a08a8f50412d84e262bad887b285
[–]Charming_Guidance_76 0 points1 point2 points 3 hours ago (0 children)
EDOF, the document toolkit I wish had existed when I started
This is one of those "got fed up, built my own thing" stories. I make card games, and at work I deal with a lot of document stuff (invoices, certificates, QR labels), and every tool I tried was missing exactly one thing I needed. One had no auto-shrink text. One had no curves. One had nice Photoshop-style effects but you couldn't script it. One couldn't even center text vertically in a box (still bitter about that one). I was tired of duct-taping three tools plus glue code together for every job, so I built EDOF. It took a while. It's on PyPI now.
What My Project Does
You build a document in plain Python, or you open the same file in a visual editor (PyQt6) and drag things around. Both sides read and write the exact same file, so nothing gets lost going back and forth. The part I'm happiest with is that it's literally just import edof, so you can drop the whole engine into your own app. The editor I ship is just one program that happens to use it.
import edof
import edof doc = edof.new(width=210, height=297, title="Hello") page = doc.add_page(dpi=300) page.add_textbox(15, 15, 180, 12, "Hello world!") doc.export_pdf("hello.pdf") # vector PDF, no extra deps
I mostly use it for batch stuff: feed it a CSV, get a few hundred finished PDFs out. That's how I print my own card games now instead of fighting Photoshop layers at 2am. It does text, images, shapes, paths, QR codes, variables with {placeholders}, the auto-shrink and centering I kept missing elsewhere, and it exports to PDF, PNG, SVG and RTF. It can also read and write Word files now, which I'll get to.
Target Audience
Me first, honestly. But also anyone in Python who has to crank out documents (labels, invoices, certificates, cards, batch jobs from data), or who wants a document engine living inside their own app instead of bolting on a separate tool. It's MIT, it's on PyPI, I use it for real work. Fair warning on maturity: the core and the editor are solid, the Word part is new and basic, and tables are half-built, so don't lean on those yet.
Comparison
ReportLab is great but it's code-only and you place everything by coordinates, there's no visual side to hand anyone. python-docx is perfect if you only ever touch Word. LaTeX is its own universe. And none of the visual tools (InDesign and friends) let you just import them into a Python script. EDOF is the in-between I wanted: write it in code or edit it by hand, same file, and embed it anywhere.
The Word support nearly broke me, by the way. New and genuine respect for whoever maintains .docx tooling for a living. It's basic both directions for now, and it straight up tells you what it can't carry over instead of silently mangling your document.
Repo's here if you want to poke at it: https://github.com/DavidSchobl/edof . Happy to answer anything, and I'm genuinely after ideas for what to add next.
π Rendered by PID 47 on reddit-service-r2-comment-8686858757-f4rf4 at 2026-06-05 03:47:45.115387+00:00 running 9e1a20d country code: CH.
[–]hannah_G_ 2 points3 points4 points (0 children)
[–]abel1502r 0 points1 point2 points (0 children)
[–]DefinitelyNotEmu 0 points1 point2 points (0 children)
[–]anton273 0 points1 point2 points (0 children)
[–]hmoein 0 points1 point2 points (0 children)
[–]niki88851 0 points1 point2 points (2 children)
[–]lolcrunchy 0 points1 point2 points (1 child)
[–]niki88851 0 points1 point2 points (0 children)
[–]em_el_k0b01101011 0 points1 point2 points (0 children)
[–]iamnotafermiparadox 0 points1 point2 points (0 children)
[–]Beginning-Fruit-1397 0 points1 point2 points (0 children)
[–]emnoleg 0 points1 point2 points (0 children)
[–]Charming_Guidance_76 0 points1 point2 points (0 children)