![Gitter](https://badges.gitter.im/Join Chat.svg)
YAML/JSON validation library
This framework is a port with alot added functionality of the java version of the framework kwalify that can be found at: http://www.kuwata-lab.com/kwalify/
The source code can be found at: http://sourceforge.net/projects/kwalify/files/kwalify-java/0.5.1/
The schema this library is base and extended from: http://www.kuwata-lab.com/kwalify/ruby/users-guide.01.html#schema
Latest stable release from pypi
$ pip install pykwalify
or from source
$ python setup.py install
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 --data-file data.yaml --schema-file schema.yaml
If validation passes then return code from the invocation will be 0. If errors was found then 1.
Run validation from code. Multiple schema files is possible to use when using partial schemas (See doc for details).
from pykwalify.core import Core
c = Core(source_file="data.yaml", schema_files=["schema.yaml"])
c.validate(raise_exception=True)
If validation fails then exception will be raised.
- docopt >= 0.6.2
- PyYaml >= 3.11
- python-dateutil >= 2.4.2
- Python 2.7
- Python 3.3
- Python 3.4
- Python 3.5 (Currently up to beta 4 release)
Install test requirements with
$ pip install -r dev-requirements.txt
Run tests with
$ py.test
or if you want to test against all python versions and pep8
$ tox
- [Implemented validation rules](docs/Validation Rules.md)
- Extensions
- [Upgrade instructions](docs/Upgrade Instructions.md)
- Release notes
MIT, See docs/License.txt for details
Copyright (c) 2013-2015 Johan Andersson