--- id: json-five version: "1.1.2" license: Apache license_treatment: permissive maintenance: active --- # json-five — A JSON5 parser that, among other features, supports round-trip preservation of comments License: permissive · Maintenance: active · Downloads: 143.9K/mo ## What it is and what it does json-five is a JSON5 parser and serializer for Python that extends standard JSON handling to support JSON5—a relaxed JSON format allowing comments, unquoted object keys, trailing commas, and other conveniences. It provides two main interfaces: a simple loads/dumps API mirroring the standard library's json module, and a lower-level abstract model API for advanced use cases like linting, formatting, and custom serialization. The package is designed to preserve non-data elements (comments, formatting, identifier styles) during round-trip operations, so you can load JSON5, modify it programmatically, and dump it back while keeping the original structure intact. It depends on sly and regex and is actively maintained with support for Python 3.8 through 3.11. Use it for: - Load configuration files written in JSON5 format with comments and relaxed syntax into Python dictionaries. - Build linters or formatters that parse JSON5 and preserve comments and formatting during output. - Edit JSON5 documents programmatically using the abstract model API while maintaining original comments and structure. - Tokenize JSON5 input for custom analysis or validation workflows. - Work with JSON5 documents that use unquoted identifiers and other relaxed syntax features. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses and serializes JSON5 (an extended JSON format with comments, unquoted keys, and trailing commas) with an interface similar to Python's standard json module, plus support for round-trip preservation of comments and formatting. Yes. The package is actively maintained, has low install friction, carries a permissive Apache license, and fills a genuine gap for JSON5 support in Python. It is well-suited for configuration parsing and round-trip editing. The abstract model API is marked unstable, so avoid it if you need long-term compatibility guarantees, but the core loads/dumps interface is stable as of v1.0.0. ## Install pip install json-five uv add json-five poetry add json-five ## Installing json-five Before you install: Low friction: pure Python wheel, two lightweight runtime dependencies (sly and regex), and active maintenance with a recent commit on 2026-07-27. Supports Python 3.8 and later versions. License in practice: Apache License (permissive): you can use this package in commercial and private projects without restriction, though you must include a copy of the license and state any modifications. Quickstart: pip install json-five import json5 json_text = '{foo: "bar"} // comment' data = json5.loads(json_text) print(data) Requires Python 3.8 or later; the import name is json5, not json_five. Verify before relying: - Performance characteristics when parsing large JSON5 files or deeply nested structures. - Stability guarantees for the abstract model API beyond v1.0.0 (marked subject to breaking changes in minor releases). - Real-world usage patterns and community feedback on the model-based loader for linting and formatting workflows. ## Package facts - License: Apache (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 143.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags json5 parser python, parse json with comments, json5 loader serializer, preserve comments json, unquoted keys json parser, round-trip json editing, json5 format support, json-parser, configuration-format, comment-preservation [View on SkillFed](https://skillfed.io/packages/json-five) · [View on PyPI](https://pypi.org/project/json-five/)