Install & Compatibility
Where this runs
tested against v1.1.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 20.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.2s · import 0.000s · 22MB
19MB installed
● package 19MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
load
✓ from json5 import load
✗ from json_five.codec import JSON5Codec
loads
✓ from json5 import loads
dump
✓ from json5 import dump
Basic usage: parse JSON5 string, round-trip with comments, and dump with indentation.
from json_five import loads, dumps
# Parse JSON5 string (supports comments, trailing commas, etc.)
data = '''{
"name": "Alice",
// This is a comment
"age": 30,
}'''
parsed = loads(data)
print(parsed) # {'name': 'Alice', 'age': 30}
# Round-trip with comments preserved (using codec)
from json_five.codec import JSON5Codec
codec = JSON5Codec()
obj = codec.decode(data)
print(codec.encode(obj)) # includes comments
# Dump without indentation (default)
print(dumps(parsed)) # {"name":"Alice","age":30}
# Dump with indentation
print(dumps(parsed, indent=2))
Upgrade
Version history
1.1.2latest on PyPI · released Jun 11, 2024
Audit
Dependencies
slyrequiredParser implementation dependency, with compatibility fixed in v0.8.0