A package of differnt utilities
Project description
utility belt
This is a utility package which can simplify a lot of common and repetitive tasks.
It contains different utility functions.
to install it use pip install util-belt and pip will install the latest version of the package
List of functionalities
-
file utilities
-
list to text
to save a list to text file for later use you can do it using the
list_to_txt()funtion in thefile_utilsmodule.example
from util_belt.file_utils import list_to_txt my_list = [3,5,6,7] list_to_txt(my_list , file_dest = './list.txt')file_destparameter is the file path where the list should be saved at.
By default it is the current directory and the file name islist.txt
you can change that to any file path you want. the funtion will save your list
to a file with out worrying about details in file handling.Currently this library can only save simple lists or 1D lists
-
file from list
to get a list saved in a txt file uselist_from_txtfunction in thefile_utilsmoduleExample
from util_belt.file_utils import list_from_txt my_list = list_from_txt('Documents/my_list.txt')
it will inlude more flexiblity and functionalities in the next update -
-
display utilities
- pretty print an array
this functionality could be accessd at thedisplay_utilmodule
it helps us print a numpy array beatifulyExample
Thefrom util_belt.display_utils import pretty_array three_d_array = np.random.randint(0, 10, size=(2,7,12)) pretty_array(three_d_array,colorify = False,axis=0)colorifyparameter determines if the display should be colorful (by default it is flase).
Theaxisparameter determines on which axis of the array should the different bands of color applied(by defualt it is 0). the out put from the above example looks like as follows:
- pretty print an array
/ 6 0 4 3 5 8 4 7 9 1 4 3 /
/ 9 6 2 1 0 6 4 3 4 9 4 6 /
/ 6 3 5 1 4 9 8 9 9 0 8 4 /
/ 5 7 3 6 9 9 6 7 1 6 4 5 /
/ 6 2 1 6 5 6 4 0 8 9 1 2 /
/ 7 2 6 7 0 1 4 7 5 0 7 7 /
/ 7 3 5 1 5 7 2 4 5 6 1 5 /
/ 9 2 2 1 5 6 5 2 4 4 6 9 /
/ 4 1 6 8 6 0 2 6 8 4 0 7 /
/ 3 8 9 3 9 8 9 7 8 1 8 8 /
/ 4 5 7 7 0 5 4 5 5 1 4 7 /
/ 9 6 1 6 2 5 8 8 4 9 5 2 /
/ 7 2 8 2 7 7 3 4 3 1 0 9 /
The origin or the [0][0][0] in this display starts from the bottom left corner.
Then the first axis (height) increases from bottom to top (like a Z axis in typical 3D cartesian plane)
The second axis (rows) increases away from the origin point along the diagonal line
The third axis (columns) increases horizentaly to the right.
This can be shown in the diagram below
first axis | second axis | / | / | / |/_________ third axis
if there is any issue,a bug or recommendation report on https://github.com/kellemNegasi/util_belt
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file util_belt-0.0.9.tar.gz.
File metadata
- Download URL: util_belt-0.0.9.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4df942e4d4e6400d79555807766b2c288cfa4cf6e4332bf7682d5a7fb1ec671
|
|
| MD5 |
603841a7fe19074ea11e06a40384e0fc
|
|
| BLAKE2b-256 |
99d6d955cdf751604d9fc58532707c0b420a6cc40830d3ce53d419c99ce2a5ba
|
File details
Details for the file util_belt-0.0.9-py3-none-any.whl.
File metadata
- Download URL: util_belt-0.0.9-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46409ebb122a670b5f98925822db4649909bd6d2c178857dc8515d9fdc305632
|
|
| MD5 |
244b8a962e08edeca8e496c3ea018efd
|
|
| BLAKE2b-256 |
01cc2871350c1fdbf742958851c8ab3e1fc8bd5a14e429303748523dda8532ce
|