pyKwalify
YAML/JSON validation library
This framework is a port with a lot of added functionality of the Java version of the framework kwalify that can be found at http://www.kuwata-lab.com/kwalify/
The original source code can be found at http://sourceforge.net/projects/kwalify/files/kwalify-java/0.5.1/
The source code of the latest release that has been used can be found at https://github.com/sunaku/kwalify. Please note that source code is not the original authors code but a fork/upload of the last release available in Ruby.
The schema this library is based on and extended from: http://www.kuwata-lab.com/kwalify/ruby/users-guide.01.html#schema
Usage
Create a data file. Json and Yaml formats are both supported.
- foo
- bar
Create a schema file with validation rules.
type: seq
sequence:
- type: str
Run validation from cli.
pykwalify -d data.yaml -s schema.yaml
Examples
The documentation describes in detail how each keyword and type works and what is possible in each case.
But there is a lot of real world examples that can be found in the test data/files. It shows a lot of examples of how all keywords and types work in practice and in combination with each other.
The files can be found here and show both schema/data combinations that will work and that will fail.
tests/files/success/tests/files/fail/tests/files/partial_schemas/
YAML parser
ruamel.yaml is the default YAMl parser installed with pykwalify.
Ruamel.yaml is more supported in the yaml 1.2 spec and is more actively developed.
Depending on how both libraries are developed, this can change in the future in any major update.
UTF-8 and data encoding
If you have problems with unicode values not working properly when running pykwalify on Python 3.6x then try to add this environment variable to your execution:
PYTHONIOENCODING=UTF-8 pykwalify ...
and it might help to force UTF-8 encoding on all string objects. If this does not work please open up an issue with your schema and data that can be used to track down the problem in the source code.
Project details
| python support | 3.6, 3.7, 3.8, 3.9 |
| Source | https://github.com/Grokzen/pykwalify |
| Docs (Latest release) | http://pykwalify.readthedocs.io/en/master/ |
| Docs (Unstable branch) | http://pykwalify.readthedocs.io/en/unstable/ |
| Gitter (Free Chat) | |
| Changelog | https://github.com/Grokzen/pykwalify/blob/unstable/docs/release-notes.rst |
| Upgrade instructions | https://github.com/Grokzen/pykwalify/blob/unstable/docs/upgrade-instructions.rst |
| Issues | https://github.com/Grokzen/pykwalify/issues |
| Travis (master) | |
| Travis (unstable) | |
| Test coverage | |
| pypi | https://pypi.python.org/pypi/pykwalify/ |
| Open Hub | https://www.openhub.net/p/pykwalify |
| License | MIT https://github.com/Grokzen/pykwalify/blob/unstable/docs/license.rst |
| Copyright | Copyright (c) 2013-2017 Johan Andersson |
| git repo | git clone git@github.com:Grokzen/pykwalify.git |
| install stable | pip install pykwalify |
| install dev | $ git clone git@github.com:Grokzen/pykwalify.git pykwalify$ cd ./pykwalify$ virtualenv .venv$ source .venv/bin/activate$ pip install -r dev-requirements.txt$ pip install -e . |
| required dependencies | docopt >= 0.6.2python-dateutil >= 2.4.2 |
| supported yml parsers | ruamel.yaml >= 0.11.0 |
Metadata
Release files for pykwalify 1.8.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 |
|---|---|---|---|---|
| pykwalify-1.8.0.tar.gz | 62.5 kB | Without provenance | Details for pykwalify-1.8.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pykwalify-1.8.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for pykwalify-1.8.0-py2.py3-none-any.whl |
Total release size: 87.3 kB
Release files / pykwalify-1.8.0.tar.gz
| Download URL | pykwalify-1.8.0.tar.gz |
|---|---|
| Size | 62.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
796b2ad3ed4cb99b88308b533fb2f559c30fa6efb4fa9fda11347f483d245884
|
|
BLAKE2b-256 checksum How to use checksums |
d5772d6849510dbfce5f74f1f69768763630ad0385ad7bb0a4f39b55de3920c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.23.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.6
|
Release files / pykwalify-1.8.0-py2.py3-none-any.whl
| Download URL | pykwalify-1.8.0-py2.py3-none-any.whl |
|---|---|
| Size | 24.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
731dfa87338cca9f559d1fca2bdea37299116e3139b73f78ca90a543722d6651
|
|
BLAKE2b-256 checksum How to use checksums |
1ffdac2161cce19fd67a18c269073f8e86292b5511acec6f8ef6eab88615d032
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.23.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.6
|
Security for pykwalify 1.8.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.