Styler Validation
Validators to be used as mixins in models
Free software: MIT license
Usage
Install from pypi:
pip install styler-validation
Set validation rules for a class
from styler_validation import ValidatorMixin
from styler_validation import validators as va
class User(ValidatorMixin):
validates = [
('name', va.is_required()),
('age', va.is_required(), va.is_integer())
]
my_user = User()
result, errors = my_user.is_valid()
print(result) # False
print(errors) # {'user.name': ('required_value',), 'user.age': ('required_value',)}
my_user.name = 'John Doe'
my_user.age = 'nine'
result, errors = my_user.is_valid()
print(result) # False
print(errors) # {'user.age': ('invalid_value',)}
Metadata
Release files for styler-validation 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| styler_validation-1.0.0.tar.gz | 7.1 kB | Without provenance | Details for styler_validation-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| styler_validation-1.0.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for styler_validation-1.0.0-py2.py3-none-any.whl |
Total release size: 12.4 kB
Release files / styler_validation-1.0.0.tar.gz
| Download URL | styler_validation-1.0.0.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e605e86d6d1981175ba61ad2e2095c25f57a12cb64ae103692ac869a5eebcf7
|
|
BLAKE2b-256 checksum How to use checksums |
8063ce1e916d19ad45aa9aea512e9f53d44e12504d6f9fc66fd89f2d835a565b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.14.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.1
|
Release files / styler_validation-1.0.0-py2.py3-none-any.whl
| Download URL | styler_validation-1.0.0-py2.py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
614cf7e01ec91d267e7335530d05b1e5b3f8fc705ed769328c9579dcf334dee1
|
|
BLAKE2b-256 checksum How to use checksums |
404d37347504142daa563b0d1f0b5a86010879aee7e4d045fea5091fd8e7e539
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.14.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.1
|
Security for styler-validation 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.