__init__.py 934 B

12345678910111213141516171819202122232425262728293031323334
  1. """
  2. An implementation of JSON Schema for Python
  3. The main functionality is provided by the validator classes for each of the
  4. supported JSON Schema versions.
  5. Most commonly, `validate` is the quickest way to simply validate a given
  6. instance under a schema, and will create a validator for you.
  7. """
  8. from jsonschema.exceptions import (
  9. ErrorTree, FormatError, RefResolutionError, SchemaError, ValidationError
  10. )
  11. from jsonschema._format import (
  12. FormatChecker,
  13. draft3_format_checker,
  14. draft4_format_checker,
  15. draft6_format_checker,
  16. draft7_format_checker,
  17. )
  18. from jsonschema._types import TypeChecker
  19. from jsonschema.validators import (
  20. Draft3Validator,
  21. Draft4Validator,
  22. Draft6Validator,
  23. Draft7Validator,
  24. RefResolver,
  25. validate,
  26. )
  27. try:
  28. from importlib import metadata
  29. except ImportError: # for Python<3.8
  30. import importlib_metadata as metadata
  31. __version__ = metadata.version("jsonschema")