
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.
NOTE: The README on github contains information and examples complementary to these docs.
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 |
---|---|
2384 |
|
624 |
|
539 |
|
419 |
|
358 |
|
342 |
|
283 |
|
273 |
|
252 |
|
248 |
|
234 |
|
225 |
|
218 |
|
202 |
|
201 |
|
195 |
|
192 |
|
182 |
|
169 |
|
159 |
|
157 |
|
|
154 |
141 |
|
136 |
|
129 |
|
125 |
|
120 |
|
115 |
|
114 |
|
104 |
|
102 |
|
99 |
|
93 |
|
90 |
|
89 |
|
87 |
|
81 |
|
64 |
|
61 |
|
61 |
|
61 |
|
60 |
|
48 |
|
46 |
|
44 |
|
44 |
|
43 |
|
41 |
|
41 |
|
40 |
|
39 |
|
38 |
|
38 |
|
36 |
|
34 |
|
33 |
|
32 |
|
32 |
|
31 |
|
29 |
|
|
28 |
27 |
|
25 |
|
23 |
|
23 |
|
22 |
|
22 |
|
21 |
|
20 |
|
20 |
|
20 |
|
19 |
|
17 |
|
14 |
|
13 |
|
13 |
|
11 |
|
11 |
|
8 |
|
|
8 |
|
8 |
7 |
|
7 |
|
5 |
|
|
5 |
4 |
|
3 |
|
2 |
|
2 |
|
1 |
|
1 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
|
0 |
0 |
|
|
0 |
0 |
|
0 |
|
0 |
usage stats = {
'mean': 95.18104,
'std': 240.17876,
'min': 0.0,
'max': 2384.0,
'q_0.25': 2.75,
'q_0.50': 31.5,
'q_0.75': 106.5,
'med': 31.5,
'sum': 11041,
'shape': (116,),
}
ubelt.orderedset
¶
ubelt.progiter
¶
ubelt.util_arg
¶
ubelt.util_cache
¶
ubelt.util_cmd
¶
ubelt.util_colors
¶
<ubelt.NO_COLOR>
<ubelt.highlight_code>
<ubelt.color_text>
ubelt.util_const
¶
<ubelt.NoParam>
ubelt.util_deprecate
¶
<ubelt.schedule_deprecation>
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.map_values>
<ubelt.sorted_keys>
<ubelt.sorted_vals>
<ubelt.sorted_values>
<ubelt.odict>
<ubelt.named_product>
<ubelt.varied_values>
<ubelt.SetDict>
<ubelt.UDict>
<ubelt.sdict>
<ubelt.udict>
ubelt.util_download
¶
ubelt.util_download_manager
¶
ubelt.util_format
¶
ubelt.util_func
¶
ubelt.util_futures
¶
ubelt.util_hash
¶
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_indexable
¶
ubelt.util_io
¶
<ubelt.readfrom>
<ubelt.writeto>
<ubelt.touch>
<ubelt.delete>
ubelt.util_links
¶
ubelt.util_list
¶
<ubelt.allsame>
<ubelt.argmax>
<ubelt.argmin>
<ubelt.argsort>
<ubelt.argunique>
<ubelt.boolmask>
<ubelt.chunks>
<ubelt.compress>
<ubelt.flatten>
<ubelt.iter_window>
<ubelt.iterable>
<ubelt.peek>
<ubelt.take>
<ubelt.unique>
<ubelt.unique_flags>
ubelt.util_memoize
¶
<ubelt.memoize>
<ubelt.memoize_method>
<ubelt.memoize_property>
ubelt.util_mixins
¶
ubelt.util_path
¶
<ubelt.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.find_exe>
<ubelt.find_path>
<ubelt.ensure_app_cache_dir>
<ubelt.ensure_app_config_dir>
<ubelt.ensure_app_data_dir>
<ubelt.get_app_cache_dir>
<ubelt.get_app_config_dir>
<ubelt.get_app_data_dir>
<ubelt.platform_cache_dir>
<ubelt.platform_config_dir>
<ubelt.platform_data_dir>
ubelt.util_str
¶
<ubelt.indent>
<ubelt.codeblock>
<ubelt.paragraph>
<ubelt.hzcat>
<ubelt.ensure_unicode>
ubelt.util_stream
¶
<ubelt.TeeStringIO>
<ubelt.CaptureStdout>
<ubelt.CaptureStream>
ubelt.util_time
¶
ubelt.util_zip
¶
<ubelt.zopen>
<ubelt.split_archive>
Package Layout
- ubelt package
- Submodules
- ubelt.orderedset module
- ubelt.progiter 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_download_manager module
- ubelt.util_format module
- ubelt.util_func module
- ubelt.util_futures module
- ubelt.util_hash module
- ubelt.util_import module
- ubelt.util_indexable 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
- ubelt.util_zip module
- Module contents
- Submodules