r/Python

Discover when a feature was added to Python
▲ 16 r/Python

Discover when a feature was added to Python

I made a tool to discover when a feature was added to Python.

It's online here and on PyPI as sincewhen.

You can look up a feature by name or paste code to look up all the features within it (that only works for code written using modern Python syntax).

That page shows some example feature story arcs that can be discovered with this.

I made this primarily as a teaching tool so I can better answer questions from my Python-learning students with a bit more historical context.

Note: I feel this qualifies more as a "resource" than a "showcase". I'm embracing EAFP over LBYL and hoping for the best. Call me out of I'm wrong here.

u/treyhunner — 5 hours ago
▲ 4 r/Python+3 crossposts

I built 3 open-source Python desktop utilities (Tkinter GUI) for PDF handling, Word conversion, and

Hi everyone! I created three small Python desktop applications with GUIs to handle everyday file tasks locally, keeping data private without needing online file converters.

1. JPEGenius (Batch JPEG Compressor)

  • What it does: Batch compresses JPEG images with customizable compression levels.
  • Features: Side-by-side visual preview (original vs compressed) with real-time KB/percentage savings, multithreaded processing with a progress bar, and automated log creation.
  • GitHub:https://github.com/Giacomo-Rosatelli/JPEGenius-python

2. Universal To Pdf

  • What it does: Multi-format document converter and merger into PDF.
  • Features: Converts images and text files into single or merged PDFs, merges existing PDF files, converts PDFs to DOCX, and automatically filters out system/executable files.
  • GitHub:https://github.com/Giacomo-Rosatelli/UniversalToPdf

3. PDF to DOCX Converter

Tech Stack: Python 3, Tkinter, Pillow, fpdf, pypdf, pdf2docx.

All projects are open-source under the MIT License. I would love to get your feedback on the code structure, UI, or any suggestions for improvements!

u/Giacomo-Rosatelli — 17 hours ago
▲ 4 r/Python+1 crossposts

Docling in databricks

Anyone used docling Parsing tool on databricks.

Me and my team started using this, though its a great tool. It has its own limitations. Example GILBERt issues happening here and there.

Any suggestions on to use databricks agent bricks ke free docling?

reddit.com
u/Agile-Bid4765 — 17 hours ago
▲ 269 r/Python

What are some Python automations you built for your life?

What Python scripts/projects did you built to use on a day to day basis? Or maybe someone else built it, but it’s useful for your personal life in some way

I think the “projects ideas” thread is really missing those useful opportunities

I myself thought about automating tax calculations, but still didn’t take the time to do it hah

reddit.com
u/gabriel_GAGRA — 3 days ago
▲ 0 r/Python

a tool to convert itunes backup to whatsapp

anyone know of a tool to convert whatsapp in a encrypted backup to something that can read messages like imazing. Where u can read everything, so far not much exists.

reddit.com
u/Ornery_Dealer5897 — 2 days ago
▲ 0 r/Python

How to bypass google captchas

Hello everyone. Hope you guys are doing great. Im currently stuck on my chrome automation project.

How to bypass google captchas through automation without signing

reddit.com
u/wannabeepsycho — 2 days ago
▲ 140 r/Python

What are some fun Python-heavy niches?

I going to try making a Discord bot in py. Pygame and Raspberry Pi intrigue me as well

Curious what other fun Py rabbit holes are out there that I don't know of!

reddit.com
u/IntentionAntique4751 — 4 days ago
▲ 0 r/Python

Writing the typing.Protocol before the class that satisfies it

When I pull an implementation out from behind a pile of call sites, I now write the typing.Protocol first and the class that satisfies it second. Define the seam, annotate the call sites against it, run mypy, and every place the current shape is wrong shows up before the new code exists. If the concrete class then inherits the protocol explicitly, mypy checks the implementation against it at the class definition, not only where it gets passed.

This feels Python-specific because duck typing usually leaves nothing to review. The implicit interface is whatever the callers happen to touch, spread over however many files. Writing it down turns it into something a colleague can read and disagree with before the work happens.

None of it is enforced at runtime. PEP 544 imposes no runtime semantics on protocol annotations, and even with u/runtime_checkable the typing docs say isinstance only checks that the named attributes exist, not their signatures.

It is cheap to try on one seam. The plan step in verdent works the same way, clarifying questions first and a plan you approve before any code is written. Nothing forces the protocol to change when the implementation does, so the two drift. Curious whether people keep the protocol next to the consumer or next to the implementation.

reddit.com
u/CodeCarnival-666 — 3 days ago
▲ 24 r/Python+1 crossposts

Composable, reusable WebSocket components for any ASGI framework (Django, FastAPI, Litestar)

