json5
A Python implementation of the JSON5 data format.
Install
json5 on PyPI
pip
pip install json5uv
uv add json5poetry
poetry add json5Package facts
| License | Files: Everything except for the benchmarks/*.json files. Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1.… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.8.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 55 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: json5-0.15.0-py3-none-any.whl
Keywords: json5
About json5
from the package's own PyPI description — quoted content, verbatim
pyjson5
A Python implementation of the JSON5 data format.
JSON5 extends the JSON data interchange format to make it slightly more usable as a configuration language:
-
JavaScript-style comments (both single and multi-line) are legal.
-
Object keys may be unquoted if they are legal ECMAScript identifiers
-
Objects and arrays may end with trailing commas.
-
Strings can be single-quoted, and multi-line string literals are allowed.
There are a few other more minor extensions to JSON; see the above page for the full details.
This project implements a reader and writer implementation for Python; where possible, it mirrors the standard Python JSON API package for ease of use.
There is one notable difference from the JSON api: the load() and
loads() methods support optionally checking for (and rejecting) duplicate
object keys; pass allow_duplicate_keys=False to do so (duplicates are
allowed by default).
This is an early release. It has been reasonably well-tested, but it is SLOW. It can be 1000-6000x slower than the C-optimized JSON module, and is 200x slower (or more) than...
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
Parses and serializes JSON5, a relaxed JSON format that allows comments, unquoted keys, trailing commas, and single-quoted strings for use as a configuration language.
Installs cleanly with no runtime dependencies. Actively maintained with a recent release (55 days ago) and steady repository activity. Supports Python 3.8–3.14.
Licensed under Apache License 2.0 (permissive), allowing commercial and derivative use with attribution. Benchmark files use MIT licenses; no restrictions on production use.
Usage
import json5
data = json5.loads('{key: "value", // comment\n}')
print(data)
json5.dumps(data, indent=2)
Performance caveat: the implementation is 200–6000× slower than the standard json module; unsuitable for high-throughput parsing.
Verdict: A well-maintained, permissively licensed JSON5 implementation suitable for parsing relaxed JSON in configuration workflows. Zero dependencies and broad Python version support make it easy to integrate. However, its documented performance limitation (200–6000× slower than json) means it should be reserved for configuration files and non-performance-critical use cases.
Needs verification
- Whether the performance penalty is acceptable for your configuration file sizes and parsing frequency.
- Whether the `allow_duplicate_keys` parameter and other API extensions meet your validation requirements.
Similar packages
permissive · top 1,000 on PyPI
ujsonpermissive · top 1,000 on PyPI
hatchlingpermissive · top 100 on PyPI
aiofilepermissive · top 1,000 on PyPI
requests-toolbeltpermissive · top 1,000 on PyPI
overridespermissive · top 1,000 on PyPI
msgpackpermissive · top 1,000 on PyPI
diff-coverpermissive · top 1,000 on PyPI
iniconfigpermissive · top 100 on PyPI
json-repairpermissive · top 1,000 on PyPI