After I was new to Python, I assumed I used to be doing nice with simply requests
, pandas
, and os
. However after constructing a couple of real-world apps—automating duties, parsing messy recordsdata, constructing CLIs—I spotted there have been so many cool libraries I had by no means heard of.
This put up is a mixture of my expertise and experiments with Python. Listed here are 5 unusual however extraordinarily helpful Python libraries that made my life simpler, my scripts shorter, and my code extra elegant.
Let’s discover them one after the other 🧭
What’s it?
Python’s built-in The logging
module works… however it is a bit painful to arrange. I used to copy-paste a 15-line config simply to jot down logs to a file. Then I discovered loguru
. One line, and also you’re good to go.
🧪 Instance:
from loguru import loggerlogger.add("app.log", rotation="1 MB") # Auto-rotating logs
logger.information("Script began")
logger.warning("This is perhaps an issue.")