A wrapper to JSON parsers allowing comments and multiline strings
Python 2.7, 3.3
ujson 1.30+
JSON Comment allows to parse JSON files or strings with:
This package works with any JSON parser which supports:
load(fp, ...) to parse filesloads(s, ...) to parse stringsby adding a preprocessor to these calls.
# and ; are for single line comments/* and */ enclose multiline commentsInline comments are not supported
Any string can be multiline, even object keys.
""", like in python\\npip install jsoncomment
OR
python setup.py installimport json
from jsoncomment import JsonComment
string = "[]"
parser = JsonComment(json)
parsed_object = parser.loads(string)
Added in the /examples directory
Source code available with MIT license on Bitbucket.
Dando Real ITA @ Steam Profile