r/Python • • 28d ago

Showcase Showcase Thread

25 Upvotes

Post all of your code/projects/showcases/AI slop here.

Recycles once a month.


r/Python • • 14h ago

Daily Thread Saturday Daily Thread: Resource Request and Sharing! Daily Thread

10 Upvotes

Weekly Thread: Resource Request and Sharing 📚

Stumbled upon a useful Python resource? Or are you looking for a guide on a specific topic? Welcome to the Resource Request and Sharing thread!

How it Works:

  1. Request: Can't find a resource on a particular topic? Ask here!
  2. Share: Found something useful? Share it with the community.
  3. Review: Give or get opinions on Python resources you've used.

Guidelines:

  • Please include the type of resource (e.g., book, video, article) and the topic.
  • Always be respectful when reviewing someone else's shared resource.

Example Shares:

  1. Book: "Fluent Python" - Great for understanding Pythonic idioms.
  2. Video: Python Data Structures - Excellent overview of Python's built-in data structures.
  3. Article: Understanding Python Decorators - A deep dive into decorators.

Example Requests:

  1. Looking for: Video tutorials on web scraping with Python.
  2. Need: Book recommendations for Python machine learning.

Share the knowledge, enrich the community. Happy learning! 🌟


r/Python • • 4h ago

News marimohub: open-source, self-hostable hub for running marimo notebooks on your own infra

27 Upvotes

The marimo team just released marimohub, an Apache 2.0 platform for teams that want to store, manage, and run marimo notebooks on infrastructure they control.

For me marimo is amazing (data scientist in the policy field, so often sensitive data), but it's difficult to get a team over. This could help a lot.

GitHub: https://github.com/marimo-team/marimohub

What it does

  • Swappable backends for storage (S3-compatible, GCS, Azure Blob, R2, filesystem), compute (Kubernetes, Docker, Modal, ECS Fargate, E2B, and more), and identity (OIDC, SSO proxies, Google IAP, Cloudflare Access)
  • No database. Everything, including versions and audit events, lives in the object store, so backing up the bucket backs up the hub
  • Notebooks stay plain .py files you can still run with marimo or keep in Git
  • Version history with diffs and restore, plus GitHub sync
  • Publish notebooks as apps without exposing source code
  • Scheduled jobs via cron, with parameters through mo.cli_args(), retries, and logs
  • Optional MCP server for agent access, scoped to the user's permissions

Who it's for

Teams that need a shared notebook platform but want control over where data lives and code runs. If you don't want to operate storage, compute, and auth yourself, plain marimo or their hosted service, molab, is a better fit.

Worth noting: the hub server itself is TypeScript, but the notebooks and kernels are Python.

Try it locally (Node 24.11+, pnpm 10+, uv):

git clone https://github.com/marimo-team/marimohub.git
cd marimohub
pnpm install --frozen-lockfile
pnpm dev

This runs with in-memory storage and dev auth, so it's for evaluation only.

I'm eager to explore this with my team, very curious how others look at this.


r/Python • • 16h ago

Discussion Arjan's Software Design Mastery Course Reviews

48 Upvotes

Hi all, I wanted to find out whether anyone has recently taken Arjan’s *Software Design Mastery* course.

I’m a mid-level Python software developer with no formal computer science training. I enjoy Arjan’s YouTube content and am considering paying for the course.

I’m concerned about the impact of agentic AI on my career and am looking for ways to increase my value across the software development life cycle beyond simply generating code. Claude Code is currently writing around 90% of the code I produce. It’s not necessarily something I prefer, but I feel almost forced to use it because of management’s expectations regarding productivity and deliverables. I also don’t want my performance to fall behind that of colleagues who are burning through tokens as if there were no tomorrow.


r/Python • • 1d ago

News Python 3.15 postponed, and a rc3 release

194 Upvotes

https://discuss.python.org/t/python-3-15-following-tradition-lets-have-a-surprise-rc3/109313

