Git Product home page Git Product logo

pykwalify's Introduction

pyKwalify

Build Status Coverage Status ![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

Installation

Latest stable release from pypi

$ pip install pykwalify

or from source

$ python setup.py install

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 --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.

Runtime Dependencies

  • docopt >= 0.6.2
  • PyYaml >= 3.11
  • python-dateutil >= 2.4.2

Supported python version

  • Python 2.7
  • Python 3.2
  • Python 3.3
  • Python 3.4

How to test

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

Documentation

  • [Implemented validation rules](docs/Validation Rules.md)
  • Extensions
  • [Upgrade instructions](docs/Upgrade Instructions.md)
  • Release notes

Licensing

MIT, See docs/License.txt for details

Copyright (c) 2013-2015 Johan Andersson

pykwalify's People

Contributors

grokzen avatar lokespotify avatar gonditeniz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.