JSON with Comments for Python
Project description
JSON with Comments for Python
Features
- Remove single line (
//
) and block comments (/* */
) - Remove trailing commas from arrays and objects
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.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97b2f74dc865c852e3fffa23ac284c5a5cc5e50bb9e5477eecd183aa0d0b4a10 |
|
MD5 | 69b67933041945b71c098fe35341afe8 |
|
BLAKE2b-256 | b159d6d88430c924d5fe5fad552f9166d71cdc0ab2ff9ff16d44abc68947bcb0 |