remove_comments

emlib.jsontools.remove_comments(json_like)[source]

Removes C-style comments from json_like and returns the result. Example:

>>> test_json = r'''
... {
...    "foo": "bar", // This is a single-line comment
...    "baz": "blah" /* Multi-line
...    Comment */
... }'''
>>> remove_comments('{"foo":"bar","baz":"blah",}')
'{

“foo”:”bar”, “baz”:”blah”

}’