# 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.
```yaml
- foo
- bar
```
Create a schema file with validation rules.
```yaml
type: seq
sequence:
- type: str
```
Run validation from cli.
```bash
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) | [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Grokzen/pykwalify?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |
| 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) | [![Build Status](https://travis-ci.org/Grokzen/pykwalify.svg?branch=master)](https://travis-ci.org/Grokzen/pykwalify) https://travis-ci.org/Grokzen/pykwalify |
| Travis (unstable) | [![Build Status](https://travis-ci.org/Grokzen/pykwalify.svg?branch=unstable)](https://travis-ci.org/Grokzen/pykwalify) https://travis-ci.org/Grokzen/pykwalify |
| Test coverage | [![Coverage Status](https://coveralls.io/repos/Grokzen/pykwalify/badge.png?branch=master)](https://coveralls.io/r/Grokzen/pykwalify) https://coveralls.io/github/Grokzen/pykwalify |
| 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`<br>`$ cd ./pykwalify`<br>`$ virtualenv .venv`<br>`$ source .venv/bin/activate`<br>`$ pip install -r dev-requirements.txt`<br>`$ pip install -e .` |
| required dependencies | `docopt >= 0.6.2`<br> `python-dateutil >= 2.4.2` |
| supported yml parsers | `ruamel.yaml >= 0.11.0` |
Raw data
{
"_id": null,
"home_page": "http://github.com/grokzen/pykwalify",
"name": "pykwalify",
"maintainer": "Johan Andersson",
"docs_url": null,
"requires_python": "",
"maintainer_email": "Grokzen@gmail.com",
"keywords": "",
"author": "Johan Andersson",
"author_email": "Grokzen@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/d5/77/2d6849510dbfce5f74f1f69768763630ad0385ad7bb0a4f39b55de3920c7/pykwalify-1.8.0.tar.gz",
"platform": "",
"description": "# pyKwalify\n\nYAML/JSON validation library\n\nThis 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/\n\nThe original source code can be found at http://sourceforge.net/projects/kwalify/files/kwalify-java/0.5.1/\n\nThe 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.\n\nThe schema this library is based on and extended from: http://www.kuwata-lab.com/kwalify/ruby/users-guide.01.html#schema\n\n\n# Usage\n\nCreate a data file. `Json` and `Yaml` formats are both supported.\n\n```yaml\n- foo\n- bar\n```\n\nCreate a schema file with validation rules.\n\n```yaml\ntype: seq\nsequence:\n - type: str\n```\n\nRun validation from cli.\n\n```bash\npykwalify -d data.yaml -s schema.yaml\n```\n\n\n## Examples\n\nThe documentation describes in detail how each keyword and type works and what is possible in each case.\n\nBut 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.\n\nThe files can be found here and show both schema/data combinations that will work and that will fail.\n\n - `tests/files/success/`\n - `tests/files/fail/`\n - `tests/files/partial_schemas/`\n\n\n# YAML parser\n\n`ruamel.yaml` is the default YAMl parser installed with pykwalify.\n\nRuamel.yaml is more supported in the yaml 1.2 spec and is more actively developed.\n\nDepending on how both libraries are developed, this can change in the future in any major update.\n\n\n\n## UTF-8 and data encoding\n\nIf 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:\n\n```\nPYTHONIOENCODING=UTF-8 pykwalify ...\n```\n\nand 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.\n\n\n# Project details\n\n| | |\n|---|---|\n| python support | 3.6, 3.7, 3.8, 3.9 |\n| Source | https://github.com/Grokzen/pykwalify |\n| Docs (Latest release) | http://pykwalify.readthedocs.io/en/master/ |\n| Docs (Unstable branch) | http://pykwalify.readthedocs.io/en/unstable/ |\n| Gitter (Free Chat) | [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Grokzen/pykwalify?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |\n| Changelog | https://github.com/Grokzen/pykwalify/blob/unstable/docs/release-notes.rst |\n| Upgrade instructions | https://github.com/Grokzen/pykwalify/blob/unstable/docs/upgrade-instructions.rst |\n| Issues | https://github.com/Grokzen/pykwalify/issues |\n| Travis (master) | [![Build Status](https://travis-ci.org/Grokzen/pykwalify.svg?branch=master)](https://travis-ci.org/Grokzen/pykwalify) https://travis-ci.org/Grokzen/pykwalify |\n| Travis (unstable) | [![Build Status](https://travis-ci.org/Grokzen/pykwalify.svg?branch=unstable)](https://travis-ci.org/Grokzen/pykwalify) https://travis-ci.org/Grokzen/pykwalify |\n| Test coverage | [![Coverage Status](https://coveralls.io/repos/Grokzen/pykwalify/badge.png?branch=master)](https://coveralls.io/r/Grokzen/pykwalify) https://coveralls.io/github/Grokzen/pykwalify |\n| pypi | https://pypi.python.org/pypi/pykwalify/ |\n| Open Hub | https://www.openhub.net/p/pykwalify |\n| License | `MIT` https://github.com/Grokzen/pykwalify/blob/unstable/docs/license.rst |\n| Copyright | `Copyright (c) 2013-2017 Johan Andersson` |\n| git repo | `git clone git@github.com:Grokzen/pykwalify.git` |\n| install stable | `pip install pykwalify` |\n| install dev | `$ git clone git@github.com:Grokzen/pykwalify.git pykwalify`<br>`$ cd ./pykwalify`<br>`$ virtualenv .venv`<br>`$ source .venv/bin/activate`<br>`$ pip install -r dev-requirements.txt`<br>`$ pip install -e .` |\n| required dependencies | `docopt >= 0.6.2`<br> `python-dateutil >= 2.4.2` |\n| supported yml parsers | `ruamel.yaml >= 0.11.0` |\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python lib/cli for JSON/YAML schema validation",
"version": "1.8.0",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "059ed66acc3a8ab5bf7b96557d939d72",
"sha256": "731dfa87338cca9f559d1fca2bdea37299116e3139b73f78ca90a543722d6651"
},
"downloads": -1,
"filename": "pykwalify-1.8.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "059ed66acc3a8ab5bf7b96557d939d72",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 24860,
"upload_time": "2020-12-30T22:31:09",
"upload_time_iso_8601": "2020-12-30T22:31:09.090666Z",
"url": "https://files.pythonhosted.org/packages/1f/fd/ac2161cce19fd67a18c269073f8e86292b5511acec6f8ef6eab88615d032/pykwalify-1.8.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "153197598f8508a49aefc0f44156c2b8",
"sha256": "796b2ad3ed4cb99b88308b533fb2f559c30fa6efb4fa9fda11347f483d245884"
},
"downloads": -1,
"filename": "pykwalify-1.8.0.tar.gz",
"has_sig": false,
"md5_digest": "153197598f8508a49aefc0f44156c2b8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 62462,
"upload_time": "2020-12-30T22:31:10",
"upload_time_iso_8601": "2020-12-30T22:31:10.745404Z",
"url": "https://files.pythonhosted.org/packages/d5/77/2d6849510dbfce5f74f1f69768763630ad0385ad7bb0a4f39b55de3920c7/pykwalify-1.8.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2020-12-30 22:31:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "grokzen",
"github_project": "pykwalify",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"requirements": [],
"tox": true,
"lcname": "pykwalify"
}