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.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf269d65668bd72b5e2c0cc6bc6d8077ca6c8694c5cd806d9c46a63b1e681bb3 |
|
MD5 | a36fc0498c3cfda9adffe4d2645a60c6 |
|
BLAKE2b-256 | 1964f1fbea89126d4d6423ce1b0217e3b7adf6040e8501513f4f1c47ce9077e1 |