python-validators

A python utility that can validate strings and so much . Still under active development


License
MIT
Install
pip install python-validators==0.0.1

Documentation

Python Validatord forthebadgeforthebadge

PyPI license PyPI - Wheel

A python validators module that makes validation easy with functions like mail() . Please note that this module is still under active development and it is dependency free .

Table of contents

Installation

In order to install it you can use pip the defualt Python Package Installer . It's easy , on windows open cmd as adminsistrator and type

pip install python-validators

For linux systems

sudo pip3 install python-validators

Usage

Using python-validators is easy . Here are some examples with the python-validators functions ...

import python-validators
print(python-validators.email('email@email.com'))
print(python-validators.ipv4('255.255.255.0'))
print(python-validators.url("https://www.google.com"))
print(python-validators.equals('testish', 'testish'))
print(python-validators.islower('test'))
print(python-validators.number('1'))
print(python-validators.md5('8b1a9953c4611296a827abf8c47804d7'))

email(str) -> Checks if given parameter is a string

import python-validators
print(python-validators.email('adiba@a.com'))

currency(str) -> Checks if given parameter is a currency type

import python-validators
print(python-validators.currency('$4.4'))

equals(str1, str2) -> Checks if given parameters are same

import python-validators
print(python-validators.equals('testish', 'testish'))

ipv4(ip) -> Checks if given parameter is a valid ipv4 / IP address

import python-validators
print(python-validators.ipv4('255.255.255.0'))

url(str) -> Checks if given parameter is an url

import python-validators
print(python-validators.url("https://www.google.com"))

lower(str) -> Checks if given parameter is a lower cased string

import python-validators
print(python-validators.islower('test'))

md5(str) -> Checks if given parameter is a md5 hash

import python-validators
print(python-validators.md5('8b1a9953c4611296a827abf8c47804d7'))

number(str / int) -> Checks if given parameter is a number

import python-validators
print(python-validators.number('1'))