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 |
---|---|
2140 |
|
715 |
|
695 |
|
553 |
|
430 |
|
391 |
|
331 |
|
278 |
|
261 |
|
255 |
|
229 |
|
209 |
|
202 |
|
200 |
|
199 |
|
196 |
|
|
189 |
187 |
|
173 |
|
172 |
|
168 |
|
168 |
|
142 |
|
127 |
|
97 |
|
94 |
|
89 |
|
88 |
|
87 |
|
86 |
|
81 |
|
70 |
|
68 |
|
60 |
|
59 |
|
48 |
|
48 |
|
47 |
|
47 |
|
46 |
|
46 |
|
45 |
|
43 |
|
40 |
|
39 |
|
38 |
|
38 |
|
37 |
|
37 |
|
37 |
|
35 |
|
34 |
|
33 |
|
33 |
|
32 |
|
31 |
|
24 |
|
24 |
|
24 |
|
20 |
|
17 |
|
17 |
|
16 |
|
14 |
|
13 |
|
11 |
|
9 |
|
9 |
|
7 |
|
5 |
|
5 |
|
4 |
|
4 |
|
4 |
|
4 |
|
3 |
|
3 |
|
2 |
|
2 |
|
1 |
usage stats = {
'mean': 73.12658,
'std': 170.95476,
'min': 1.0,
'max': 1478.0,
'med': 27.0,
'sum': 5777,
'shape': (79,),
}
ubelt.util_arg
¶
ubelt.PY2()
ubelt.string_types()
ubelt.argval()
ubelt.argflag()
ubelt.util_colors
¶
ubelt.NO_COLOR()
ubelt.highlight_code()
ubelt.color_text()
ubelt.util_const
¶
ubelt.NoParam()
ubelt.util_dict
¶
ubelt.AutoDict()
ubelt.AutoOrderedDict()
ubelt.dzip()
ubelt.ddict()
ubelt.dict_hist()
ubelt.dict_subset()
ubelt.dict_union()
ubelt.dict_isect()
ubelt.dict_diff()
ubelt.find_duplicates()
ubelt.group_items()
ubelt.invert_dict()
ubelt.map_keys()
ubelt.map_vals()
ubelt.sorted_keys()
ubelt.sorted_vals()
ubelt.odict()
ubelt.util_format
¶
ubelt.PY2()
ubelt.iteritems()
ubelt.string_types()
ubelt.text_type()
ubelt.repr2()
ubelt.FormatterExtensions()
ubelt.util_import
¶
ubelt.split_modpath()
ubelt.modname_to_modpath()
ubelt.modpath_to_modname()
ubelt.import_module_from_name()
ubelt.import_module_from_path()
ubelt.util_links
¶
ubelt.PY2()
ubelt.symlink()
ubelt.util_list
¶
ubelt.PY2()
ubelt.string_types()
ubelt.chunks()
ubelt.iterable()
ubelt.take()
ubelt.compress()
ubelt.flatten()
ubelt.unique()
ubelt.argunique()
ubelt.unique_flags()
ubelt.boolmask()
ubelt.iter_window()
ubelt.allsame()
ubelt.argsort()
ubelt.argmax()
ubelt.argmin()
ubelt.peek()
ubelt.util_path
¶
ubelt.TempDir()
ubelt.augpath()
ubelt.shrinkuser()
ubelt.userhome()
ubelt.ensuredir()
ubelt.expandpath()
ubelt.util_platform
¶
ubelt.WIN32()
ubelt.LINUX()
ubelt.DARWIN()
ubelt.POSIX()
ubelt.PY2()
ubelt.string_types()
ubelt.platform_data_dir()
ubelt.platform_config_dir()
ubelt.platform_cache_dir()
ubelt.get_app_data_dir()
ubelt.ensure_app_data_dir()
ubelt.get_app_config_dir()
ubelt.ensure_app_config_dir()
ubelt.get_app_cache_dir()
ubelt.ensure_app_cache_dir()
ubelt.find_exe()
ubelt.find_path()
ubelt.util_str
¶
ubelt.indent()
ubelt.codeblock()
ubelt.paragraph()
ubelt.hzcat()
ubelt.ensure_unicode()
ubelt.util_time
¶
- ubelt
- ubelt package
- Submodules
- ubelt.orderedset module
- ubelt.progiter module
- ubelt.timerit module
- ubelt.util_arg module
- ubelt.util_cache module
- ubelt.util_cmd module
- ubelt.util_colors module
- ubelt.util_const module
- ubelt.util_dict module
- ubelt.util_download module
- ubelt.util_format module
- ubelt.util_func module
- ubelt.util_hash module
- ubelt.util_import module
- ubelt.util_io module
- ubelt.util_links module
- ubelt.util_list module
- ubelt.util_memoize module
- ubelt.util_mixins module
- ubelt.util_path module
- ubelt.util_platform module
- ubelt.util_str module
- ubelt.util_stream module
- ubelt.util_time module
- Module contents
- Submodules
- ubelt package