METADATA 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. Metadata-Version: 2.1
  2. Name: jsonschema
  3. Version: 3.2.0
  4. Summary: An implementation of JSON Schema validation for Python
  5. Home-page: https://github.com/Julian/jsonschema
  6. Author: Julian Berman
  7. Author-email: Julian@GrayVines.com
  8. License: UNKNOWN
  9. Project-URL: Docs, https://python-jsonschema.readthedocs.io/en/latest/
  10. Platform: UNKNOWN
  11. Classifier: Development Status :: 5 - Production/Stable
  12. Classifier: Intended Audience :: Developers
  13. Classifier: License :: OSI Approved :: MIT License
  14. Classifier: Operating System :: OS Independent
  15. Classifier: Programming Language :: Python
  16. Classifier: Programming Language :: Python :: 2
  17. Classifier: Programming Language :: Python :: 2.7
  18. Classifier: Programming Language :: Python :: 3
  19. Classifier: Programming Language :: Python :: 3.5
  20. Classifier: Programming Language :: Python :: 3.6
  21. Classifier: Programming Language :: Python :: 3.7
  22. Classifier: Programming Language :: Python :: 3.8
  23. Classifier: Programming Language :: Python :: Implementation :: CPython
  24. Classifier: Programming Language :: Python :: Implementation :: PyPy
  25. Requires-Dist: attrs (>=17.4.0)
  26. Requires-Dist: pyrsistent (>=0.14.0)
  27. Requires-Dist: setuptools
  28. Requires-Dist: six (>=1.11.0)
  29. Requires-Dist: functools32 ; python_version < "3"
  30. Requires-Dist: importlib-metadata ; python_version < "3.8"
  31. Provides-Extra: format
  32. Requires-Dist: idna ; extra == 'format'
  33. Requires-Dist: jsonpointer (>1.13) ; extra == 'format'
  34. Requires-Dist: rfc3987 ; extra == 'format'
  35. Requires-Dist: strict-rfc3339 ; extra == 'format'
  36. Requires-Dist: webcolors ; extra == 'format'
  37. Provides-Extra: format_nongpl
  38. Requires-Dist: idna ; extra == 'format_nongpl'
  39. Requires-Dist: jsonpointer (>1.13) ; extra == 'format_nongpl'
  40. Requires-Dist: webcolors ; extra == 'format_nongpl'
  41. Requires-Dist: rfc3986-validator (>0.1.0) ; extra == 'format_nongpl'
  42. Requires-Dist: rfc3339-validator ; extra == 'format_nongpl'
  43. ==========
  44. jsonschema
  45. ==========
  46. |PyPI| |Pythons| |Travis| |AppVeyor| |Codecov| |ReadTheDocs|
  47. .. |PyPI| image:: https://img.shields.io/pypi/v/jsonschema.svg
  48. :alt: PyPI version
  49. :target: https://pypi.org/project/jsonschema/
  50. .. |Pythons| image:: https://img.shields.io/pypi/pyversions/jsonschema.svg
  51. :alt: Supported Python versions
  52. :target: https://pypi.org/project/jsonschema/
  53. .. |Travis| image:: https://travis-ci.com/Julian/jsonschema.svg?branch=master
  54. :alt: Travis build status
  55. :target: https://travis-ci.com/Julian/jsonschema
  56. .. |AppVeyor| image:: https://ci.appveyor.com/api/projects/status/adtt0aiaihy6muyn/branch/master?svg=true
  57. :alt: AppVeyor build status
  58. :target: https://ci.appveyor.com/project/Julian/jsonschema
  59. .. |Codecov| image:: https://codecov.io/gh/Julian/jsonschema/branch/master/graph/badge.svg
  60. :alt: Codecov Code coverage
  61. :target: https://codecov.io/gh/Julian/jsonschema
  62. .. |ReadTheDocs| image:: https://readthedocs.org/projects/python-jsonschema/badge/?version=stable&style=flat
  63. :alt: ReadTheDocs status
  64. :target: https://python-jsonschema.readthedocs.io/en/stable/
  65. ``jsonschema`` is an implementation of `JSON Schema <https://json-schema.org>`_
  66. for Python (supporting 2.7+ including Python 3).
  67. .. code-block:: python
  68. >>> from jsonschema import validate
  69. >>> # A sample schema, like what we'd get from json.load()
  70. >>> schema = {
  71. ... "type" : "object",
  72. ... "properties" : {
  73. ... "price" : {"type" : "number"},
  74. ... "name" : {"type" : "string"},
  75. ... },
  76. ... }
  77. >>> # If no exception is raised by validate(), the instance is valid.
  78. >>> validate(instance={"name" : "Eggs", "price" : 34.99}, schema=schema)
  79. >>> validate(
  80. ... instance={"name" : "Eggs", "price" : "Invalid"}, schema=schema,
  81. ... ) # doctest: +IGNORE_EXCEPTION_DETAIL
  82. Traceback (most recent call last):
  83. ...
  84. ValidationError: 'Invalid' is not of type 'number'
  85. It can also be used from console:
  86. .. code-block:: bash
  87. $ jsonschema -i sample.json sample.schema
  88. Features
  89. --------
  90. * Full support for
  91. `Draft 7 <https://python-jsonschema.readthedocs.io/en/latest/validate/#jsonschema.Draft7Validator>`_,
  92. `Draft 6 <https://python-jsonschema.readthedocs.io/en/latest/validate/#jsonschema.Draft6Validator>`_,
  93. `Draft 4 <https://python-jsonschema.readthedocs.io/en/latest/validate/#jsonschema.Draft4Validator>`_
  94. and
  95. `Draft 3 <https://python-jsonschema.readthedocs.io/en/latest/validate/#jsonschema.Draft3Validator>`_
  96. * `Lazy validation <https://python-jsonschema.readthedocs.io/en/latest/validate/#jsonschema.IValidator.iter_errors>`_
  97. that can iteratively report *all* validation errors.
  98. * `Programmatic querying <https://python-jsonschema.readthedocs.io/en/latest/errors/>`_
  99. of which properties or items failed validation.
  100. Installation
  101. ------------
  102. ``jsonschema`` is available on `PyPI <https://pypi.org/project/jsonschema/>`_. You can install using `pip <https://pip.pypa.io/en/stable/>`_:
  103. .. code-block:: bash
  104. $ pip install jsonschema
  105. Demo
  106. ----
  107. Try ``jsonschema`` interactively in this online demo:
  108. .. image:: https://user-images.githubusercontent.com/1155573/56745335-8b158a00-6750-11e9-8776-83fa675939c4.png
  109. :target: https://notebooks.ai/demo/gh/Julian/jsonschema
  110. :alt: Open Live Demo
  111. Online demo Notebook will look similar to this:
  112. .. image:: https://user-images.githubusercontent.com/1155573/56820861-5c1c1880-6823-11e9-802a-ce01c5ec574f.gif
  113. :alt: Open Live Demo
  114. :width: 480 px
  115. Release Notes
  116. -------------
  117. v3.1 brings support for ECMA 262 dialect regular expressions
  118. throughout schemas, as recommended by the specification. Big
  119. thanks to @Zac-HD for authoring support in a new `js-regex
  120. <https://pypi.org/project/js-regex/>`_ library.
  121. Running the Test Suite
  122. ----------------------
  123. If you have ``tox`` installed (perhaps via ``pip install tox`` or your
  124. package manager), running ``tox`` in the directory of your source
  125. checkout will run ``jsonschema``'s test suite on all of the versions
  126. of Python ``jsonschema`` supports. If you don't have all of the
  127. versions that ``jsonschema`` is tested under, you'll likely want to run
  128. using ``tox``'s ``--skip-missing-interpreters`` option.
  129. Of course you're also free to just run the tests on a single version with your
  130. favorite test runner. The tests live in the ``jsonschema.tests`` package.
  131. Benchmarks
  132. ----------
  133. ``jsonschema``'s benchmarks make use of `pyperf
  134. <https://pyperf.readthedocs.io>`_.
  135. Running them can be done via ``tox -e perf``, or by invoking the ``pyperf``
  136. commands externally (after ensuring that both it and ``jsonschema`` itself are
  137. installed)::
  138. $ python -m pyperf jsonschema/benchmarks/test_suite.py --hist --output results.json
  139. To compare to a previous run, use::
  140. $ python -m pyperf compare_to --table reference.json results.json
  141. See the ``pyperf`` documentation for more details.
  142. Community
  143. ---------
  144. There's a `mailing list <https://groups.google.com/forum/#!forum/jsonschema>`_
  145. for this implementation on Google Groups.
  146. Please join, and feel free to send questions there.
  147. Contributing
  148. ------------
  149. I'm Julian Berman.
  150. ``jsonschema`` is on `GitHub <https://github.com/Julian/jsonschema>`_.
  151. Get in touch, via GitHub or otherwise, if you've got something to contribute,
  152. it'd be most welcome!
  153. You can also generally find me on Freenode (nick: ``tos9``) in various
  154. channels, including ``#python``.
  155. If you feel overwhelmingly grateful, you can also woo me with beer money
  156. via Google Pay with the email in my GitHub profile.
  157. And for companies who appreciate ``jsonschema`` and its continued support
  158. and growth, ``jsonschema`` is also now supportable via `TideLift
  159. <https://tidelift.com/subscription/pkg/pypi-jsonschema?utm_source=pypi-j
  160. sonschema&utm_medium=referral&utm_campaign=readme>`_.