Hi all, I'm the maintainer of a small channels (WebSocket) extension library for Django (and FastAPI too). While using and maintaining it, I started thinking it could become a small framework as well: composable and framework-independent, so it could be reused across Django/FastAPI/Litestar/... as long as the framework supports ASGI. Before going further, I'm putting the blueprint out here to compare notes with people who work with WebSockets regularly. If you have ever worked with WebSockets, I hope you can share any ideas, info, pain points, or suggestions you have.

Prerequisites, what my library already has:

  • Function-like handlers rather than while True + if/else
  • Automatic AsyncAPI doc generation
  • Full type hints
  • A testing kit
  • Support for all ASGI-based frameworks (Django, FastAPI, ...)

At a glance, it looks like this:

@ws_handler(output_type=ChatNotificationMessage)
async def handle_chat(self, message: ChatMessage) -> None:
    # Automatically routed, validated, and type-safe
    await self.broadcast_message(
        ChatNotificationMessage(payload=message.payload)
    )

@ws_handler
async def handle_ping(self, message: PingMessage) -> PongMessage:
    return PongMessage()  # Auto-documented in AsyncAPI

If you have ever worked with WebSockets, I think you get the idea of what it does here.

Recently I added the Topic feature, which is composable and reusable. It came out of a multiplexing feature request, and I was inspired by Phoenix Channels. It looks something like this:

class DiscussionTopic(Topic):
    pattern = "discussion:{pk}"

    async def authorize(self, pk: str) -> bool:
        return await user_can_view(self.scope["user"], pk)

    @ws_handler
    async def handle_reply(self, message: ReplyMessage) -> ReplyCreatedMessage:
        return ReplyCreatedMessage(payload=message.payload)

    @event_handler
    async def handle_new_reply(self, event: NewReplyEvent) -> ReplyCreatedMessage:
        return ReplyCreatedMessage(payload=event.payload)

And you use it like this:

class HubConsumer(AsyncJsonWebsocketConsumer):
    authenticator_class = JWTAuthenticator
    topics = [DiscussionTopic, RoomTopic]

In short, topics let you multiplex: subscribe, publish messages, unsubscribe, and so on, all over the same socket. So you can reuse a single WebSocket connection and just add or compose multiple topics, i.e. multiple WebSocket handlers.

That made me think: if we could create reusable topics such as Notification, Streaming, Voice, AI Agent, and so on, which users could easily install or copy and then modify or inherit from in a structured way, WebSocket handling would become much more structured and easier. The idea is similar to DRF and its ecosystem, and the composable/reusable part would work like shadcn: copy it, own it, and modify the code freely.

What would you use it for? As I mentioned above: notifications, streaming, voice, AI agents, and so on. I have done a lot of WebSocket work, and I keep having to redefine the same things over and over. There is no reusable approach like the ones we have for REST APIs. Another example is using Pydantic AI with the AG-UI protocol but over WebSockets, defined in a reusable way.

So, if you already know of an existing open source solution or library similar to this idea, it would be great if you could share it here. And if this resonates with you, a comment would help, both to add more insight and to give some encouragement to actually build this.

reddit.com
u/huygl99 — 4 days ago
▲ 12 r/Python

Sunday Daily Thread: What's everyone working on this week?

Weekly Thread: What's Everyone Working On This Week? 🛠️

Hello r/Python! It's time to share what you've been working on! Whether it's a work-in-progress, a completed masterpiece, or just a rough idea, let us know what you're up to!

How it Works:

  1. Show & Tell: Share your current projects, completed works, or future ideas.
  2. Discuss: Get feedback, find collaborators, or just chat about your project.
  3. Inspire: Your project might inspire someone else, just as you might get inspired here.

Guidelines:

  • Feel free to include as many details as you'd like. Code snippets, screenshots, and links are all welcome.
  • Whether it's your job, your hobby, or your passion project, all Python-related work is welcome here.

Example Shares:

  1. Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!
  2. Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.
  3. Automation: Automated my home lighting with Python and Raspberry Pi. My life has never been easier!

Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟

reddit.com
u/AutoModerator — 4 days ago
▲ 0 r/Python

Is Python an industry-ready technology for backends?

I mean specifically backend services, RESTful API's and very sensitive data in the DB. I mean middle-load (_not_ social networking, _not_ some purchasing platform for millions of users). How would you define your position that Python _is_ ready for that? E.g. in front of a mature Java backend developer? My line of defense is as follows. What are the weak points of Python code?

  1. Multi-threading (GIL-free is a very recent feature of python, cannot be considered even remotely industry-ready). This is probably the weakest point of all. But if the service has no data shared between API requests, why bother, right? Just spawn as many worker-processes as it makes sense for the current hardware setup and execute the requests one by one. Still, this is like one dimension less in the space of engineering possibilities, so to say.
  2. Dynamic typing means you have to run the whole CI/CD chain in order to find type system related errors. I really cannot find arguments against that point;
  3. This is true at least for banking sector. Libraries are developed by individuals (whereas in Java world there are companies behind some libraries). One would have a real hard time arguing with the management, that "those individuals are as qualified as those behind some company banner".

