Utilities helper library for Python
Project description
ve-utils
This is a Python utilities helper.
Installation
Install from PyPi :
You can install the ve_utils helper from PyPI:
$ pip install ve_utils
Install from GitHub repository :
To install directly from GitHub:
$ python3 -m pip install "git+https://github.com/mano8/ve_utils"
How to use
UType :
import package :
from ve_utils.utype import UType as Ut
Test format :
Example for is_list method:
>>> my_var = [ 0, 1 ,2 ,3 ]
>>> Ut.is_list(my_var, not_null=True)
>>> True
>>> Ut.is_list(my_var, min_items=5)
>>> False
>>> Ut.is_list(my_var, max_items=2)
>>> False
>>> Ut.is_list(my_var, eq=4)
>>> True
>>> Ut.is_list([], not_null=True)
>>> False
>>> Ut.is_list([])
>>> True
>>> Ut.is_list(dict())
>>> False
The methods is_list, is_dict and is_tuple takes the sames arguments.
Example for is_int method:
>>> my_var = 10
>>> Ut.is_int(my_var, not_null=True)
>>> True
>>> Ut.is_int(my_var, mini=15)
>>> False
>>> Ut.is_int(my_var, maxi=2)
>>> False
# value is_int an is equal to 2
>>> Ut.is_int(2, eq=2)
>>> True
>>> Ut.is_int(0, not_null=True)
>>> False
>>> Ut.is_int(-10, positive=True)
>>> False
>>> Ut.is_int(-10, negative=True)
>>> True
>>> Ut.is_int("hello")
>>> False
The methods is_int, is_float and is_numeric takes the sames arguments.
is_numeric method allow to work with float and int instances.
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 ve_utils-2.5.3.tar.gz.
File metadata
- Download URL: ve_utils-2.5.3.tar.gz
- Upload date:
- Size: 43.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c93c73ba1d6b358a13f7f4c6d8443e4aaa51b81230fcbac30210328e7b4b4909
|
|
| MD5 |
09d80f2a94f1503c62462f68cc4a1553
|
|
| BLAKE2b-256 |
ee07c3249531dc8b74588a52301cd609678f3ae59cda4564fa61f11d660fa6ff
|
File details
Details for the file ve_utils-2.5.3-py3-none-any.whl.
File metadata
- Download URL: ve_utils-2.5.3-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5189a7c80ebc331a40f3ae885411368bc3a0a0473faa58463fbd4b709938d913
|
|
| MD5 |
78ba5262c9241b9f240ab46d41992eaf
|
|
| BLAKE2b-256 |
d6e386a14355470a4c7b2156f1ed5e96b8ceb12c004903cfa2312b923c7791ff
|