jsonschema

An implementation of the JSON Schema specification for Python

https://github.com/python-jsonschema/jsonschema

Science Score: 46.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    5 of 117 committers (4.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.6%) to scientific vocabulary

Keywords

json json-schema jsonschema schema validation

Keywords from Contributors

closember pallets templates unit-testing parsing distributed packaging notebook asyncio wsgi
Last synced: 6 months ago · JSON representation

Repository

An implementation of the JSON Schema specification for Python

Basic Info
Statistics
  • Stars: 4,832
  • Watchers: 56
  • Forks: 594
  • Open Issues: 46
  • Releases: 67
Topics
json json-schema jsonschema schema validation
Created about 14 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing Funding License Security

README.rst

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

|PyPI| |Pythons| |CI| |ReadTheDocs| |Precommit| |Zenodo|

.. |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/

.. |CI| image:: https://github.com/python-jsonschema/jsonschema/workflows/CI/badge.svg
  :alt: Build status
  :target: https://github.com/python-jsonschema/jsonschema/actions?query=workflow%3ACI

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

.. |Precommit| image:: https://results.pre-commit.ci/badge/github/python-jsonschema/jsonschema/main.svg
   :alt: pre-commit.ci status
   :target: https://results.pre-commit.ci/latest/github/python-jsonschema/jsonschema/main

.. |Zenodo| image:: https://zenodo.org/badge/3072629.svg
   :alt: Zenodo DOI
   :target: https://zenodo.org/badge/latestdoi/3072629


``jsonschema`` is an implementation of the `JSON Schema `_ specification for Python.

.. code:: 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 the command line by installing `check-jsonschema `_.

Features
--------

* Full support for `Draft 2020-12 `_, `Draft 2019-09 `_, `Draft 7 `_, `Draft 6 `_, `Draft 4 `_ and `Draft 3 `_

* `Lazy validation `_ that can iteratively report *all* validation errors.

* `Programmatic querying `_ of which properties or items failed validation.


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

``jsonschema`` is available on `PyPI `_. You can install using `pip `_:

.. code:: bash

    $ pip install jsonschema


Extras
======

Two extras are available when installing the package, both currently related to ``format`` validation:

    * ``format``
    * ``format-nongpl``

They can be used when installing in order to include additional dependencies, e.g.:

.. code:: bash

    $ pip install jsonschema'[format]'

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).
Please read the `format validation documentation `_ for further details.

.. start cut from PyPI

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

If you have ``nox`` installed (perhaps via ``pipx install nox`` or your package manager), running ``nox`` 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 ``nox``'s ``--no-error-on-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 `_.
Running them can be done via::

      $ nox -s perf


Community
---------

The JSON Schema specification has `a Slack `_, with an `invite link on its home page `_.
Many folks knowledgeable on authoring schemas can be found there.

Otherwise, opening a `GitHub discussion `_ or asking questions on Stack Overflow are other means of getting help if you're stuck.

.. end cut from PyPI


About
-----

I'm Julian Berman.

``jsonschema`` is on `GitHub `_.

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

If you feel overwhelmingly grateful, you can also `sponsor me `_.

And for companies who appreciate ``jsonschema`` and its continued support and growth, ``jsonschema`` is also now supportable via `TideLift `_.

Owner

  • Name: Python + JSON Schema
  • Login: python-jsonschema
  • Kind: organization

JSON Schema implementation and surrounding tooling for Python

GitHub Events

Total
  • Create event: 35
  • Release event: 2
  • Issues event: 45
  • Watch event: 203
  • Delete event: 28
  • Issue comment event: 91
  • Push event: 62
  • Pull request review event: 6
  • Pull request review comment event: 10
  • Pull request event: 75
  • Fork event: 19
Last Year
  • Create event: 35
  • Release event: 2
  • Issues event: 45
  • Watch event: 203
  • Delete event: 28
  • Issue comment event: 91
  • Push event: 62
  • Pull request review event: 6
  • Pull request review comment event: 10
  • Pull request event: 75
  • Fork event: 19

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 2,453
  • Total Committers: 117
  • Avg Commits per committer: 20.966
  • Development Distribution Score (DDS): 0.239
