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\\n
Download source from Pypi
python setup.py install
import json
from jsoncomment import JsonComment
string = "[]"
parser = JsonComment(json)
parsed_object = parser.loads(string)
Added in the /examples directory
Dando Real ITA @ Steam Profile