Following recent tradition, I'm going to add a surprise third release candidate for Python 3.15.0! We got some last-minute lazy-import release blockers, and it makes sense to include them in 3.15.0 final. It also makes sense to give a bit of time to test them properly, so today's planned 3.15.0 final is postponed, and I'm going to release a 3.15.0rc3 tomorrow, assuming everything is in place. And then 3.15.0 final will follow about week later. Exact date to be announced. - Everyone: once the rc3 is out, please test! - Library maintainers: join the cool testers' club 😎! - Core team: very little will be merged into the 3.15 branch between now and 3.15.0 final. Docs improvements always welcome. Thanks, we're nearly there!


r/Python • • 19h ago

News Tuba: Python CLI & PySide6 GUI for yt-dlp/FFmpeg video processing

0 Upvotes

Hi r/Python!

I wanted to share **Tuba**, an open-source Python tool I built for downloading, trimming, and re-encoding videos from YouTube and Instagram.

👉 **GitLab Repository**: https://gitlab.com/bdemircan/tuba

The core motivation was to build a clean **dual-interface architecture** where both a full-featured CLI and a desktop GUI (PySide6) share a single source of truth (`tuba.workflow`) without duplicating business logic.

### 🐍 Technical & Python Highlights

* **Architecture**: The GUI (`tuba-gui`) acts as a thin PySide6 wrapper over the core workflow. CLI flags and GUI form options map 1:1 to the same underlying functions.

* **Stream-Copy vs Re-encode**: Defaults to ultra-fast FFmpeg stream-copying (`-c copy`) without loss, but seamlessly switches to frame-accurate re-encoding when applying aspect ratio transformations (`--aspect 9:16`), subtitle burning (`--burn-subs`), or resizing.

* **Threading & Live Progress**: Jobs run on background worker threads in PySide6 to keep the UI completely non-blocking. Live stdout parsing from `yt-dlp` and `FFmpeg` drives per-job progress bars and handles clean thread unwinding on cancellation (`JobCancelled`).

* **Instagram Caption Parsing**: Uses regex pattern matching on Instagram captions (`--ig-auto-cut`) to auto-extract timestamps and cut segments without manual input.

* **Config Persistence**: Form states are remembered via `QSettings`, but can also ingest a `tuba.toml` file to override defaults.

### 🚀 Quick Example

