Decoding JSONC

Better JSON tools provide new ways of loading JSON files.

A collection of tools for working with JSON, JSONC files and JSON-like data structures.

load_jsonc(jsonc_path: Union[Path, str]) JSONWalker[source]

Loads JSONC file into a JSON walker object.

A module that provides a parser for JSON with C-style comments.

class JSONCDecoder(*args, **kwargs)[source]

Bases: JSONDecoder

JSONDecoder with support for C-style comments. Similar to JSONC files from Visual Studio code but without support for trailing commas.

JSONCDecoder can be used in cls argument of json.load and json.loads of startdard Python module - json.

decode(s, _w=<built-in method match of re.Pattern object>, _ws=' \t\n\r', _ilcs='//', _ilc=<built-in method match of re.Pattern object>, _mlcs='/*', _mlc=<built-in method match of re.Pattern object>)[source]

Return the Python representation of s (a str instance containing a JSON document).