module documentation

Support for JSON.

Class JSONToNestedText Undocumented
Class NestedTextToJSON Undocumented
Function NTTError_from_JSONDecodeError Undocumented
Constant EXTENSIONS Undocumented
Constant SUBCOMMANDS Undocumented
Function _json_loads Wrap json.loads so that on failure it tries parsing as JSON Lines.
@NTTError_from.register
@docstring_for_NTTError_from
def NTTError_from_JSONDecodeError(exc: JSONDecodeError) -> NTTError: (source)

Undocumented

EXTENSIONS: tuple[str, ...] = (source)

Undocumented

Value
('json', 'jsonl')
SUBCOMMANDS = (source)

Undocumented

Value
{'nt2': {'app': NestedTextToJSON, 'names': ('json')},
 '2nt': {'app': JSONToNestedText, 'names': ('json')}}
def _json_loads(content: str) -> JSONData: (source)

Wrap json.loads so that on failure it tries parsing as JSON Lines.

# noqa: DAR401 # noqa: DAR402

Parameters
content:strJSON or JSON Lines content.
Returns
JSONDataParsed JSON data as a JSON-supported type, usually dict or list.
Raises
JSONDecodeErrorUnable to parse content as JSON or JSONLines.