https://github.com/smarie/python-valid8
Yet another validation lib ;). Provides tools for general-purpose variable validation, function inputs/outputs validation as well as class fields validation. All entry points raise consistent ValidationError including all contextual details, with dynamic inheritance of ValueError/TypeError as appropriate.
https://github.com/smarie/python-valid8
arg args argument check checker contract decorate decorator input python valid validate validation validator value
Last synced: 9 months ago
JSON representation
Yet another validation lib ;). Provides tools for general-purpose variable validation, function inputs/outputs validation as well as class fields validation. All entry points raise consistent ValidationError including all contextual details, with dynamic inheritance of ValueError/TypeError as appropriate.
- Host: GitHub
- URL: https://github.com/smarie/python-valid8
- Owner: smarie
- License: bsd-3-clause
- Created: 2017-10-24T09:32:24.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-01-29T11:32:19.000Z (almost 5 years ago)
- Last Synced: 2025-03-11T20:52:06.499Z (10 months ago)
- Topics: arg, args, argument, check, checker, contract, decorate, decorator, input, python, valid, validate, validation, validator, value
- Language: Python
- Homepage: https://smarie.github.io/python-valid8/
- Size: 4.88 MB
- Stars: 29
- Watchers: 3
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# python-validate (valid8)
*"valid8ing is not a crime" ;-)*
[](https://pypi.python.org/pypi/valid8/) [](https://travis-ci.com/smarie/python-valid8) [](https://smarie.github.io/python-valid8/junit/report.html) [](https://codecov.io/gh/smarie/python-valid8)
[](https://smarie.github.io/python-valid8/) [](https://pypi.python.org/pypi/valid8/) [](https://pepy.tech/project/valid8) [](https://pepy.tech/project/valid8) [](https://github.com/smarie/python-valid8/stargazers)
`valid8` provides user-friendly tools for
* general-purpose inline validation,
* function inputs/outputs validation
* class fields validation.
All entry points raise consistent `ValidationError` including all contextual details, with dynamic inheritance of `ValueError`/`TypeError` as appropriate. Originally from the [autoclass](https://smarie.github.io/python-autoclass/) project.
**This is the readme for developers.** The documentation for users is available here: [https://smarie.github.io/python-valid8/](https://smarie.github.io/python-valid8/)
## Want to contribute ?
Contributions are welcome ! Simply fork this project on github, commit your contributions, and create pull requests.
Here is a non-exhaustive list of interesting open topics: [https://github.com/smarie/python-valid8/issues](https://github.com/smarie/python-valid8/issues)
## Installing all requirements
In order to install all requirements, including those for tests and packaging, use the following command:
```bash
pip install -r ci_tools/requirements-pip.txt
```
## Running the tests
This project uses `pytest`.
```bash
pytest -v valid8/tests/
```
## Packaging
This project uses `setuptools_scm` to synchronise the version number. Therefore the following command should be used for development snapshots as well as official releases:
```bash
python setup.py egg_info bdist_wheel rotate -m.whl -k3
```
## Generating the documentation page
This project uses `mkdocs` to generate its documentation page. Therefore building a local copy of the doc page may be done using:
```bash
mkdocs build -f docs/mkdocs.yml
```
## Generating the test reports
The following commands generate the html test report and the associated badge.
```bash
pytest --junitxml=junit.xml -v valid8/tests/
ant -f ci_tools/generate-junit-html.xml
python ci_tools/generate-junit-badge.py
```
### PyPI Releasing memo
This project is now automatically deployed to PyPI when a tag is created. Anyway, for manual deployment we can use:
```bash
twine upload dist/* -r pypitest
twine upload dist/*
```
### Merging pull requests with edits - memo
Ax explained in github ('get commandline instructions'):
```bash
git checkout -b - master
git pull https://github.com//python-valid8.git --no-commit --ff-only
```
if the second step does not work, do a normal auto-merge (do not use **rebase**!):
```bash
git pull https://github.com//python-valid8.git --no-commit
```
Finally review the changes, possibly perform some modifications, and commit.