The most interesting Python libs discovered in 2022

The most interesting Python libs discovered in 2022

· json · rss
Subscribe:

About

Ruff

The first one is in fact in PyPi, but written in Rust. Ruff is high-performant linter and it's a perfect replacement of Flake8, isort and pyupgrade. Instead of running linters separately now we have all-in-one solution that do the job in fraction of the time of other linters.


DiskCache

DiskCache is disk and file based cache library that uses SQLite behind the hood. It also provides a very convenient key-value interface to SQLite and can be used not as a cache, but as a disk-based key-value store. I started to use it like this in the URL Shortner Shortme.

Later in 2022 I started to use it for caching in AMBOSS. It's slightly slower then Redis in sets and comparable or even faster in gets. In AMBOSS Search DiskCache works extremely well with a few hundreds of gets per second.


Hashids

Hashids generates short, unique, non-sequential ids. In fact the algorithm is bidirectional and it doesn't use any sort of hash, instead encoded ids can be decoded into integers. Hashids is the perfect choice if numeric ids should be hidden.


ULID

ULID stands for Universally Unique Lexicographically Sortable Identifier. One of the Python implementations that I started to use is https://github.com/mdipierro/ulid. The cool thing about ULID that it's, of course, unique, has the size of UUID, it's URL safe and can be sorted in lexicographic order (by the time of creation).