https://i.imgur.com/PoYIsWE.png

UBelt documentation

UBelt is a “utility belt” of commonly needed utility and helper functions. It is a currated collection of top-level utilities with functionality that falls into a mixture of categories.

The source code is available at https://github.com/Erotemic/ubelt. We also have Jupyter notebook demos.

The ubelt API is organized by submodules containing related functionality. Each submodule contains top level overview documentation, and each function contains a docstring with at least one example.

The API by usefulness

Perhaps the most useful way to learn this API is to sort by “usefulness”. I measure usefulness as the number of times I’ve used a particular function in my own code (excluding ubelt itself).

Function name Usefulness
ubelt.repr2() 1051
ubelt.take() 180
ubelt.dzip() 177
ubelt.odict() 167
ubelt.argval() 130
ubelt.ProgIter() 128
ubelt.flatten() 123
ubelt.NoParam() 103
ubelt.Timerit() 100
ubelt.NiceRepr() 95
ubelt.hzcat() 94
ubelt.argflag() 89
ubelt.iterable() 87
ubelt.cmd() 82
ubelt.codeblock() 82
ubelt.ensuredir() 80
ubelt.map_vals() 76
ubelt.ddict() 73
ubelt.expandpath() 72
ubelt.grabdata() 70
ubelt.compress() 56
ubelt.group_items() 56
ubelt.hash_data() 50
ubelt.color_text() 50
ubelt.delete() 42
ubelt.writeto() 38
ubelt.invert_dict() 37
ubelt.chunks() 36
ubelt.allsame() 36
ubelt.dict_hist() 32
ubelt.Timer() 31
ubelt.indent() 30
ubelt.argsort() 29
ubelt.Cacher() 26
ubelt.identity() 23
ubelt.peek() 23
ubelt.ensure_unicode() 22
ubelt.iter_window() 20
ubelt.map_keys() 19
ubelt.readfrom() 19
ubelt.oset() 18
ubelt.timestamp() 18
ubelt.find_duplicates() 18
ubelt.modname_to_modpath() 16
ubelt.unique() 15
ubelt.memoize_property() 14
ubelt.memoize() 13
ubelt.touch() 12
ubelt.highlight_code() 12
ubelt.find_exe() 10
ubelt.argmax() 10
ubelt.inject_method() 8
ubelt.memoize_method() 8
ubelt.dict_subset() 7
ubelt.augpath() 6
ubelt.import_module_from_path() 6
ubelt.hash_file() 6
ubelt.symlink() 6
ubelt.dict_union() 5
ubelt.split_modpath() 5
ubelt.CaptureStdout() 4
ubelt.dict_diff() 4
ubelt.shrinkuser() 4
ubelt.argmin() 3
ubelt.modpath_to_modname() 3
ubelt.import_module_from_name() 3
ubelt.paragraph() 3
ubelt.CacheStamp() 3
ubelt.AutoDict() 2
ubelt.AutoOrderedDict() 2
ubelt.unique_flags() 2
ubelt.dict_isect() 2
ubelt.find_path() 2
ubelt.download() 1

The API by submodule

Alternatively you might prefer a module-based approach where functions are grouped based on similar functionality.

ubelt.util_const

ubelt.NoParam()

Indices and tables