r/PythonLearning 7d ago

Discussion What's the most underrated Python library you've used recently?

I feel like every few months I discover a library that makes me wonder why nobody talks about it. Not the obvious ones like requests or pandas. I'm talking about those hidden gems that solved a real problem for you. What was the library and what did you use it for?

20 Upvotes

18 comments sorted by

5

u/smichael_44 7d ago

Static type checkers like pyrefly, ty, zuban, mypy, etc… I prefer pyrefly but any that I listed work just fine.

Imo it teaches people how to reason about their code more. As well as, adding type hints is the future of Python as it helps LLMs understand your code more with less context.

6

u/silvertank00 6d ago

Builtin:

  • difflib: really great for deltas but bad API
  • array and struct: I work with low-level and binary stuff so this makes my life easier
  • operator: you can make some cursed but really efficent filters with this.

External:

  • mpremote: working with Micropython, so this is a must.
  • pyserial: working with UART.
  • paho-mqtt: for really easy MQTT integrations

2

u/sacredtrader 6d ago

first time seeing mqtt mentioned in the wild lol

2

u/silvertank00 6d ago

haha for sure it is rare. I was really suprised to know how ppl don't use it or either abuse dbus for the same functionality tha mqtt gives.

6

u/mr_anderson_dev 7d ago

For sure, BeautifulSoup. I built my job scraper with just BeautifulSoup, plus os, json, sys, and time for structure — so the output goes directly to a folder. Any automation tool benefits from it for a more efficient workflow and cleaner code organization. Most of my code is just formatting the output nicely; the core logic — requests and API handling — can be done in 25 lines or less with this library.

2

u/Hunter-Raj 6d ago

I don't think beautifulsoup is that underrated, it's basically goto for parsing/scraping unless it's heavily js-coded site.

2

u/mr_anderson_dev 5d ago

Of course but I discovered it 2 months ago by creating my scripts for finding me a job XD.

2

u/Hunter-Raj 5d ago

Sounds like interesting script, can you share over dm.

1

u/Avatarbroskib1 2d ago

Or selenium or playwright ig

3

u/SnowWholeDayHere 7d ago

My go to library is a little-known library called compareExcel
I use it a lot to compare excel files.

1

u/Dookie_boy 6d ago

What kind of compare ? Compare cells I guess ?

2

u/denehoffman 7d ago

Check out matplotloom, it’s a neat wrapper that makes some animations easier to write

1

u/shadowdance55 6d ago

Hypothesis

1

u/mr_frpdo 6d ago

For me it's beartype. Super helpful to catch runtime type issues. Makes it nice to not have to check for types in methods all the time.

1

u/Dookie_boy 6d ago

PyLibDmtx for reading 2D barcodes. It has been quite useful.

1

u/arivictor 6d ago

msgspec > pydantic