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
jsonmodule - 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file json-five-0.7.5.tar.gz.
File metadata
- Download URL: json-five-0.7.5.tar.gz
- Upload date:
- Size: 15.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70889f9eb7eaf2405dbefdac7f65947f86ee769636638cf15cd1cb62d689de64
|
|
| MD5 |
cec65b68a2bd493774de26235bd397f0
|
|
| BLAKE2b-256 |
db79484d0c816a70c97bcca2ed4ac73e97ae7892dbeca797d1206db92d2f97bf
|
File details
Details for the file json_five-0.7.5-py3-none-any.whl.
File metadata
- Download URL: json_five-0.7.5-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e070ef55cf2c86381a1004ce4f280d0209ce5a71c485dc4ca7b7d3590cf59c9f
|
|
| MD5 |
674fcf25e5b470778501818d3eb5ed21
|
|
| BLAKE2b-256 |
f11bede564d7ae282fc3d2138c17dd60d1456642e64c75478e7589e0193a2ca8
|