Releases: MajAhd/py_validations
Releases · MajAhd/py_validations
V0.3.4
✅ Upgrade python SetupTools
import pyvalidations as PyValidations
data = {
"first_name": "Majid"
}
rules = {
"first_name": ["required", "string", "max:128"]
}
# get error messages in English language
PyValidations.make(data, rules)
# get error messages in Deutsch language
PyValidations.make(data, rules , "de")
# get error messages in Farsi language
PyValidations.make(data, rules , "fa")
V0.3.3
V0.3.2
Language Support
- Support Deutsch language
import pyvalidations as PyValidations
data = {
"first_name": "Majid"
}
rules = {
"first_name": ["required", "string", "max:128"]
}
# by default return messages in English
PyValidations.make(data, rules)
# Set parameter "de" and get error messages in Deutsch language
PyValidations.make(data, rules , "de")
V0.3.1
V0.3.0
Validate File : extension , mimes , mime types , min and max size
- File
- File Mimes
- File Mime Types
- File Max Size
- File Min Size
install
pip install PyValidations
Usage
data = {
"avatar": "PATH/avatar.png", # --> file path
}
rules = {
"avatar": ["file", "mimes:png,jpeg", "mime_types:image/png,image/jpeg", "min_size:10", "max_size:20"],
}
validate = PyValidations.make(data, rules)
V0.2.0
Customize Required Validation Added
- Required If
- Required Unless
- Required With
- Required Without
install
pip install PyValidations
Usage
import pyvalidations as PyValidations
data = {
"first_name": "Majid"
}
rules = {
"first_name": ["required", "string", "max:128"]
}
PyValidations.make(data, rules)
Documentation
v0.1.0-beta
Python Data Validator
Simple and easy library to Validate data in python
V0.1.0-beta
- Required
- Accepted
- Alpha & String
- Boolean
- Numbers
- Min & Max
- Internet
- In & Not_In
- UUID
- Date&Time
- Different
- Confirmation
- Nullable
install
pip install PyValidations
Usage
import pyvalidations as PyValidations
data = {
"first_name": "Majid"
}
rules = {
"first_name": ["required", "string", "max:128"]
}
PyValidations.make(data, rules)