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.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8850d49ba61bb70d643097ea9ddfa3dcd605d0d0446151bba11ebc5adc9add87 |
|
MD5 | 07e7833e4bae47fb1b140575f941e4cf |
|
BLAKE2b-256 | c5180669e4d997f06cf1a4d29aa42b38fd03a36ed9160deab43c4d18a73b39b6 |