Past Year
  • Commits: 100
  • Committers: 9
  • Avg Commits per committer: 11.111
  • Development Distribution Score (DDS): 0.56
Top Committers
Name Email Commits
Julian Berman J****n@G****m 1,866
pre-commit-ci[bot] 6****] 88
Chase Sterling c****g@g****m 84
RomainTT r****n@t****r 38
Harald Nezbeda hn@n****m 35
dependabot[bot] 4****] 18
Norman Hooper n****r@v****m 17
Stephen Rosen s****n@g****g 16
willson-chen w****x@g****m 15
davkor d****d@a****m 14
Opemipo Ogunkola o****s@l****m 12
Glenn Maynard g****n@z****g 12
Ben Smithers b****s@b****k 9
Colin Dunklau c****u@g****m 9
Kai A. Hiller g****t@k****e 9
Martin Zugnoni m****i@g****m 9
Hillel Arnold h****d@h****m 7
Daniel Nephin d****n@g****m 7
Daniël van Noord 1****d 6
Dmitry Dygalo d****y@d****v 6
ApamNapat b****a@g****m 5
Bouke Haarsma b****e@h****u 5
John Anderson s****k@g****m 5
Talha Malik t****k@T****l 4
johnthagen j****n@g****m 4
Alexander Bayandin a****n@g****m 4
Joep van Dijken j****3@g****m 4
Hynek Schlawack hs@o****x 4
Gabriel Le Breton l****l@g****m 4
apiraino a****o 4
and 87 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 230
  • Total pull requests: 227
  • Average time to close issues: 4 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 191
  • Total pull request authors: 39
  • Average comments per issue: 3.44
  • Average comments per pull request: 1.09
  • Merged pull requests: 159
  • Bot issues: 0
  • Bot pull requests: 162
Past Year
  • Issues: 36
  • Pull requests: 98
  • Average time to close issues: 2 days
  • Average time to close pull requests: 4 days
  • Issue authors: 31
  • Pull request authors: 14
  • Average comments per issue: 1.17
  • Average comments per pull request: 0.31
  • Merged pull requests: 64
  • Bot issues: 0
  • Bot pull requests: 77
Top Authors
Issue Authors
  • Julian (10)
  • ikonst (6)
  • Zac-HD (4)
  • ssbarnea (3)
  • kloczek (3)
  • hackowitz-af (3)
  • eirnym (2)
  • philvarner (2)
  • nitg16 (2)
  • pierrecamilleri (2)
  • braingram (2)
  • eslavich (2)
  • sirosen (2)
  • Vidminas (2)
  • jvtm (2)
Pull Request Authors
  • pre-commit-ci[bot] (136)
  • dependabot[bot] (26)
  • DanielNoord (4)
  • ilia1243 (4)
  • sirosen (4)
  • hackowitz-af (4)
  • Julian (3)
  • dodslaser (2)
  • ikonst (2)
  • atsuoishimoto (2)
  • spacether (2)
  • jfchoquette (2)
  • otto-ifak (2)
  • rominf (2)
  • BarakOshri (2)
Top Labels
Issue Labels
Invalid (38) Enhancement (29) Bug (26) Error Reporting (18) Dialects v2 (15) Needs Simplification (7) Waiting for Author (4) Needs Test Upstream (2) Help Wanted (1) Pending Deprecation (1)
Pull Request Labels
dependencies (26) github_actions (26)

Packages

  • Total packages: 26
  • Total downloads:
    • pypi 257,800,291 last-month
    • homebrew 2 last-month
  • Total docker downloads: 4,409,884,115
  • Total dependent packages: 2,739
    (may contain duplicates)
  • Total dependent repositories: 111,659
    (may contain duplicates)
  • Total versions: 372
  • Total maintainers: 4
pypi.org: jsonschema

An implementation of JSON Schema validation for Python

  • Versions: 108
  • Dependent Packages: 2,406
  • Dependent Repositories: 108,834
  • Downloads: 257,800,291 Last month
  • Docker Downloads: 4,409,884,115
