Our great sponsors
-
ubelt
A Python utility library with a stdlib like feel and extra batteries. Paths, Progress, Dicts, Downloads, Caching, Hashing: ubelt makes it easy!
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
My ubelt library https://github.com/Erotemic/ubelt contains a collection of pure Python tools I've written over the years that I found to be highly reusable. The code and docs highlight a lot of what I've learned about Python in the last decade, and also where I think current stdlib features fall a bit short and they could use some extra batteries.
And then of course there's this insanity.
Typehints + mypy
Black for code formatting.
One thing that can help with making such a package is the mkinit package, which is what I use in ubelt to autogenerate code that explicitly exposes the entire public API at the top-level (although you can specify subsets of what to expose).
Also be careful not to put the kitchen sink in it, that's what happened with my first attempt at such a module. Try to avoid bringing in any non pure-python package. It's important to keep the dependency footprint small so its easy to include your utilities in larger projects. For tools dealing with specific bigger packages (e.g. numpy, opencv), either make a standalone utility for that package or perhaps you could incorporate it into the main package as an optional dependency. Just be careful of accumulating too much import-time cost.