gecko-dev/third_party/python/jsonschema
Alessio Placitelli 8cc68ed2dc Bug 1619555 - Add the missing sources to vendored python libs. r=ahal
The vendored packaged were fetched using vanilla "pip download", which downloads
wheel files by default (missing LICENSE, setup.py, etc.). This changeset was
created by downloading the "glean_parser" dependencies using "pip download
--no-binary :all:" which is the same thing that "mach vendor python" does.
It additionally removes all the /tests and /docs directories of the vendored
dependencies.

Differential Revision: https://phabricator.services.mozilla.com/D65171

--HG--
rename : third_party/python/Jinja2/jinja2/__init__.py => third_party/python/Jinja2/src/jinja2/__init__.py
rename : third_party/python/Jinja2/jinja2/_compat.py => third_party/python/Jinja2/src/jinja2/_compat.py
rename : third_party/python/Jinja2/jinja2/_identifier.py => third_party/python/Jinja2/src/jinja2/_identifier.py
rename : third_party/python/Jinja2/jinja2/asyncfilters.py => third_party/python/Jinja2/src/jinja2/asyncfilters.py
rename : third_party/python/Jinja2/jinja2/asyncsupport.py => third_party/python/Jinja2/src/jinja2/asyncsupport.py
rename : third_party/python/Jinja2/jinja2/bccache.py => third_party/python/Jinja2/src/jinja2/bccache.py
rename : third_party/python/Jinja2/jinja2/compiler.py => third_party/python/Jinja2/src/jinja2/compiler.py
rename : third_party/python/Jinja2/jinja2/constants.py => third_party/python/Jinja2/src/jinja2/constants.py
rename : third_party/python/Jinja2/jinja2/debug.py => third_party/python/Jinja2/src/jinja2/debug.py
rename : third_party/python/Jinja2/jinja2/defaults.py => third_party/python/Jinja2/src/jinja2/defaults.py
rename : third_party/python/Jinja2/jinja2/environment.py => third_party/python/Jinja2/src/jinja2/environment.py
rename : third_party/python/Jinja2/jinja2/exceptions.py => third_party/python/Jinja2/src/jinja2/exceptions.py
rename : third_party/python/Jinja2/jinja2/ext.py => third_party/python/Jinja2/src/jinja2/ext.py
rename : third_party/python/Jinja2/jinja2/filters.py => third_party/python/Jinja2/src/jinja2/filters.py
rename : third_party/python/Jinja2/jinja2/idtracking.py => third_party/python/Jinja2/src/jinja2/idtracking.py
rename : third_party/python/Jinja2/jinja2/lexer.py => third_party/python/Jinja2/src/jinja2/lexer.py
rename : third_party/python/Jinja2/jinja2/loaders.py => third_party/python/Jinja2/src/jinja2/loaders.py
rename : third_party/python/Jinja2/jinja2/meta.py => third_party/python/Jinja2/src/jinja2/meta.py
rename : third_party/python/Jinja2/jinja2/nativetypes.py => third_party/python/Jinja2/src/jinja2/nativetypes.py
rename : third_party/python/Jinja2/jinja2/nodes.py => third_party/python/Jinja2/src/jinja2/nodes.py
rename : third_party/python/Jinja2/jinja2/optimizer.py => third_party/python/Jinja2/src/jinja2/optimizer.py
rename : third_party/python/Jinja2/jinja2/parser.py => third_party/python/Jinja2/src/jinja2/parser.py
rename : third_party/python/Jinja2/jinja2/runtime.py => third_party/python/Jinja2/src/jinja2/runtime.py
rename : third_party/python/Jinja2/jinja2/sandbox.py => third_party/python/Jinja2/src/jinja2/sandbox.py
rename : third_party/python/Jinja2/jinja2/tests.py => third_party/python/Jinja2/src/jinja2/tests.py
rename : third_party/python/Jinja2/jinja2/utils.py => third_party/python/Jinja2/src/jinja2/utils.py
rename : third_party/python/Jinja2/jinja2/visitor.py => third_party/python/Jinja2/src/jinja2/visitor.py
rename : third_party/python/importlib_metadata/importlib_metadata-1.5.0.dist-info/LICENSE => third_party/python/importlib_metadata/LICENSE
rename : third_party/python/importlib_metadata/importlib_metadata-1.5.0.dist-info/top_level.txt => third_party/python/importlib_metadata/importlib_metadata.egg-info/top_level.txt
rename : third_party/python/jsonschema/jsonschema-3.2.0.dist-info/COPYING => third_party/python/jsonschema/COPYING
rename : third_party/python/jsonschema/jsonschema-3.2.0.dist-info/entry_points.txt => third_party/python/jsonschema/jsonschema.egg-info/entry_points.txt
rename : third_party/python/jsonschema/jsonschema-3.2.0.dist-info/top_level.txt => third_party/python/jsonschema/jsonschema.egg-info/top_level.txt
rename : third_party/python/pep487/pep487/__init__.py => third_party/python/pep487/lib/pep487/__init__.py
rename : third_party/python/pep487/pep487/version.py => third_party/python/pep487/lib/pep487/version.py
extra : moz-landing-system : lando
2020-03-11 15:27:21 +00:00
..
.github Bug 1619555 - Add the missing sources to vendored python libs. r=ahal 2020-03-11 15:27:21 +00:00
jsonschema Bug 1619555 - Add the missing sources to vendored python libs. r=ahal 2020-03-11 15:27:21 +00:00
jsonschema.egg-info Bug 1619555 - Add the missing sources to vendored python libs. r=ahal 2020-03-11 15:27:21 +00:00
.appveyor.yml Bug 1619555 - Add the missing sources to vendored python libs. r=ahal 2020-03-11 15:27:21 +00:00
.coveragerc Bug 1619555 - Add the missing sources to vendored python libs. r=ahal 2020-03-11 15:27:21 +00:00
.gitignore Bug 1619555 - Add the missing sources to vendored python libs. r=ahal 2020-03-11 15:27:21 +00:00
.travis.yml Bug 1619555 - Add the missing sources to vendored python libs. r=ahal 2020-03-11 15:27:21 +00:00
CHANGELOG.rst Bug 1619555 - Add the missing sources to vendored python libs. r=ahal 2020-03-11 15:27:21 +00:00
COPYING Bug 1619555 - Add the missing sources to vendored python libs. r=ahal 2020-03-11 15:27:21 +00:00
DEMO.ipynb Bug 1619555 - Add the missing sources to vendored python libs. r=ahal 2020-03-11 15:27:21 +00:00
MANIFEST.in Bug 1619555 - Add the missing sources to vendored python libs. r=ahal 2020-03-11 15:27:21 +00:00
PKG-INFO Bug 1619555 - Add the missing sources to vendored python libs. r=ahal 2020-03-11 15:27:21 +00:00
README.rst Bug 1619555 - Add the missing sources to vendored python libs. r=ahal 2020-03-11 15:27:21 +00:00
codecov.yml Bug 1619555 - Add the missing sources to vendored python libs. r=ahal 2020-03-11 15:27:21 +00:00
demo.yml Bug 1619555 - Add the missing sources to vendored python libs. r=ahal 2020-03-11 15:27:21 +00:00
pyproject.toml Bug 1619555 - Add the missing sources to vendored python libs. r=ahal 2020-03-11 15:27:21 +00:00
setup.cfg Bug 1619555 - Add the missing sources to vendored python libs. r=ahal 2020-03-11 15:27:21 +00:00
setup.py Bug 1619555 - Add the missing sources to vendored python libs. r=ahal 2020-03-11 15:27:21 +00:00
test-requirements.txt Bug 1619555 - Add the missing sources to vendored python libs. r=ahal 2020-03-11 15:27:21 +00:00
tox.ini Bug 1619555 - Add the missing sources to vendored python libs. r=ahal 2020-03-11 15:27:21 +00:00

