
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 |
---|---|
2893 |
|
992 |
|
544 |
|
482 |
|
387 |
|
358 |
|
331 |
|
302 |
|
271 |
|
256 |
|
253 |
|
252 |
|
238 |
|
221 |
|
|
216 |
215 |
|
214 |
|
200 |
|
198 |
|
196 |
|
177 |
|
171 |
|
165 |
|
131 |
|
125 |
|
120 |
|
113 |
|
111 |
|
106 |
|
106 |
|
105 |
|
102 |
|
99 |
|
98 |
|
95 |
|
89 |
|
88 |
|
87 |
|
85 |
|
85 |
|
74 |
|
68 |
|
67 |
|
63 |
|
57 |
|
49 |
|
48 |
|
46 |
|
46 |
|
44 |
|
43 |
|
41 |
|
41 |
|
41 |
|
40 |
|
39 |
|
38 |
|
37 |
|
37 |
|
33 |
|
33 |
|
33 |
|
32 |
|
30 |
|
|
28 |
27 |
|
27 |
|
23 |
|
22 |
|
17 |
|
17 |
|
16 |
|
16 |
|
14 |
|
11 |
|
11 |
|
10 |
|
9 |
|
8 |
|
8 |
|
8 |
|
7 |
|
|
7 |
6 |
|
5 |
|
5 |
|
|
5 |
5 |
|
4 |
|
4 |
|
3 |
|
2 |
|
2 |
|
2 |
|
|
2 |
1 |
|
1 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
0 |
|
|
0 |
0 |
|
0 |
|
0 |
usage stats = {
'mean': 109.39655,
'std': 292.5527,
'min': 0.0,
'max': 2893.0,
'q_0.25': 5.0,
'q_0.50': 37.0,
'q_0.75': 106.0,
'med': 37.0,
'sum': 12690,
'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.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_repr
ΒΆ
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
OrderedSet
OrderedSet.copy()
OrderedSet.add()
OrderedSet.append()
OrderedSet.update()
OrderedSet.index()
OrderedSet.get_loc()
OrderedSet.get_indexer()
OrderedSet.pop()
OrderedSet.discard()
OrderedSet.clear()
OrderedSet.union()
OrderedSet.intersection()
OrderedSet.difference()
OrderedSet.issubset()
OrderedSet.issuperset()
OrderedSet.symmetric_difference()
OrderedSet.difference_update()
OrderedSet.intersection_update()
OrderedSet.symmetric_difference_update()
oset
- 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_deprecate 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_repr module
- ubelt.util_str module
- ubelt.util_stream module
- ubelt.util_time module
- ubelt.util_zip module
- ubelt.orderedset module
- Module contents
AutoDict
AutoOrderedDict
CacheStamp
Cacher
CaptureStdout
CaptureStream
DownloadManager
Executor
FormatterExtensions
IndexableWalker
JobPool
NiceRepr
OrderedSet
OrderedSet.copy()
OrderedSet.add()
OrderedSet.append()
OrderedSet.update()
OrderedSet.index()
OrderedSet.get_loc()
OrderedSet.get_indexer()
OrderedSet.pop()
OrderedSet.discard()
OrderedSet.clear()
OrderedSet.union()
OrderedSet.intersection()
OrderedSet.difference()
OrderedSet.issubset()
OrderedSet.issuperset()
OrderedSet.symmetric_difference()
OrderedSet.difference_update()
OrderedSet.intersection_update()
OrderedSet.symmetric_difference_update()
Path
ProgIter
ReprExtensions
SetDict
TeeStringIO
TempDir
Timer
UDict
allsame()
argflag()
argmax()
argmin()
argsort()
argunique()
argval()
augpath()
boolmask()
chunks
cmd()
codeblock()
color_text()
compatible()
compress()
ddict
delete()
dict_diff()
dict_hist()
dict_isect()
dict_subset()
dict_union()
download()
dzip()
ensure_app_cache_dir()
ensure_app_config_dir()
ensure_app_data_dir()
ensure_unicode()
ensuredir()
expandpath()
find_duplicates()
find_exe()
find_path()
flatten()
get_app_cache_dir()
get_app_config_dir()
get_app_data_dir()
grabdata()
group_items()
hash_data()
hash_file()
highlight_code()
hzcat()
identity()
import_module_from_name()
import_module_from_path()
indent()
indexable_allclose()
inject_method()
invert_dict()
iter_window()
iterable()
map_keys()
map_vals()
map_values()
memoize()
memoize_method
memoize_property()
modname_to_modpath()
modpath_to_modname()
named_product()
odict
oset
paragraph()
peek()
platform_cache_dir()
platform_config_dir()
platform_data_dir()
readfrom()
repr2()
schedule_deprecation()
sdict
shrinkuser()
sorted_keys()
sorted_vals()
sorted_values()
split_archive()
split_modpath()
symlink()
take()
timeparse()
timestamp()
touch()
udict
unique()
unique_flags()
urepr()
userhome()
varied_values()
writeto()
zopen
- Submodules