11 Underrated Python Libraries Every Developer Should Explore
This article highlights eleven lesser‑known Python packages—from date‑time handling with Delorean to Bayesian analysis with PyMC—providing concise code examples and practical tips that can enrich the toolkit of both novice and seasoned developers.
There are now so many Python packages that almost no one can master them all; PyPI alone lists 47,000 packages. Many data scientists switch to Python for pandas, scikit‑learn, and NumPy, but miss some older yet useful libraries. This article introduces several obscure libraries that even experienced Python developers may not have encountered.
1) delorean
Delorean is a very cool date/time library, arguably the most natural date/time munging library the author has used in Python, similar to JavaScript's moment. Documentation is good and it often draws people back for reference.
from delorean import Delorean
EST = "US/Eastern"
d = Delorean(timezone=EST)2) prettytable
PrettyTable, once listed on Google Code, remains a powerful and attractive way to produce tabular output in terminals or browsers. It works well for IPython notebook extensions and can be used for HTML repr output.
from prettytable import PrettyTable
table = PrettyTable(["animal", "ferocity"])
table.add_row(["wolverine", 100])
table.add_row(["grizzly", 87])
table.add_row(["Rabbit of Caerbannog", 110])
table.add_row(["cat", -1])
table.add_row(["platypus", 23])
table.add_row(["dolphin", 63])
table.add_row(["albatross", 44])
table.sort_key("ferocity")
table.reversesort =3) snowballstemmer
SnowballStemmer is a small, elegant library that works in 15 languages and includes a Porter stemmer.
from snowballstemmer import EnglishStemmer, SpanishStemmer
EnglishStemmer().stemWord("Gregory")
# Gregori
SpanishStemmer().stemWord("amarillo")
# amarill4) wget
The wget module brings the power of the classic web‑crawler tool into Python, allowing recursive site downloads, image grabbing, and cookie‑free fetching. It is easy to use and works on Linux and macOS, though some users prefer from sh import wget.
import wget
wget.download("http://www.cnn.com/")
# 100% [................................................] 280385 / 2803855) PyMC
PyMC is a Bayesian analysis library featured in the book "Bayesian Methods for Hackers" and widely referenced in data‑science blogs, yet it does not receive the same attention as scikit‑learn.
from pymc.examples import disaster_model
from pymc import MCMC
M = MCMC(disaster_model)
M.sample(iter=10000, burn=1000, thin=10)
[-----------------100%-----------------] 10000 of 10000 complete in 1.4 sec6) sh
The sh library lets you import shell commands as Python functions, handy for simple bash tasks within scripts.
from sh import find
find("/tmp")
/tmp/foo
/tmp/foo/file1.json
/tmp/foo/file2.json
/tmp/foo/file3.json
/tmp/foo/bar/file3.json7) fuzzywuzzy
FuzzyWuzzy, built by developers at SeatGeek, provides fuzzy string matching utilities such as ratio and token sort ratio, useful for feature engineering or record linkage.
from fuzzywuzzy import fuzz
fuzz.ratio("Hit me with your best shot", "Hit me with your pet shark")
# 858) progressbar
ProgressBar offers a simple way to add progress bars to long‑running scripts, improving user feedback even though it is not a core data‑science tool.
from progressbar import ProgressBar
import time
pbar = ProgressBar(maxval=10)
for i in range(1, 11):
pbar.update(i)
time.sleep(1)
pbar.finish()
# 60% |########################################################|9) colorama
Colorama makes terminal text coloring easy; just import it and wrap any string you want to color.
10) uuid
The built‑in uuid module generates universally unique identifiers (versions 1, 3, 4, and 5), useful for ensuring uniqueness in marketing campaigns, email tracking, or any situation requiring distinct IDs.
import uuid
print uuid.uuid4()
# e7bafa3d-274e-4b0a-b9cc-d898957b4b6111) bashplotlib
Bashplotlib, the author’s own project, can plot histograms and scatter plots directly from standard input, offering a novel way to beautify logs even if it won’t replace ggplot or matplotlib.
$ pip install bashplotlib
$ scatter --file data/texas.txt --pch xThese Python libraries can help improve your development workflow.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
