{"id":13725647,"url":"https://github.com/rpkilby/jsonfield","last_synced_at":"2026-10-19T15:18:00.068Z","repository":{"id":560369,"uuid":"191265","full_name":"rpkilby/jsonfield","owner":"rpkilby","description":"A reusable Django model field for storing ad-hoc JSON data","archived":false,"fork":false,"pushed_at":"2025-07-04T23:04:43.000Z","size":236,"stargazers_count":1159,"open_issues_count":0,"forks_count":266,"subscribers_count":33,"default_branch":"master","last_synced_at":"2026-10-11T00:15:13.051Z","etag":null,"topics":["django","json","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rpkilby.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2009-05-03T03:42:01.000Z","updated_at":"2026-10-09T17:48:17.000Z","dependencies_parsed_at":"2024-01-08T23:03:12.894Z","dependency_job_id":"9e32ca0c-4c4c-405a-9f2b-e3bae7ad9d0b","html_url":"https://github.com/rpkilby/jsonfield","commit_stats":{"total_commits":299,"total_committers":53,"mean_commits":"5.6415094339622645","dds":0.6254180602006689,"last_synced_commit":"cb749a8e5de019c88349a184c2863429923b767f"},"previous_names":["bradjasper/django-jsonfield","dmkoch/django-jsonfield"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/rpkilby/jsonfield","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpkilby%2Fjsonfield","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpkilby%2Fjsonfield/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpkilby%2Fjsonfield/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpkilby%2Fjsonfield/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rpkilby","download_url":"https://codeload.github.com/rpkilby/jsonfield/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpkilby%2Fjsonfield/sbom","scorecard":{"id":250305,"data":{"date":"2025-08-11","repo":{"name":"github.com/rpkilby/jsonfield","commit":"157aa9219c0e66469edcb8e4ff51d8ac47d092c1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.5,"checks":[{"name":"Maintained","score":10,"reason":"9 commit(s) and 5 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":1,"reason":"Found 2/14 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/rpkilby/jsonfield/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/rpkilby/jsonfield/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/rpkilby/jsonfield/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/rpkilby/jsonfield/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:65: update your workflow using https://app.stepsecurity.io/secureworkflow/rpkilby/jsonfield/main.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/main.yml:54","Warn: pipCommand not pinned by hash: .github/workflows/main.yml:31","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   2 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 3.0.0 not signed: https://api.github.com/repos/rpkilby/jsonfield/releases/23698647","Warn: release artifact 2.0.2 not signed: https://api.github.com/repos/rpkilby/jsonfield/releases/6749876","Warn: release artifact 2.0.1 not signed: https://api.github.com/repos/rpkilby/jsonfield/releases/5682012","Warn: release artifact 2.0.0 not signed: https://api.github.com/repos/rpkilby/jsonfield/releases/5652542","Warn: release artifact 3.0.0 does not have provenance: https://api.github.com/repos/rpkilby/jsonfield/releases/23698647","Warn: release artifact 2.0.2 does not have provenance: https://api.github.com/repos/rpkilby/jsonfield/releases/6749876","Warn: release artifact 2.0.1 does not have provenance: https://api.github.com/repos/rpkilby/jsonfield/releases/5682012","Warn: release artifact 2.0.0 does not have provenance: https://api.github.com/repos/rpkilby/jsonfield/releases/5652542"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T08:18:57.318Z","repository_id":560369,"created_at":"2025-08-17T08:18:57.318Z","updated_at":"2025-08-17T08:18:57.318Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":343843146,"owners_count":38246801,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-12T02:00:06.297Z","response_time":96,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","json","python"],"created_at":"2024-08-03T01:02:30.160Z","updated_at":"2026-10-19T15:18:00.036Z","avatar_url":"https://github.com/rpkilby.png","language":"Python","funding_links":[],"categories":["Python","Django Utilities"],"sub_categories":[],"readme":"jsonfield\n=========\n\n.. image:: https://github.com/rpkilby/jsonfield/actions/workflows/main.yml/badge.svg\n  :target: https://github.com/rpkilby/jsonfield/actions/workflows/main.yml\n.. image:: https://codecov.io/gh/rpkilby/jsonfield/graph/badge.svg\n  :target: https://codecov.io/gh/rpkilby/jsonfield\n.. image:: https://img.shields.io/pypi/l/jsonfield.svg\n  :target: https://pypi.org/project/jsonfield\n.. image:: https://img.shields.io/pypi/v/jsonfield.svg\n  :target: https://pypi.org/project/jsonfield\n.. image:: https://img.shields.io/pypi/pyversions/jsonfield.svg\n  :target: https://pypi.org/project/jsonfield\n\n**jsonfield** is a reusable model field that allows you to store validated JSON, automatically handling\nserialization to and from the database. To use, add ``jsonfield.JSONField`` to one of your models.\n\n\nDeprecation \u0026 Migration to Django's native ``JSONField``\n--------------------------------------------------------\n\nDjango 3.1 `introduced`_ a native ``JSONField`` that supports all database backends. As such, this package is\nconsidered deprecated and will be archived in the future. Existing projects should migrate to Django's implemenation.\n\n.. _introduced: https://docs.djangoproject.com/en/stable/releases/3.1/#jsonfield-for-all-supported-database-backends\n\n\nMigrating from ``jsonfield.JSONField`` to ``models.JSONField`` *should* generally be straightforward. After swapping\nfield classes, ``python manage.py migrate`` will generate ``AlterField`` operations that should correctly migrate\nyour field data. However, if this does not work for your case, you will instead need to create a data migration.\nThe process will roughly look like:\n\n* Rename ``\u003cfield\u003e`` to ``old_\u003cfield\u003e``, create migration.\n* Add a nullable ``\u003cfield\u003e = models.JSONField(null=True, ...)``, create migration.\n* Create an empty migration file, add  ``RunPython`` operation that reserializes\n  the ``old_\u003cfield\u003e`` data into the new ``\u003cfield\u003e``.\n* Update ``\u003cfield\u003e`` to not nullable, delete ``old_\u003cfield\u003e``, create migration.\n* Manually combine the operations into a single migration file.\n\nExamples can be found in the `migration-example`_ project.\n\n.. _migration-example: https://github.com/rpkilby/jsonfield/tree/master/migration-example/\n\n\nInstallation\n------------\n\n.. code-block:: python\n\n    pip install jsonfield\n\n\nUsage\n-----\n\n.. code-block:: python\n\n    from django.db import models\n    from jsonfield import JSONField\n\n    class MyModel(models.Model):\n        json = JSONField()\n\n\nQuerying\n--------\n\nAs stated above, ``JSONField`` is not intended to provide extended querying capabilities.\nThat said, you may perform the same basic lookups provided by regular text fields (e.g.,\n``exact`` or ``regex`` lookups). Since values are stored as serialized JSON, it is highly\nrecommended that you test your queries to ensure the expected results are returned.\n\n\nHandling null values\n--------------------\n\nA model field's ``null`` argument typically controls whether null values may be stored in\nits column by setting a not-null constraint. However, because ``JSONField`` serializes its\nvalues (including nulls), this option instead controls *how* null values are persisted. If\n``null=True``, then nulls are **not** serialized and are stored as a null value in the\ndatabase. If ``null=False``, then the null is instead stored in its serialized form.\n\nThis in turn affects how null values may be queried. Both fields support exact matching:\n\n.. code-block:: python\n\n    MyModel.objects.filter(json=None)\n\nHowever, if you want to use the ``isnull`` lookup, you must set ``null=True``.\n\n.. code-block:: python\n\n    class MyModel(models.Model):\n        json = JSONField(null=True)\n\n    MyModel.objects.filter(json__isnull=True)\n\nNote that as ``JSONField.null`` does not prevent nulls from being stored, achieving this\nmust instead be handled with a validator.\n\n\nAdvanced Usage\n--------------\n\nBy default python deserializes json into dict objects. This behavior differs from the standard json\nbehavior  because python dicts do not have ordered keys. To overcome this limitation and keep the\nsort order of OrderedDict keys the deserialisation can be adjusted on model initialisation:\n\n.. code-block:: python\n\n    import collections\n\n    class MyModel(models.Model):\n        json = JSONField(load_kwargs={'object_pairs_hook': collections.OrderedDict})\n\n\nOther Fields\n------------\n\n**jsonfield.JSONCharField**\n\nSubclasses **models.CharField** instead of **models.TextField**.\n\n\nRunning the tests\n-----------------\n\nThe test suite requires ``tox``.\n\n.. code-block:: shell\n\n    $ pip install tox\n\n\nThen, run the ``tox`` command, which will run all test jobs.\n\n.. code-block:: shell\n\n    $ tox\n\nOr, to test just one job (for example Django 5.2 on Python 3.13):\n\n.. code-block:: shell\n\n    $ tox -e py313-django52\n\n\nRelease Process\n---------------\n\n* Update changelog\n* Update package version in setup.py\n* Check supported versions in setup.py and readme\n* Create git tag for version\n* Upload release to PyPI test server\n* Upload release to official PyPI server\n\n.. code-block:: shell\n\n    $ pip install -U pip setuptools wheel twine\n    $ rm -rf dist/ build/\n    $ python setup.py sdist bdist_wheel\n    $ twine upload -r test dist/*\n    $ twine upload dist/*\n\n\nChanges\n-------\n\nTake a look at the `changelog`_.\n\n.. _changelog: https://github.com/rpkilby/jsonfield/blob/master/CHANGES.rst\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frpkilby%2Fjsonfield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frpkilby%2Fjsonfield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frpkilby%2Fjsonfield/lists"}