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() 1598
ubelt.ProgIter() 610
ubelt.expandpath() 610
ubelt.ensuredir() 482
ubelt.take() 337
ubelt.odict() 311
ubelt.map_vals() 272
ubelt.dzip() 246
ubelt.augpath() 209
ubelt.NiceRepr() 197
ubelt.ddict() 191
ubelt.argval() 184
ubelt.cmd() 176
ubelt.argflag() 171
ubelt.flatten() 168
ubelt.codeblock() 159
ubelt.Timerit() 158
ubelt.NoParam() 149
ubelt.dict_hist() 146
ubelt.group_items() 138
ubelt.peek() 134
ubelt.iterable() 124
ubelt.hash_data() 116
ubelt.grabdata() 93
ubelt.delete() 82
ubelt.compress() 76
ubelt.color_text() 76
ubelt.dict_subset() 72
ubelt.Cacher() 68
ubelt.allsame() 66
ubelt.Timer() 57
ubelt.argsort() 53
ubelt.oset() 51
ubelt.invert_dict() 50
ubelt.indent() 47
ubelt.chunks() 45
ubelt.memoize() 44
ubelt.dict_isect() 42
ubelt.timestamp() 40
ubelt.import_module_from_path() 39
ubelt.unique() 36
ubelt.map_keys() 35
ubelt.hzcat() 35
ubelt.find_duplicates() 35
ubelt.writeto() 35
ubelt.dict_union() 34
ubelt.ensure_unicode() 30
ubelt.readfrom() 30
ubelt.iter_window() 29
ubelt.sorted_vals() 29
ubelt.argmax() 26
ubelt.memoize_property() 26
ubelt.modname_to_modpath() 25
ubelt.symlink() 25
ubelt.memoize_method() 23
ubelt.dict_diff() 23
ubelt.identity() 22
ubelt.hash_file() 21
ubelt.touch() 19
ubelt.import_module_from_name() 17
ubelt.highlight_code() 16
ubelt.find_exe() 15
ubelt.CacheStamp() 13
ubelt.find_path() 9
ubelt.AutoDict() 8
ubelt.split_modpath() 7
ubelt.shrinkuser() 7
ubelt.argmin() 6
ubelt.inject_method() 6
ubelt.download() 5
ubelt.modpath_to_modname() 5
ubelt.paragraph() 5
ubelt.CaptureStdout() 4
ubelt.sorted_keys() 3
ubelt.userhome() 2
ubelt.AutoOrderedDict() 2
ubelt.argunique() 2
ubelt.unique_flags() 2

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