Rankings
Downloads: 0.0%
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Docker downloads count: 0.0%
Average: 0.7%
Stargazers count: 1.6%
Forks count: 2.9%
Maintainers (1)
Funding
  • https://github.com/sponsors/Julian
Last synced: 6 months ago
spack.io: py-jsonschema

Jsonschema: An(other) implementation of JSON Schema for Python.

  • Versions: 15
  • Dependent Packages: 36
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Average: 1.0%
Dependent packages count: 2.0%
Maintainers (1)
Last synced: about 1 year ago
alpine-v3.18: py3-jsonschema

An implementation of JSON Schema validation for Python

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 1.7%
Forks count: 3.1%
Stargazers count: 3.6%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.18: py3-jsonschema-pyc

Precompiled Python bytecode for py3-jsonschema

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 1.7%
Forks count: 3.1%
Stargazers count: 3.6%
Maintainers (1)
Last synced: 6 months ago
alpine-edge: py3-jsonschema

JSON Schema validation for Python

  • Versions: 17
  • Dependent Packages: 7
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 1.0%
Average: 2.2%
Stargazers count: 3.5%
Forks count: 4.2%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.17: py3-jsonschema

An implementation of JSON Schema validation for Python

  • Versions: 1
  • Dependent Packages: 14
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Average: 2.2%
Forks count: 2.8%
Dependent packages count: 2.9%
Stargazers count: 3.2%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: jsonschema

jsonschema is an implementation of JSON Schema for Python (supporting 2.7+ including Python 3)

  • Versions: 32
  • Dependent Packages: 219
  • Dependent Repositories: 1,402
Rankings
Dependent packages count: 0.3%
Dependent repos count: 0.5%
Average: 3.4%
Stargazers count: 5.7%
Forks count: 7.0%
Last synced: 6 months ago
alpine-edge: py3-jsonschema-pyc

Precompiled Python bytecode for py3-jsonschema

  • Versions: 17
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Stargazers count: 3.6%
Forks count: 4.3%
Average: 5.5%
Dependent packages count: 14.3%
Maintainers (1)
Last synced: 6 months ago
proxy.golang.org: github.com/python-jsonschema/jsonschema
  • Versions: 77
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Stargazers count: 1.0%
Forks count: 1.2%
Average: 5.6%
Dependent packages count: 9.6%
Dependent repos count: 10.8%
Last synced: 6 months ago
alpine-edge: py3-jsonschema417-pyc

Precompiled Python bytecode for py3-jsonschema417

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Stargazers count: 3.3%
Forks count: 4.0%
Average: 5.7%
Dependent packages count: 15.5%
Maintainers (1)
Last synced: 6 months ago
alpine-edge: py3-jsonschema417

An implementation of JSON Schema validation for Python

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Stargazers count: 3.3%
Forks count: 4.0%
Average: 5.7%
Dependent packages count: 15.5%
Maintainers (1)
Last synced: 6 months ago
anaconda.org: jsonschema

jsonschema is an implementation of JSON Schema for Python

  • Versions: 12
  • Dependent Packages: 44
  • Dependent Repositories: 1,402
Rankings
Dependent packages count: 0.8%
Dependent repos count: 2.9%
Average: 7.7%
Stargazers count: 12.7%
Forks count: 14.6%
Last synced: 6 months ago
conda-forge.org: jsonschema-with-format-nongpl
  • Versions: 19
  • Dependent Packages: 1
  • Dependent Repositories: 17
Rankings
Stargazers count: 5.7%
Forks count: 7.0%
Dependent repos count: 8.6%
Average: 12.6%
Dependent packages count: 29.0%
Last synced: 6 months ago
formulae.brew.sh: jsonschema

Implementation of JSON Schema for Python

  • Versions: 20
  • Dependent Packages: 11
  • Dependent Repositories: 4
  • Downloads: 2 Last month