What is your take on the matter?

reddit.com
u/Zealousideal-Dig2093 — 6 days ago
▲ 0 r/Python

Other Python forums - Stack Overflow

Not sure if I am allowed to discuss other forums on here but I'm sure someone will tell me if not.

It is just me of has anybody else encountered problems with the 'moderators' on Stack Overflow Python forums recently? To say I've found them to be a self-righteous bunch of destructive power-crazy control-freaks would be a bit of an understatement. Anyone else had problems on there?

reddit.com
u/RomfordNavy — 6 days ago
▲ 0 r/Python

In the age of agentic coding what are you doing with your “human” tooling like uv, linters, etc?

Starting with uv, I’m a huge fan, but I find it actually gets in the way more than it helps when I’m doing agentic coding. I have to keep reminding the agent to use uv instead of pip.

Same issue with ruff, since I’m not coding with a regular ide I have to make extra prompts to force it to use ruff. But with today’s models being so good, it doesn’t even seem necessary.

Other tools fall into this category as well, but curious to hear how other others are approaching their tooling. Are you just throwing it all out or are you adding skills to keep your tooling in place?

reddit.com
u/carlinwasright — 7 days ago
▲ 5 r/Python

Saturday Daily Thread: Resource Request and Sharing! Daily Thread

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! 🌟

reddit.com
u/AutoModerator — 5 days ago
▲ 0 r/Python

Hypothesis: the Python library that kills PhDs

The three maintainers of Hypothesis (David MacIver, Zac Hatfield-Dodds, and Liam DeVoe) are on the latest episode of the Bug Bash Podcast talking about their work on property-based testing.

I'm biased (my company produces the podcast), but I found it both intellectually interesting and surprisingly emotional. Enjoy!

u/akshayjshah — 7 days ago
▲ 13 r/Python

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

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:

  • All topics should be related to Python or the /r/python community.
  • Be respectful and follow Reddit's Code of Conduct.

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! 🌟

reddit.com
u/AutoModerator — 6 days ago
▲ 82 r/Python

What do you love and dislike the most about Python? (beginners and long-time devs)

Hi! I'm really interested in Python's design and its tradeoffs. I'm trying to really understand what people love about Python (what makes it great), and what causes the most frustration for Python devs.

So what features do you really cherish and what problems/limitations really frustrate you?

I'm especially interested in experiences from ultra-beginners and people who've used Python for a long time. I know broad questions like this come across as super generic, but I'm genuinely interested in hearing about concrete experiences.

My goal is understanding which parts of Python's design are most valuable and most "adored" by the community, and which parts really aren't and frustrate people the most. My goal with this information is to identify meaningful problems. Right now I'm not trying to solve anything or sell a solution.

Thanks for your time!

reddit.com
u/horace_h — 9 days ago
▲ 2 r/Python+1 crossposts

How are you actually handling API abuse in FastAPI? Scrapers, credential stuffing, bots...

There's a lot of noise about this and almost no data. FastAPI ships no security layer, so everyone solves it somewhere: in the app, at the proxy, at the CDN, or not at all.

- What's actually in front of your API right now? nginx, Cloudflare, an API gateway, a rate limit library, middleware you wrote, nothing,...?
- Did you add it before or after something happened?
- What does it not do that you wish it did?

I'll collect whatever comes back here and publish the results.

If you'd rather answer privately: https://guard-core.com/survey

Thanks!

u/PA100T0 — 7 days ago
▲ 0 r/Python

Python in production

Hello everyone! For those of you who use Python in production, I have a few questions. I'm considering using Python for some services.

  1. Do you have high infrastructure costs?
  2. Have you ever regretted using Python?
  3. Would you recommend Python?

Context: My current use case isn't anything like Facebook or a massive-scale system. It's a small system, and I'm considering Python mainly because of the DX (developer experience).

I know C#, but I don't really like having to create a class in every file. I also know Rust, but all those ::, <>, and so on bother me. JavaScript is another option, but I've heard it's relatively heavy on RAM, and since the system is small, I'd like to be able to run it within 512 MB.

Another thing: I've defined a stack that I'd like to use wherever possible. If there's a library for desktop apps, great. A CLI library? Great. A bot library? Great. Let's use it! (Except for the frontend, which I'll keep using JS/TS for.)

Anyway, I'm open to advice and tips from more experienced developers. Feel free to tell me if you think using Python for my use case is a bad idea as well.

reddit.com
u/ze-fernando — 9 days ago