README.rst

==========
jsonschema
==========

|PyPI| |Pythons| |Travis| |AppVeyor| |Codecov| |ReadTheDocs|

.. |PyPI| image:: https://img.shields.io/pypi/v/jsonschema.svg
   :alt: PyPI version
   :target: https://pypi.org/project/jsonschema/

.. |Pythons| image:: https://img.shields.io/pypi/pyversions/jsonschema.svg
   :alt: Supported Python versions
   :target: https://pypi.org/project/jsonschema/

.. |Travis| image:: https://travis-ci.com/Julian/jsonschema.svg?branch=master
   :alt: Travis build status
   :target: https://travis-ci.com/Julian/jsonschema

.. |AppVeyor| image:: https://ci.appveyor.com/api/projects/status/adtt0aiaihy6muyn/branch/master?svg=true
   :alt: AppVeyor build status
   :target: https://ci.appveyor.com/project/Julian/jsonschema

.. |Codecov| image:: https://codecov.io/gh/Julian/jsonschema/branch/master/graph/badge.svg
   :alt: Codecov Code coverage
   :target: https://codecov.io/gh/Julian/jsonschema

.. |ReadTheDocs| image:: https://readthedocs.org/projects/python-jsonschema/badge/?version=stable&style=flat
   :alt: ReadTheDocs status
   :target: https://python-jsonschema.readthedocs.io/en/stable/


``jsonschema`` is an implementation of `JSON Schema <https://json-schema.org>`_
for Python (supporting 2.7+ including Python 3).

