pyjson5
JSON5 serializer and parser for Python 3 written in Cython.
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, production-stable, has no dependencies, supports current Python versions, carries no known vulnerabilities, and solves a real problem—parsing lenient JSON5 and generating HTML-safe JSON output. Install it if you need JSON5 support or HTML-safe serialization; otherwise the standard json module suffices.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.8 or later; CPython 3.8+ or recent PyPy3 version needed.
- Medium install friction due to compiled wheels; actively maintained with recent commits and stable production status.
- No runtime dependencies simplifies deployment.
License · maintenance · safety
MIT OR Apache-2.0 (permissive) — Dual-licensed under MIT or Apache-2.0 (permissive); you may choose either license for your use, with no restrictions on commercial or proprietary projects.
last release 2026-05-15 (91 days) · last repo commit 2026-08-04 · 179 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,759,922 downloads/mo, #2,901 on PyPI
Alternatives
Verify before relying
pip install pyjson5
import pyjson5
data = pyjson5.loads('{a: 1, b: 2}') # Parse JSON5
result = pyjson5.dumps(data) # Serialize to JSON- Performance characteristics compared to standard json module for typical workloads
- Specific nesting depth limit before 'absurdly high' threshold is reached
- Whether HTML-safe escaping is applied by default or requires explicit configuration
What it is and what it does
pyjson5 is a JSON5 parser and serializer written in Cython for Python 3. JSON5 is a more permissive variant of JSON that allows unquoted keys, trailing commas, comments, and other relaxations of strict JSON syntax. The library also handles standard JSON, making it a potential drop-in replacement for Python's built-in json module.
The serializer produces ASCII output with apostrophes, ampersands, and angle brackets encoded as Unicode escapes, making it safe for direct use in HTML templates without additional escaping. The parser handles all valid JSON5 1.0.0 and JSON data. The package has no runtime dependencies and supports Python 3.8 through 3.14, including recent CPython free-threading beta support.
Use it for
- Parse configuration files in JSON5 format that allow comments and unquoted keys
- Serialize Python objects to JSON for embedding directly in HTML templates without HTML-escaping vulnerabilities
- Handle JSON data with trailing commas or other JSON5 relaxations from external sources
- Replace the standard json module when lenient parsing of JSON-like input is needed
- Generate JSON output safe for use in JavaScript contexts within web pages
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, production-stable, has no dependencies, supports current Python versions, carries no known vulnerabilities, and solves a real problem—parsing lenient JSON5 and generating HTML-safe JSON output. Install it if you need JSON5 support or HTML-safe serialization; otherwise the standard json module suffices.
Install
pyjson5 on PyPI
Before you install
Medium install friction due to compiled wheels; actively maintained with recent commits and stable production status. No runtime dependencies simplifies deployment.
Requires Python 3.8 or later; CPython 3.8+ or recent PyPy3 version needed.
License in practice
Dual-licensed under MIT or Apache-2.0 (permissive); you may choose either license for your use, with no restrictions on commercial or proprietary projects.
Quickstart
pip install pyjson5
import pyjson5
data = pyjson5.loads('{a: 1, b: 2}') # Parse JSON5
result = pyjson5.dumps(data) # Serialize to JSON
Verify before relying
- Performance characteristics compared to standard json module for typical workloads
- Specific nesting depth limit before 'absurdly high' threshold is reached
- Whether HTML-safe escaping is applied by default or requires explicit configuration
Package facts
| License | MIT OR Apache-2.0 permissive |
| Python support | Supports the current Python release ~=3.8 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 91 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,759,922 / month, #2,901 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: System AdministratorsOperating System :: OS IndependentProgramming Language :: CythonProgramming Language :: JavaScriptProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Free Threading :: 2 - BetaProgramming Language :: Python :: Implementation :: CPythonTopic :: Text Processing :: General |
Evidence: pyjson5-2.0.1-cp310-cp310-macosx_10_9_universal2.whl; pyjson5-2.0.1-cp310-cp310-macosx_10_9_x86_64.whl; pyjson5-2.0.1-cp310-cp310-macosx_11_0_arm64.whl; pyjson5-2.0.1-cp310-cp310-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl; pyjson5-2.0.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; pyjson5-2.0.1-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl; pyjson5-2.0.1-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl; pyjson5-2.0.1-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl; pyjson5-2.0.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; pyjson5-2.0.1-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl; pyjson5-2.0.1-cp310-cp310-musllinux_1_2_aarch64.whl; pyjson5-2.0.1-cp310-cp310-musllinux_1_2_armv7l.whl; pyjson5-2.0.1-cp310-cp310-musllinux_1_2_i686.whl; pyjson5-2.0.1-cp310-cp310-musllinux_1_2_ppc64le.whl; pyjson5-2.0.1-cp310-cp310-musllinux_1_2_riscv64.whl; pyjson5-2.0.1-cp310-cp310-musllinux_1_2_s390x.whl; pyjson5-2.0.1-cp310-cp310-musllinux_1_2_x86_64.whl; pyjson5-2.0.1-cp310-cp310-win32.whl; pyjson5-2.0.1-cp310-cp310-win_amd64.whl; pyjson5-2.0.1-cp310-cp310-win_arm64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “json5 parser python”
- pyjson5Parses and serializes JSON5 (a more lenient JSON variant) and…
- json-fiveParses and serializes JSON5 (an extended JSON format with comments,…
- json5kitParses JSON5 (JSON with comments, trailing commas, unquoted keys)…
Give your agent the search over MCP, or paste the wish link into any chat.
More General packages
A drop-in replacement for Python's standard `re` module that adds advanced regex features like nested sets, fuzzy matching, lookaround in conditionals, and full Unicode case-folding while maintaining backward compatibility.
Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.
Sphinx generates professional documentation from reStructuredText source files, producing HTML, PDF, EPUB, and other formats with automatic cross-references, code highlighting, and hierarchical navigation.
Lark is a parsing library that builds abstract syntax trees from context-free grammars, supporting multiple parsing algorithms (Earley, LALR(1), CYK) with automatic line and column tracking.
NLTK is a Python library for natural language processing tasks including tokenization, parsing, tagging, and linguistic analysis, with built-in datasets and educational resources.
Install it if you need foundational NLP tools, linguistic datasets, or are learning the field; consider specialized libraries (spaCy, transformers) if you need…
Converts numbers, dates, times, and file sizes into human-readable text formats, with support for fuzzy durations like "3 minutes ago" and localization to multiple languages.
Install it if you need to display human-readable numbers, durations, or sizes to end users.
See also json5 · simplejson · json-five · numpyencoder · py-ubjson · partialjson · json5kit · flask-orjson · chompjs · ytsaurus-yson