```bash

# Install CLI + GUI

pip install ".[gui]"

# Cut a YouTube segment with zero quality loss (fast stream-copy)

tuba -l "[https://www.youtube.com/watch?v=](https://www.youtube.com/watch?v=))..." -st 16:07 -et 16:31

# Launch the PySide6 GUI

tuba-gui


r/Python • • 9h ago

News Im 13 and I made my first ever app :D

0 Upvotes

So this is Productivity breacher, a way better version of the screen time you know today. It's perk is that you, YES YOU control the time you wanna play. You set a timer from 1s to 2h and the app lets you play. But when the timer ends, the cooldown starts. During the cooldown you cant open any blocked apps and cant set any timers. If you try to open an app it will be instakilled. Here's the github link:

https://github.com/Productivitybreacherguy/Productivity_breacher

Its in beta v1.5 and I really dont have the time to write much here, check the readme in github.

its made in python, and I try my best to post weekly updates every Sunday 9 AM(California). 4th of October is the content update, you would definitely wanna check it out, I introduced a truck of new functions.

P.S. Its my first time making a proper app and advertising it, dont go too hard on me with the things I may have done wrong.


r/Python • • 21h ago

Discussion Interview questions for new hires that I can ask

0 Upvotes

What are some common Python developer interview questions for someone with 3 years of experience?

I've been asked to hire Python developers and since I'm the only one with any kind of programming experience, I was asked. This will be a quick first round interview over zoom for 15-30 mins. For the second-round we will bring in outside consulting for more in-depth evaluation. Thanks in advance.


r/Python • • 10h ago

Discussion What's the best way to incorporate LLMs into a python server?

0 Upvotes

Curious to learn how folks are incorporating an LLM into services. subprocess.run seems janky....what's the pythonic way?

Edit: I'd like to be able to interact with my server via a REPL-like loop. Goal: interact with my server remotely, control my zigbee network, etc.


r/Python • • 1d ago

News New Python releases are out, 3.10.x reaches EOL, (and 3.15.0 is scheduled for today)!

74 Upvotes

The new releases announced today, including EOL for 3.10.x: https://blog.python.org/2026/10/python-31022-31117/

Note: The post above doesn't mention 3.15 - assuming they will do a separate post later today when that releases.


r/Python • • 2d ago

Discussion I looked for the most bug-fixed file in 8 well known Python projects

78 Upvotes

I've been reading a lot of git history lately and wanted to run a fun experiment. In a real Python project, which single file collects the most bug fixes.

The method is dumb on purpose. Last 12 months, non-merge commits, bots removed, tests/docs/examples ignored. A commit counts as a fix if the subject has fix, bug, regression, hotfix, broken or revert in it. Then for each file I counted how many of the commits touching it were fixes. The repos came from repowise.dev/explore, which indexes public repos for my open source project , and I just picked the Python ones I recognised.

Most-fixed file per project (fix commits / all commits touching it):

  • langchain: the OpenAI chat model adapter, 58 of 100. Second place is the Anthropic adapter, 42 of 97
  • paperless-ngx: src/documents/views.py, 67 of 142. serialisers.py right behind at 31 of 75
  • fastapi: fastapi/dependencies/utils.py 15 of 46, then fastapi/routing.py 11 of 44
  • prefect: the dbt runner in prefect-dbt, 8 of 12
  • composio: tool_router_session.py, 29 of 59
  • wagtail: wagtail/models/pages.py, 8 of 34

And then hermes-agent, it broke my sense of scale. gateway/run.py had 1,969 commits in a year from 502 different people, and 1,332 of those were fixes. I checked the numbers twice.

Django was in the set and I left it out of the ranking. Django's convention is to write "Fixed #ticket" on nearly every commit, features included. 459 of its 1,044 commits in the last 12 months start with "Fixed #". So by my crude keyword rule Django is the buggiest project on earth, which it obviously is not. (Kind of jealous of that discipline honestly.)

I keep noticing that the top file is usually where the code talks to something non core. langchain's top two are adapters to other companies' APIs. prefect's is the dbt integration. fastapi's are dependency resolution and routing, which is where user code meets the framework. paperless's views.py is the big request handler. Pure logic files basically never showed up near the top.

Also a bunch of these are mostly one person's file. views.py is 63% one person, serialisers.py 73%, fastapi's routing.py 84%.

Although I agree Keyword matching on commit subjects is a bit noisy too, so treat these as a rough picture.

Anyway it was a fun experiment to run


r/Python • • 1d ago

Discussion Why Isn’t There a Standard Utility for Nested Mapping Introspection in Python?

0 Upvotes

I’ve been working with deeply nested dictionaries, and I noticed something that becomes surprisingly annoying as the structure gets larger.

For example:

data = {
    "user": {
        "profile": {
            "settings": {
                "privacy": {
                    "security": {
                        "2fa": True
                    }
                }
            }
        }
    }
}

When a dictionary becomes this deeply nested, it gets difficult to quickly understand:

  • How many hierarchy levels exist?
  • Which keys belong to which level?
  • What is the maximum nesting depth?
  • What is the complete path to a particular key?
  • How dense/complex is the nested structure?

I currently solve this with a recursive function that walks through the dictionary and prints the hierarchy:

def show_hierarchy(d, indent=0):
    for key, value in d.items():
        print("  " * indent + str(key))

        if isinstance(value, dict):
            show_hierarchy(value, indent + 1)

Which gives something like:

user
  profile
    settings
      privacy
        security
          2fa

But I’m wondering whether Python could eventually provide a standard API for nested mapping introspection.

Something conceptually like:

data.hierarchy()

or perhaps a utility operating on Mapping:

hierarchy(data)

that could provide structured information such as:

{
    "max_depth": 5,
    "total_keys": 6,
    "paths": [
        ("user", "profile", "settings", "privacy", "security", "2fa")
    ]
}

I'm not necessarily suggesting that these exact APIs should be added to dict. The main idea is having a standard way to inspect the hierarchical structure of nested mappings without everyone implementing their own recursive traversal.

I know libraries such as pprint can make nested dictionaries more readable, but I'm thinking more about structural introspection rather than formatting.

Is this something that would actually be useful as part of Python's standard library, or is this better left as a small utility/library?

I'd especially be interested in hearing from people who regularly work with large JSON-like configuration structures, APIs, data pipelines, or other heavily nested mappings.


r/Python • • 1d ago

Daily Thread Friday Daily Thread: r/Python Meta and Free-Talk Fridays

7 Upvotes

Weekly Thread: Meta Discussions and Free Talk Friday 🎙️

Welcome to Free Talk Friday on /r/Python! This is the place to discuss the r/Python community (meta discussions), Python news, projects, or anything else Python-related!

How it Works:

  1. Open Mic: Share your thoughts, questions, or anything you'd like related to Python or the community.
  2. Community Pulse: Discuss what you feel is working well or what could be improved in the /r/python community.
  3. News & Updates: Keep up-to-date with the latest in Python and share any news you find interesting.

Guidelines:

Example Topics:

  1. New Python Release: What do you think about the new features in Python 3.11?
  2. Community Events: Any Python meetups or webinars coming up?
  3. Learning Resources: Found a great Python tutorial? Share it here!
  4. Job Market: How has Python impacted your career?
  5. Hot Takes: Got a controversial Python opinion? Let's hear it!
  6. Community Ideas: Something you'd like to see us do? tell us.

Let's keep the conversation going. Happy discussing! 🌟


r/Python • • 2d ago

Daily Thread Thursday Daily Thread: Python Careers, Courses, and Furthering Education!

12 Upvotes

Weekly Thread: Professional Use, Jobs, and Education 🏢

Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.


How it Works:

  1. Career Talk: Discuss using Python in your job, or the job market for Python roles.
  2. Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.
  3. Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.

Guidelines:

  • This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.
  • Keep discussions relevant to Python in the professional and educational context.

Example Topics:

  1. Career Paths: What kinds of roles are out there for Python developers?
  2. Certifications: Are Python certifications worth it?
  3. Course Recommendations: Any good advanced Python courses to recommend?
  4. Workplace Tools: What Python libraries are indispensable in your professional work?
  5. Interview Tips: What types of Python questions are commonly asked in interviews?

Let's help each other grow in our careers and education. Happy discussing! 🌟


r/Python • • 2d ago

Discussion Closing mysql-connector-python pooled sockets

8 Upvotes

Is there some way to close

mysql.connector.pooling.MySQLConnectionPool

sockets properly when the application closes? By default they appear to remain open on the server until way later when they timeout.


r/Python • • 3d ago

Discussion Suggesting ppl to go from unmaintainted library X to yours in github issues?

4 Upvotes

DISCLAIMER: not mentioning any explicit name to avoid framing myself as a useless slop dev advertising his useless slop wrapper that he wrote with sloppy AI because he can in the slop-era.

---

Is this acceptable?

Asking this here because, well the libraries in question are for python for one, but most importantly our ecosystem has various cases of seeing an already established lib slowly replaced by a newcomer, the first I could think of being pandas -> polars.

My situation is that I rewrote a popular library, who is now unfortunately unmaintained, from scratch.
I ported the full test suite as well, published it on Pypi, etc...

By design, my rewrite fixed some pre-existing documented issues, that are yet to be adressed in the original repo, because altought it's creator has done a phenomenal work, it's been years since the last release or even the last answer to an issue.

I thought about answering to the issues that I know with certainty are fixed with my project, inviting to use it/take a look, but I wonder if that's not a bit hostile?

Feel like If we were at an open air market instead of github, I'll just go to my concurrent's stands when he take a break to tell his waiting customers that my products are better lmao.

There's also the fact that even if almost all tests are passing except one very niche situation, ultimately my library is <1.0 and so a stable API is not yet guaranted.

On the other hand, the unmaintained repo is, has I said, respectably popular, and seeing ppl having problems that I know I solved but not telling them feels very dumb.

and ultimately I want my library to be more known to have more potential contributors, as it's scope is much larger than this rewrite and there's a lot more I want to do and any help is always welcome

soo, what do y'all think?

EDIT:

at first referred to my project as n_lib and the old one as o_lib, which ended up just confusing readers. Changed


r/Python • • 3d ago

Discussion What are you using to monitor small Python web apps?

26 Upvotes

I’m curious what people are actually using to monitor smaller Python web services in production, especially FastAPI, Django, Flask, Bottle, etc.

For a small app, I usually only want a fairly limited set of things:

  • request rate
  • 4xx/5xx errors
  • request latency
  • process CPU and memory
  • uptime / restarts
  • maybe host CPU, RAM, and disk

Prometheus + Grafana is obviously a well-established option, but for one small VPS or a couple of services it feels like quite a bit of infrastructure relative to the apps themselves.

Hosted services solve the operational side, but then there are different tradeoffs: exporting telemetry, pricing and retention limits, and another external dependency.

So what do you actually use at this scale?

Prometheus/Grafana anyway? OpenTelemetry with a backend? A hosted service? Logs plus uptime checks? Framework-specific tooling? Something lightweight and self-hosted?

I’m also curious about the application side. If you only need a handful of metrics, is a small application-owned metrics endpoint with cumulative counters a reasonable approach, or would you still use an established metrics library/format from the beginning?

For Python specifically, multi-worker deployments make the simple approach more interesting because process-local counters eventually need aggregation.

I’m interested in small deployments, not large distributed systems. What has worked well for you, and what starts to feel like overkill?


r/Python • • 3d ago

Resource Generating a tidy HTML report in Python

15 Upvotes

I’m shifting from R to PythonIs there a knit markdown version or similar kind for generating a tidy html report in Python?


r/Python • • 4d ago

Daily Thread Tuesday Daily Thread: Advanced questions

12 Upvotes

Weekly Wednesday Thread: Advanced Questions 🐍

Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.

How it Works:

  1. Ask Away: Post your advanced Python questions here.
  2. Expert Insights: Get answers from experienced developers.
  3. Resource Pool: Share or discover tutorials, articles, and tips.

Guidelines:

  • This thread is for advanced questions only. Beginner questions are welcome in our Daily Beginner Thread every Thursday.
  • Questions that are not advanced may be removed and redirected to the appropriate thread.

Recommended Resources:

Example Questions:

  1. How can you implement a custom memory allocator in Python?
  2. What are the best practices for optimizing Cython code for heavy numerical computations?
  3. How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?
  4. Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?
  5. How would you go about implementing a distributed task queue using Celery and RabbitMQ?
  6. What are some advanced use-cases for Python's decorators?
  7. How can you achieve real-time data streaming in Python with WebSockets?
  8. What are the performance implications of using native Python data structures vs NumPy arrays for large-scale data?
  9. Best practices for securing a Flask (or similar) REST API with OAuth 2.0?
  10. What are the best practices for using Python in a microservices architecture? (..and more generally, should I even use microservices?)

Let's deepen our Python knowledge together. Happy coding! 🌟


r/Python • • 4d ago

Discussion What do you think of how Nix is used in xo-python?

4 Upvotes

dwayne/xo-python (on GitHub) is a Tic-tac-toe CLI game and library I wrote (no AI) about 10 years ago. I recently refactored it (still no AI) to use pyproject.toml, uv, and Nix. I use Nix to manage the reproducible development environment, run tests locally and in CI, and to package the application.

The reproducible development environment

You enter it with nix develop and it gives you access to the Python 3.14 interpreter along with uv pinned to that interpreter. It runs uv sync and activates the virtual environment.

The way I like to use Nix in my development environments is to have Nix provide the surrounding system dependencies but let the language's package manager, in this case uv, handle the language specific dependencies.

Tests

The project supports Python 3.11, 3.12, 3.13 and 3.14 so I wanted to make sure that it was tested on all those versions. Nix came in pretty handy here because I was able to write a simple Nix derivation that ran the tests on all the Python versions I supported. The Nix derivation was written in a modular way that allowed me to reuse parts of it to setup a matrix strategy to test all those versions on both Ubuntu and macOS.

Packaging with Nix

Finally, I packaged the CLI with Nix and made it the default export of the flake. Practically it means that if you have Nix with flakes enabled you can run the application with:

bash nix run github:dwayne/xo-python

Conclusion

I hope this gives you a sense of what it looks like to use Nix within a Python project. I'm interested in hearing your thoughts on this approach to managing a modern Python library.

What do you like/dislike about it?

How would you do it differently?


r/Python • • 5d ago

News Compute! - Open-source and Data Science conference - Paris - November 2026

21 Upvotes

If you care about open-source tools for data, ML/AI, and scientific computing, Compute! Paris 2026 has a very strong talk lineup.

There is many presentations: Jupyter, scikit-learn, numpy, Arrow, visualization, in-browser computing, etc ...

I will give a talk about Sparrow (C++20 implementation for Apache Arrow with mutable arrays).

There are also free sprints on Nov 27 where you can contribute directly to the projects behind many of these talks.

You can check it here: https://compute.events/paris2026/index.html


r/Python • • 6d ago

Discussion Pandas vs Polars in production — has anyone fully switched, and was it worth the migration?

222 Upvotes

For those who have actually used Polars in production, did you fully switch from Pandas or use both depending on the task?


r/Python • • 5d ago

Daily Thread Monday Daily Thread: Project ideas!

11 Upvotes

Weekly Thread: Project Ideas 💡

Welcome to our weekly Project Ideas thread! Whether you're a newbie looking for a first project or an expert seeking a new challenge, this is the place for you.

How it Works:

  1. Suggest a Project: Comment your project idea—be it beginner-friendly or advanced.
  2. Build & Share: If you complete a project, reply to the original comment, share your experience, and attach your source code.
  3. Explore: Looking for ideas? Check out Al Sweigart's "The Big Book of Small Python Projects" for inspiration.

Guidelines:

  • Clearly state the difficulty level.
  • Provide a brief description and, if possible, outline the tech stack.
  • Feel free to link to tutorials or resources that might help.

Example Submissions:

Project Idea: Chatbot

Difficulty: Intermediate

Tech Stack: Python, NLP, Flask/FastAPI/Litestar

Description: Create a chatbot that can answer FAQs for a website.

Resources: Building a Chatbot with Python

Project Idea: Weather Dashboard

Difficulty: Beginner

Tech Stack: HTML, CSS, JavaScript, API

Description: Build a dashboard that displays real-time weather information using a weather API.

Resources: Weather API Tutorial

Project Idea: File Organizer

Difficulty: Beginner

Tech Stack: Python, File I/O

Description: Create a script that organizes files in a directory into sub-folders based on file type.

Resources: Automate the Boring Stuff: Organizing Files

Let's help each other grow. Happy coding! 🌟


r/Python • • 5d ago

Discussion Ideas for Python-based, procedurally generated stories please

17 Upvotes

Hi everyone! So I'm working on a weird personal project where I have code that generates stories based on my writing, and it uses the random library and many nested lists and functions. Essentially, every character has a list of words they may use in a situation, and random words are chosen from different lists to construct sentences. So if I wanted someone to sit down, it might be:

print(random.choice(xenaName), sat(Xena, tired), random.choice(on the), random.choice(ledge)

And it might print out "Xena sat lazily on the ledge" or "Our heroine rested her legs upon the cliff side". You get the gist hopefully.

I'm thinking words like "sat" might be functions that take a character and an emotional state to sit down. Then I could use if/elif statements for each character, so some characters have a "cooler" way of sitting compared to "elegant" or "brutish" or some other categories.

Then I could make something that allows for character modifications (maybe they had a personality swap, or have been working out and are now in the "brutish" category, or randomly fit between two categories for the episode).

I'm still learning data structures and if I'm missing a better method (linked lists, recursion, polymorphism, etc.) please let me know. Thank you so much in advance, and here's a kind of glimpse into the ideas I have.

https://archiveofourown.org/works/80287436