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.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48b51b5099dd5a0152c431fa05d574adbb9146955f0d799544dcecef06fb88c6 |
|
MD5 | 934ee1c9ea4470f79b0a1e7ad2e5194e |
|
BLAKE2b-256 | 89dd5e2333aee280dfa5f21fcd5d7f440053ba467805cb331f695466c1619740 |