No project description provided
Project description
Validate Field
This is a project that is used to validate fields which is empty or it contain accurate values. Before touching the database we can check and raise appropriate error message if any mistmatch on it, else return True.
.. code-block:: bash
1) Check value is missed or empty
2) Check wether the datatype is correct or not
2.1) int = Specifies the integer
2.2) str = Specifies the string
2.3) email = Specifies the email
2.4) phone = Specifies the phone number
2.5) alpha = Specifies the alphabetes
2.6) '' = Specifies the null value, is equal to str
Installing
.. code-block:: bash
pip install validate-field
Usage
Enter received_field(values that comes from the front-end side) and required_field(list of values that need to be check in th back-end)
.. code-block:: bash
from validate_field.validation import validate_field
received_field = {
'id':1,
'name':"testuser",
'email':'testmail@gmail.com',
'mobile':'+918330069872',
'password':"testpass@122#"
}
required_field = [
['id','int'],
['name','alpha'],
['email','email'],
['mobile','phone'],
['password','str']
]
validation_result = validate_field(received_field, required_field)
print(validation_result)
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
validate_field-0.2.4.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for validate_field-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1002a421ee9384140f40ab18fe2d2b29aed471619154c8cc99ec422f1b513c9c |
|
MD5 | acce1f4814262835908a5c5db12be5ce |
|
BLAKE2b-256 | 417908c06ccad500f7ba70ebaae5a5a639c2bd728f481eacc43919760f351a9d |