
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
easyvalid-data-validator
Advanced tools
You can install it directly from PyPi https://pypi.org/project/easyvalid-data-validator/
pip install easyvalid-data-validator
All functions are fully tested
You are able to run tests on your own cloning repo and using it's environment:
git clone https://github.com/DSmolke/EASYVALID_DATA_VALIDATOR.git
cd EASYVALID_DATA_VALIDATOR
poetry update
poetry shell
poetry run python -m unittest discover -v
or:
poetry run pytest -vv
pipenv shell
pipenv run python -m unittest discover -v
or:
pipenv run pytest -vv
python -m unittest discover -v
or:
pip install pytest
pytest -vv
It's a package developed mainly for validation of json dict that is created by using json.load().
Here is an example of json dict, that has name, age, and balance.
user = {
"name": "ADAM",
"age": 18,
"balance": "2000.00"
}
We want to validate if:
We need to prepare constraint dict which describes this rules as explained:
constraints = {
"key_name1": {<ConstraintEnumObject>: *args},
"key_name2": {<ConstraintEnumObject>: *args},
"key_name3": {<ConstraintEnumObject>: *args}
}
So we create dict that stores dicts containing Constraint Objects as key that are indicators for validator of which case it's currently working on, and what datachecker it should use. Value should be arguments that datachecker need:
from easyvalid_data_validator.constraints import Constraint
constraints = {
"name": {Constraint.STRING_REGEX: r'^[A-Z]+$'},
"age": {Constraint.INT_GE: 18},
"balance": {Constraint.STRING_IS_DECIMAL: None}
}
Validation is very easy now, we just need to provide validate_json_data() with json_data, and constraints:
from easyvalid_data_validator.validator import validate_json_data
result = validate_json_data(user, constraints)
# result --> {"name": "ADAM", "age": 18, "balance": "2000.00"}
If we would change age of user to 17, validator would throw an error:
ValidationError("age": ["Invalid integer expression - isn't grater or equal to compare value"])
FAQs
Unknown package
We found that easyvalid-data-validator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.