Rankings
Dependent packages count: 2.6%
Forks count: 4.6%
Stargazers count: 6.5%
Average: 12.8%
Dependent repos count: 19.2%
Downloads: 31.0%
Last synced: 6 months ago
conda-forge.org: jsonschema-with-format
  • Versions: 19
  • Dependent Packages: 1
  • Dependent Repositories: 0
Rankings
Stargazers count: 5.2%
Forks count: 6.4%
Average: 18.6%
Dependent packages count: 28.8%
Dependent repos count: 34.0%
Last synced: 6 months ago
conda-forge.org: jsonschema-with-all
  • Versions: 19
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Stargazers count: 5.2%
Forks count: 6.4%
Average: 24.2%
Dependent repos count: 34.0%
Dependent packages count: 51.2%
Last synced: 6 months ago
alpine-v3.21: py3-jsonschema-pyc

Precompiled Python bytecode for py3-jsonschema

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.19: py3-jsonschema

JSON Schema validation for Python

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Last synced: 6 months ago
alpine-v3.19: py3-jsonschema-pyc

Precompiled Python bytecode for py3-jsonschema

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Last synced: 6 months ago
alpine-v3.21: py3-jsonschema

JSON Schema validation for Python

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.22: py3-jsonschema

JSON Schema validation for Python

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.22: py3-jsonschema417

An implementation of JSON Schema validation for Python

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.20: py3-jsonschema-pyc

Precompiled Python bytecode for py3-jsonschema

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.22: py3-jsonschema417-pyc

Precompiled Python bytecode for py3-jsonschema417

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.20: py3-jsonschema

JSON Schema validation for Python

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.22: py3-jsonschema-pyc

Precompiled Python bytecode for py3-jsonschema

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago

Dependencies

docs/requirements.in pypi
  • file *
  • furo *
  • lxml *
  • sphinx *
  • sphinx-autodoc-typehints *
  • sphinxcontrib-spelling *
docs/requirements.txt pypi
  • alabaster ==0.7.12
  • attrs ==21.4.0
  • babel ==2.10.3
  • beautifulsoup4 ==4.11.1
  • certifi ==2022.6.15
  • charset-normalizer ==2.1.0
  • docutils ==0.18.1
  • file *
  • furo ==2022.6.21
  • idna ==3.3
  • imagesize ==1.4.1
  • jinja2 ==3.1.2
  • lxml ==4.9.1
  • markupsafe ==2.1.1
  • packaging ==21.3
  • pyenchant ==3.2.2
  • pygments ==2.12.0
  • pyparsing ==3.0.9
  • pyrsistent ==0.18.1
  • pytz ==2022.1
  • requests ==2.28.1
  • snowballstemmer ==2.2.0
  • soupsieve ==2.3.2.post1
  • sphinx ==5.0.2
  • sphinx-autodoc-typehints ==1.18.3
  • sphinx-basic-ng ==0.0.1a12
  • sphinxcontrib-applehelp ==1.0.2
  • sphinxcontrib-devhelp ==1.0.2
  • sphinxcontrib-htmlhelp ==2.0.0
  • sphinxcontrib-jsmath ==1.0.1
  • sphinxcontrib-qthelp ==1.0.3
  • sphinxcontrib-serializinghtml ==1.1.5
  • sphinxcontrib-spelling ==7.6.0
  • urllib3 ==1.26.9
.github/workflows/ci.yml actions
  • actions/checkout v3 composite
  • actions/github-script v6 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
  • pre-commit/action v3.0.0 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/documentation-links.yml actions
  • readthedocs/actions/preview v1 composite
.github/workflows/fuzz.yml actions
  • actions/upload-artifact v3 composite
  • google/oss-fuzz/infra/cifuzz/actions/build_fuzzers master composite
  • google/oss-fuzz/infra/cifuzz/actions/run_fuzzers master composite
pyproject.toml pypi
  • attrs >=22.2.0
  • importlib_resources >=1.4.0;python_version<'3.9'
  • jsonschema-specifications >=2023.03.6
  • pkgutil_resolve_name >=1.3.10;python_version<'3.9'
  • referencing >=0.28.4
  • rpds-py >=0.7.1
json/package.json npm