.. code-block:: python

    >>> from jsonschema import validate

    >>> # A sample schema, like what we'd get from json.load()
    >>> schema = {
    ...     "type" : "object",
    ...     "properties" : {
    ...         "price" : {"type" : "number"},
    ...         "name" : {"type" : "string"},
    ...     },
    ... }

    >>> # If no exception is raised by validate(), the instance is valid.
    >>> validate(instance={"name" : "Eggs", "price" : 34.99}, schema=schema)

    >>> validate(
    ...     instance={"name" : "Eggs", "price" : "Invalid"}, schema=schema,
    ... )                                   # doctest: +IGNORE_EXCEPTION_DETAIL
    Traceback (most recent call last):
        ...
    ValidationError: 'Invalid' is not of type 'number'

It can also be used from console:

.. code-block:: bash

    $ jsonschema -i sample.json sample.schema

Features
--------

* Full support for
  `Draft 7 <https://python-jsonschema.readthedocs.io/en/latest/validate/#jsonschema.Draft7Validator>`_,
  `Draft 6 <https://python-jsonschema.readthedocs.io/en/latest/validate/#jsonschema.Draft6Validator>`_,
  `Draft 4 <https://python-jsonschema.readthedocs.io/en/latest/validate/#jsonschema.Draft4Validator>`_
  and
  `Draft 3 <https://python-jsonschema.readthedocs.io/en/latest/validate/#jsonschema.Draft3Validator>`_

* `Lazy validation <https://python-jsonschema.readthedocs.io/en/latest/validate/#jsonschema.IValidator.iter_errors>`_
  that can iteratively report *all* validation errors.

* `Programmatic querying <https://python-jsonschema.readthedocs.io/en/latest/errors/>`_
  of which properties or items failed validation.


Installation
------------

``jsonschema`` is available on `PyPI <https://pypi.org/project/jsonschema/>`_. You can install using `pip <https://pip.pypa.io/en/stable/>`_:

.. code-block:: bash

    $ pip install jsonschema


Demo
----

Try ``jsonschema`` interactively in this online demo:

.. image:: https://user-images.githubusercontent.com/1155573/56745335-8b158a00-6750-11e9-8776-83fa675939c4.png
    :target: https://notebooks.ai/demo/gh/Julian/jsonschema
    :alt: Open Live Demo


Online demo Notebook will look similar to this:


.. image:: https://user-images.githubusercontent.com/1155573/56820861-5c1c1880-6823-11e9-802a-ce01c5ec574f.gif
    :alt: Open Live Demo
    :width: 480 px


Release Notes
-------------

v3.1 brings support for ECMA 262 dialect regular expressions
throughout schemas, as recommended by the specification. Big
thanks to @Zac-HD for authoring support in a new `js-regex
<https://pypi.org/project/js-regex/>`_ library.


Running the Test Suite
----------------------

If you have ``tox`` installed (perhaps via ``pip install tox`` or your
package manager), running ``tox`` in the directory of your source
checkout will run ``jsonschema``'s test suite on all of the versions
of Python ``jsonschema`` supports. If you don't have all of the
versions that ``jsonschema`` is tested under, you'll likely want to run
using ``tox``'s ``--skip-missing-interpreters`` option.

Of course you're also free to just run the tests on a single version with your
favorite test runner. The tests live in the ``jsonschema.tests`` package.


Benchmarks
----------

``jsonschema``'s benchmarks make use of `pyperf
<https://pyperf.readthedocs.io>`_.

Running them can be done via ``tox -e perf``, or by invoking the ``pyperf``
commands externally (after ensuring that both it and ``jsonschema`` itself are
installed)::

    $ python -m pyperf jsonschema/benchmarks/test_suite.py --hist --output results.json

To compare to a previous run, use::

    $ python -m pyperf compare_to --table reference.json results.json

See the ``pyperf`` documentation for more details.


Community
---------

There's a `mailing list <https://groups.google.com/forum/#!forum/jsonschema>`_
for this implementation on Google Groups.

Please join, and feel free to send questions there.


Contributing
------------

I'm Julian Berman.

``jsonschema`` is on `GitHub <https://github.com/Julian/jsonschema>`_.

Get in touch, via GitHub or otherwise, if you've got something to contribute,
it'd be most welcome!

You can also generally find me on Freenode (nick: ``tos9``) in various
channels, including ``#python``.

If you feel overwhelmingly grateful, you can also woo me with beer money
via Google Pay with the email in my GitHub profile.

And for companies who appreciate ``jsonschema`` and its continued support
and growth, ``jsonschema`` is also now supportable via `TideLift
<https://tidelift.com/subscription/pkg/pypi-jsonschema?utm_source=pypi-j
sonschema&utm_medium=referral&utm_campaign=readme>`_.