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.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5bc9406767adf834e863d11c3622b8478c3c16b626308966bc6518fa6aa76b0 |
|
MD5 | 2005646f42d9641f88028df4191833c1 |
|
BLAKE2b-256 | ebe73196f99fda05228929caf564a448ccc6d83fa8f9c95641a418254c89dd15 |