You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

137 lines
4.5 KiB

4 years ago
  1. Metadata-Version: 2.0
  2. Name: jsonschema
  3. Version: 2.6.0
  4. Summary: An implementation of JSON Schema validation for Python
  5. Home-page: http://github.com/Julian/jsonschema
  6. Author: Julian Berman
  7. Author-email: Julian@GrayVines.com
  8. License: MIT
  9. Platform: UNKNOWN
  10. Classifier: Development Status :: 5 - Production/Stable
  11. Classifier: Intended Audience :: Developers
  12. Classifier: License :: OSI Approved :: MIT License
  13. Classifier: Operating System :: OS Independent
  14. Classifier: Programming Language :: Python
  15. Classifier: Programming Language :: Python :: 2
  16. Classifier: Programming Language :: Python :: 2.7
  17. Classifier: Programming Language :: Python :: 3
  18. Classifier: Programming Language :: Python :: 3.5
  19. Classifier: Programming Language :: Python :: Implementation :: CPython
  20. Classifier: Programming Language :: Python :: Implementation :: PyPy
  21. Requires-Dist: functools32; python_version=='2.7'
  22. Provides-Extra: format
  23. Requires-Dist: rfc3987; extra == 'format'
  24. Requires-Dist: strict-rfc3339; extra == 'format'
  25. Requires-Dist: webcolors; extra == 'format'
  26. .. image:: https://img.shields.io/pypi/v/jsonschema.svg
  27. :target: https://pypi.python.org/pypi/jsonschema
  28. .. image:: https://travis-ci.org/Julian/jsonschema.svg?branch=master
  29. :target: https://travis-ci.org/Julian/jsonschema
  30. .. image:: https://img.shields.io/pypi/l/jsonschema.svg
  31. :target: https://pypi.python.org/pypi/jsonschema
  32. ==========
  33. jsonschema
  34. ==========
  35. ``jsonschema`` is an implementation of `JSON Schema <http://json-schema.org>`_
  36. for Python (supporting 2.7+ including Python 3).
  37. .. code-block:: python
  38. >>> from jsonschema import validate
  39. >>> # A sample schema, like what we'd get from json.load()
  40. >>> schema = {
  41. ... "type" : "object",
  42. ... "properties" : {
  43. ... "price" : {"type" : "number"},
  44. ... "name" : {"type" : "string"},
  45. ... },
  46. ... }
  47. >>> # If no exception is raised by validate(), the instance is valid.
  48. >>> validate({"name" : "Eggs", "price" : 34.99}, schema)
  49. >>> validate(
  50. ... {"name" : "Eggs", "price" : "Invalid"}, schema
  51. ... ) # doctest: +IGNORE_EXCEPTION_DETAIL
  52. Traceback (most recent call last):
  53. ...
  54. ValidationError: 'Invalid' is not of type 'number'
  55. It can also be used from console:
  56. .. code-block:: bash
  57. $ jsonschema -i sample.json sample.schema
  58. Features
  59. --------
  60. * Full support for
  61. `Draft 3 <https://python-jsonschema.readthedocs.io/en/latest/validate/#jsonschema.Draft3Validator>`_
  62. **and** `Draft 4 <https://python-jsonschema.readthedocs.io/en/latest/validate/#jsonschema.Draft4Validator>`_
  63. of the schema.
  64. * `Lazy validation <https://python-jsonschema.readthedocs.io/en/latest/validate/#jsonschema.IValidator.iter_errors>`_
  65. that can iteratively report *all* validation errors.
  66. * Small and extensible
  67. * `Programmatic querying <https://python-jsonschema.readthedocs.io/en/latest/errors/#module-jsonschema>`_
  68. of which properties or items failed validation.
  69. Release Notes
  70. -------------
  71. Version 2.5.0 is mainly a performance release. The interface for `RefResolver`
  72. was extended to add methods that improve performance on CPython.
  73. Support for custom `RefResolver` objects with the legacy interface should *not*
  74. be affected. If you notice something amiss please file an issue ticket.
  75. Running the Test Suite
  76. ----------------------
  77. If you have ``tox`` installed (perhaps via ``pip install tox`` or your
  78. package manager), running``tox`` in the directory of your source checkout will
  79. run ``jsonschema``'s test suite on all of the versions of Python ``jsonschema``
  80. supports. Note that you'll need to have all of those versions installed in
  81. order to run the tests on each of them, otherwise ``tox`` will skip (and fail)
  82. the tests on that version.
  83. Of course you're also free to just run the tests on a single version with your
  84. favorite test runner. The tests live in the ``jsonschema.tests`` package.
  85. Community
  86. ---------
  87. There's a `mailing list <https://groups.google.com/forum/#!forum/jsonschema>`_
  88. for this implementation on Google Groups.
  89. Please join, and feel free to send questions there.
  90. Contributing
  91. ------------
  92. I'm Julian Berman.
  93. ``jsonschema`` is on `GitHub <http://github.com/Julian/jsonschema>`_.
  94. Get in touch, via GitHub or otherwise, if you've got something to contribute,
  95. it'd be most welcome!
  96. You can also generally find me on Freenode (nick: ``tos9``) in various
  97. channels, including ``#python``.
  98. If you feel overwhelmingly grateful, you can woo me with beer money on
  99. `Gittip <https://www.gittip.com/Julian/>`_ or via Google Wallet with the email
  100. in my GitHub profile.