Metadata-Version: 1.1
Name: json-spec
Version: 0.6.2
Summary: Implements JSON Schema, JSON Pointer and JSON Reference.
Home-page: https://github.com/johnnoone/json-extensions
Author: Xavier Barbosa
Author-email: clint.northwood@gmail.com
License: BSD
Description: Json Spec
        =========
        
        .. image:: https://badge.fury.io/py/json-spec.png
            :target: http://badge.fury.io/py/json-spec
        
        .. image:: https://travis-ci.org/johnnoone/jsonspec.png?branch=master
            :target: https://travis-ci.org/johnnoone/jsonspec
        
        .. image:: https://pypip.in/d/json-spec/badge.png
            :target: https://pypi.python.org/pypi/json-spec
        
        This library implements several JSON specs, like `JSON Schema`_,  `JSON Reference`_ and `JSON Pointer`_:
        
        * It works on python 2.7, python 3.3 and above
        * It is release under the `BSD license`_
        
        
        Installation
        ------------
        
        This library has no special dependencies. You can simply use pip::
        
            $ pip install json-spec
        
        
        Usage
        -----
        
        Let say you want to fetch / validate JSON like objects.
        
        You can extract member of an object with `JSON Pointer`_::
        
            from jsonspec.pointer import extract
        
            obj = {
                'foo': ['bar', 'baz', 'quux']
            }
            assert 'baz' == extract(obj, '/foo/1')
        
        
        You can resolve member of any object with `JSON Reference`_::
        
            from jsonspec.reference import resolve
        
            obj = {
                'foo': ['bar', 'baz', {
                    '$ref': '#/sub'
                }],
                'sub': 'quux'
            }
        
            assert 'quux' == resolve(obj, '#/foo/2')
        
        
        You can describe you data with `JSON Schema`_::
        
            from jsonspec.validators import load
        
            # data will validate against this schema
            validator = load({
                'title': 'Example Schema',
                'type': 'object',
                'properties': {
                    'age': {
                        'description': 'Age in years',
                        'minimum': 0,
                        'type': 'integer'
                    },
                    'firstName': {
                        'type': 'string'
                    },
                    'lastName': {
                        'type': 'string'
                    }
                },
                'required': [
                    'firstName',
                    'lastName'
                ]
            })
        
            # validate this data
            validator.validate({
                'firstName': 'John',
                'lastName': 'Noone',
                'age': 33,
            })
        
        Other examples can be found in the documentation_ or in the tests_.
        
        .. _`JSON Schema`: http://json-schema.org
        .. _`JSON Reference`: http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03
        .. _`JSON Pointer`: http://tools.ietf.org/html/rfc6901
        .. _`BSD license`: LICENSE
        .. _documentation: http://json-spec.readthedocs.org
        .. _tests: https://github.com/johnnoone/jsonspec/tree/master/tests
        
        
Keywords: json utilitaries validation json-pointer json-reference json-schema
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Environment :: OpenStack
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
