A JSON5 parser that, among other features, supports round-trip preservation of comments
Project description
json-five
JSON5 for Python
Installation
pip install json-five
This project requires Python 3.6 or newer.
Usage
NOTE: the import name is different from the install name (sorry, many were taken already)
>>> import json5
>>> json_text = """{ // This is a JSON5 comment
"foo": "bar" /* this is a JSON5 block
comment that can span lines /*
"bacon": "eggs"
}
"""
>>> json5.loads(json_text)
{"foo": "bar", "bacon": "eggs"}
See also the full documentation
Key features
- Supports the JSON5 spec
- Supports similar interfaces to stdlib
json
module - Supports round-trip preservation of comments
- Tries to find all syntax errors at once (instead of raising on the first error encountered)
Status
This project is still in early stages of development. Check the issues page to see known bugs and unimplemented features.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
json-five-0.2.5.tar.gz
(14.8 kB
view hashes)
Built Distribution
json_five-0.2.5-py3-none-any.whl
(15.8 kB
view hashes)
Close
Hashes for json_five-0.2.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9a26002939070a2ba052c1d66d931d36c97fbadb97454e5a6a76d6c2d3e65ad |
|
MD5 | d0b45955f5b405792c7b67a8b43af944 |
|
BLAKE2b-256 | 78ef7689e48445f714839f17f20239162492efdbb26f334082edea4c4f0c5c50 |