Skip to main content

Utilities helper library for Python

Project description

ve-utils

CircleCI PyPI package codecov Codacy Badge

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ve_utils-2.5.1.tar.gz (42.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ve_utils-2.5.1-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file ve_utils-2.5.1.tar.gz.

File metadata

  • Download URL: ve_utils-2.5.1.tar.gz
  • Upload date:
  • Size: 42.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for ve_utils-2.5.1.tar.gz
Algorithm Hash digest
SHA256 6f0f919bfac142ac82f88dc66bcd8e092aea545305a29f34f0d5ae5f2ce20224
MD5 d1a07d554c48c7a1f6890e8b6626414f
BLAKE2b-256 7722754adac5a241d959dd57991fb34614aeec768f6bae183477e9f8ac96135a

See more details on using hashes here.

File details

Details for the file ve_utils-2.5.1-py3-none-any.whl.

File metadata

  • Download URL: ve_utils-2.5.1-py3-none-any.whl
  • Upload date:
  • Size: 20.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for ve_utils-2.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 271534d687fca08b132b85e6fb0ad48953ccf84f3c2dfdfa3404220f06de9ebf
MD5 dd8829f075bbf6f43068b5dfbeb60413
BLAKE2b-256 835ae08803cfc48286b4320458588930aeafef36c3d328f24757864f982b23bb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page