jsonyx is a customizable JSON manipulator for Python
3.10+. It is written in pure Python with an optional C extension for better
performance and no dependencies
- JSON decoding, encoding and patching
- Pretty printing:
{ "foo": [1, 2, 3], "bar": {"a": 1, "b": 2, "c": 3} }
- Optionally supports these JSON deviations using jsonyx.allow:{ /* Block */ // and line comments "Decimal numbers": [1.0000000000000001, 1e400], "Duplicate keys": {"key": "value 1", "key": "value 2"}, "Missing commas": [1 2 3], "NaN and infinity": [NaN, Infinity, -Infinity], "Surrogates": "\ud800", "Trailing comma": [0,], "Unquoted keys": {key: "value"} } 
- Detailed error messages:
Traceback (most recent call last): File "C:\Users\wanne\Downloads\broken.json", line 2, column 15-19 "path": "c:\users" ^^^^ jsonyx.JSONSyntaxError: Expecting 4 hex digits
- Dedicated functions for reading and writing files and pretty printing
The documentation for jsonyx is available online at:
https://jsonyx.readthedocs.io/en/stable/usage.html