banal1.0.6
banal1.0.6
Published
Commons of banal micro-functions for Python.
pip install banal
Package Downloads
Authors
Project URLs
Requires Python
Dependencies
banal
Commons of Python micro-functions. This basically an out-sourced, shared utils module with a focus on functions that buffer type uncertainties in Python (e.g. "is this a list?").
Rules:
- Functions are properly typed, library passes
mypy
. - Cannot depend on anything but six and the standard library
Functions
is_listish
: check if something is list-ishis_mapping
: check if an object is dict-ishensure_list
: make sure an argument is a list, or make it into a single-element listclean_dict
: remove null values from a dict, recursivelydecode_path
: decode a path name to be unicodehash_data
: generate a SHA1 from a dict of reasonable objects