METADATA 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. Metadata-Version: 2.3
  2. Name: jsonschema
  3. Version: 4.22.0
  4. Summary: An implementation of JSON Schema validation for Python
  5. Project-URL: Homepage, https://github.com/python-jsonschema/jsonschema
  6. Project-URL: Documentation, https://python-jsonschema.readthedocs.io/
  7. Project-URL: Issues, https://github.com/python-jsonschema/jsonschema/issues/
  8. Project-URL: Funding, https://github.com/sponsors/Julian
  9. Project-URL: Tidelift, https://tidelift.com/subscription/pkg/pypi-jsonschema?utm_source=pypi-jsonschema&utm_medium=referral&utm_campaign=pypi-link
  10. Project-URL: Changelog, https://github.com/python-jsonschema/jsonschema/blob/main/CHANGELOG.rst
  11. Project-URL: Source, https://github.com/python-jsonschema/jsonschema
  12. Author-email: Julian Berman <Julian+jsonschema@GrayVines.com>
  13. License: MIT
  14. License-File: COPYING
  15. Keywords: data validation,json,json schema,jsonschema,validation
  16. Classifier: Development Status :: 5 - Production/Stable
  17. Classifier: Intended Audience :: Developers
  18. Classifier: License :: OSI Approved :: MIT License
  19. Classifier: Operating System :: OS Independent
  20. Classifier: Programming Language :: Python
  21. Classifier: Programming Language :: Python :: 3.8
  22. Classifier: Programming Language :: Python :: 3.9
  23. Classifier: Programming Language :: Python :: 3.10
  24. Classifier: Programming Language :: Python :: 3.11
  25. Classifier: Programming Language :: Python :: 3.12
  26. Classifier: Programming Language :: Python :: Implementation :: CPython
  27. Classifier: Programming Language :: Python :: Implementation :: PyPy
  28. Classifier: Topic :: File Formats :: JSON
  29. Classifier: Topic :: File Formats :: JSON :: JSON Schema
  30. Requires-Python: >=3.8
  31. Requires-Dist: attrs>=22.2.0
  32. Requires-Dist: importlib-resources>=1.4.0; python_version < '3.9'
  33. Requires-Dist: jsonschema-specifications>=2023.03.6
  34. Requires-Dist: pkgutil-resolve-name>=1.3.10; python_version < '3.9'
  35. Requires-Dist: referencing>=0.28.4
  36. Requires-Dist: rpds-py>=0.7.1
  37. Provides-Extra: format
  38. Requires-Dist: fqdn; extra == 'format'
  39. Requires-Dist: idna; extra == 'format'
  40. Requires-Dist: isoduration; extra == 'format'
  41. Requires-Dist: jsonpointer>1.13; extra == 'format'
  42. Requires-Dist: rfc3339-validator; extra == 'format'
  43. Requires-Dist: rfc3987; extra == 'format'
  44. Requires-Dist: uri-template; extra == 'format'
  45. Requires-Dist: webcolors>=1.11; extra == 'format'
  46. Provides-Extra: format-nongpl
  47. Requires-Dist: fqdn; extra == 'format-nongpl'
  48. Requires-Dist: idna; extra == 'format-nongpl'
  49. Requires-Dist: isoduration; extra == 'format-nongpl'
  50. Requires-Dist: jsonpointer>1.13; extra == 'format-nongpl'
  51. Requires-Dist: rfc3339-validator; extra == 'format-nongpl'
  52. Requires-Dist: rfc3986-validator>0.1.0; extra == 'format-nongpl'
  53. Requires-Dist: uri-template; extra == 'format-nongpl'
  54. Requires-Dist: webcolors>=1.11; extra == 'format-nongpl'
  55. Description-Content-Type: text/x-rst
  56. ==========
  57. jsonschema
  58. ==========
  59. |PyPI| |Pythons| |CI| |ReadTheDocs| |Precommit| |Zenodo|
  60. .. |PyPI| image:: https://img.shields.io/pypi/v/jsonschema.svg
  61. :alt: PyPI version
  62. :target: https://pypi.org/project/jsonschema/
  63. .. |Pythons| image:: https://img.shields.io/pypi/pyversions/jsonschema.svg
  64. :alt: Supported Python versions
  65. :target: https://pypi.org/project/jsonschema/
  66. .. |CI| image:: https://github.com/python-jsonschema/jsonschema/workflows/CI/badge.svg
  67. :alt: Build status
  68. :target: https://github.com/python-jsonschema/jsonschema/actions?query=workflow%3ACI
  69. .. |ReadTheDocs| image:: https://readthedocs.org/projects/python-jsonschema/badge/?version=stable&style=flat
  70. :alt: ReadTheDocs status
  71. :target: https://python-jsonschema.readthedocs.io/en/stable/
  72. .. |Precommit| image:: https://results.pre-commit.ci/badge/github/python-jsonschema/jsonschema/main.svg
  73. :alt: pre-commit.ci status
  74. :target: https://results.pre-commit.ci/latest/github/python-jsonschema/jsonschema/main
  75. .. |Zenodo| image:: https://zenodo.org/badge/3072629.svg
  76. :alt: Zenodo DOI
  77. :target: https://zenodo.org/badge/latestdoi/3072629
  78. ``jsonschema`` is an implementation of the `JSON Schema <https://json-schema.org>`_ specification for Python.
  79. .. code:: python
  80. >>> from jsonschema import validate
  81. >>> # A sample schema, like what we'd get from json.load()
  82. >>> schema = {
  83. ... "type" : "object",
  84. ... "properties" : {
  85. ... "price" : {"type" : "number"},
  86. ... "name" : {"type" : "string"},
  87. ... },
  88. ... }
  89. >>> # If no exception is raised by validate(), the instance is valid.
  90. >>> validate(instance={"name" : "Eggs", "price" : 34.99}, schema=schema)
  91. >>> validate(
  92. ... instance={"name" : "Eggs", "price" : "Invalid"}, schema=schema,
  93. ... ) # doctest: +IGNORE_EXCEPTION_DETAIL
  94. Traceback (most recent call last):
  95. ...
  96. ValidationError: 'Invalid' is not of type 'number'
  97. It can also be used from the command line by installing `check-jsonschema <https://github.com/python-jsonschema/check-jsonschema>`_.
  98. Features
  99. --------
  100. * Full support for `Draft 2020-12 <https://python-jsonschema.readthedocs.io/en/latest/api/jsonschema/validators/#jsonschema.validators.Draft202012Validator>`_, `Draft 2019-09 <https://python-jsonschema.readthedocs.io/en/latest/api/jsonschema/validators/#jsonschema.validators.Draft201909Validator>`_, `Draft 7 <https://python-jsonschema.readthedocs.io/en/latest/api/jsonschema/validators/#jsonschema.validators.Draft7Validator>`_, `Draft 6 <https://python-jsonschema.readthedocs.io/en/latest/api/jsonschema/validators/#jsonschema.validators.Draft6Validator>`_, `Draft 4 <https://python-jsonschema.readthedocs.io/en/latest/api/jsonschema/validators/#jsonschema.validators.Draft4Validator>`_ and `Draft 3 <https://python-jsonschema.readthedocs.io/en/latest/api/jsonschema/validators/#jsonschema.validators.Draft3Validator>`_
  101. * `Lazy validation <https://python-jsonschema.readthedocs.io/en/latest/api/jsonschema/protocols/#jsonschema.protocols.Validator.iter_errors>`_ that can iteratively report *all* validation errors.
  102. * `Programmatic querying <https://python-jsonschema.readthedocs.io/en/latest/errors/>`_ of which properties or items failed validation.
  103. Installation
  104. ------------
  105. ``jsonschema`` is available on `PyPI <https://pypi.org/project/jsonschema/>`_. You can install using `pip <https://pip.pypa.io/en/stable/>`_:
  106. .. code:: bash
  107. $ pip install jsonschema
  108. Extras
  109. ======
  110. Two extras are available when installing the package, both currently related to ``format`` validation:
  111. * ``format``
  112. * ``format-nongpl``
  113. They can be used when installing in order to include additional dependencies, e.g.:
  114. .. code:: bash
  115. $ pip install jsonschema'[format]'
  116. Be aware that the mere presence of these dependencies – or even the specification of ``format`` checks in a schema – do *not* activate format checks (as per the specification).
  117. Please read the `format validation documentation <https://python-jsonschema.readthedocs.io/en/latest/validate/#validating-formats>`_ for further details.
  118. About
  119. -----
  120. I'm Julian Berman.
  121. ``jsonschema`` is on `GitHub <https://github.com/python-jsonschema/jsonschema>`_.
  122. Get in touch, via GitHub or otherwise, if you've got something to contribute, it'd be most welcome!
  123. You can also generally find me on Libera (nick: ``Julian``) in various channels, including ``#python``.
  124. If you feel overwhelmingly grateful, you can also `sponsor me <https://github.com/sponsors/Julian/>`_.
  125. 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-jsonschema&utm_medium=referral&utm_campaign=readme>`_.
  126. Release Information
  127. -------------------
  128. v4.22.0
  129. =======
  130. * Improve ``best_match`` (and thereby error messages from ``jsonschema.validate``) in cases where there are multiple *sibling* errors from applying ``anyOf`` / ``allOf`` -- i.e. when multiple elements of a JSON array have errors, we now do prefer showing errors from earlier elements rather than simply showing an error for the full array (#1250).
  131. * (Micro-)optimize equality checks when comparing for JSON Schema equality by first checking for object identity, as ``==`` would.