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.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d30198127a9b53eb1b3a3a8c365668458f15e63885d1659b34660dd2c2caa8ef |
|
MD5 | eb21c1eedf75ec5b1cd9b6889fce33d9 |
|
BLAKE2b-256 | 213f5b197d18fad9b722da95afefb29654205a1971fdf1c525736a93094a045c |