JSON with Comments for Python
Project description
JSON with Comments for Python
Features
load()
,loads()
- Remove single line (
//
) and block comments (/* */
) - Remove trailing commas from arrays and objects
- Remove single line (
dump()
,dumps()
- Add comments
- Add trailing commas
Usage
pip install json-with-comments
>>> import jsonc
>>> jsonc.loads("{// comment \n}")
{}
>>> jsonc.loads("{/* comment */}")
{}
>>> jsonc.loads('{"spam": "ham // egg" /* comment */}')
{'spam': 'ham // egg'}
>>> jsonc.loads('{"spam": /* comment */"ham /* egg */"}')
{'spam': 'ham /* egg */'}
And just like json
module
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
Close
Hashes for json_with_comments-1.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bab39b76c3850d87b2f4a649b6c9aadaeca847559c54b2ab8c78ae69c6d04e9c |
|
MD5 | 3b2dedf0029ffa2b99b7ec095f3f49a4 |
|
BLAKE2b-256 | 07b56811761ed6ab36fba90ea063a92b8ad699ce7c9c73254625b5480312c1c0 |