Scripts.DatabankLib.jsonEncoders module

class Scripts.DatabankLib.jsonEncoders.CompactJSONEncoder(*args, **kwargs)[source]

Bases: JSONEncoder

A JSON Encoder that puts small containers on single lines.

CONTAINER_TYPES = (<class 'list'>, <class 'tuple'>, <class 'dict'>)

Container datatypes include primitives or other containers.

MAX_WIDTH = 150

Maximum width of a container that might be put on a single line.

MAX_ITEMS = 10

Maximum number of items in container that might be put on single line.

encode(o)[source]

Encode JSON object o with respect to single line lists.

iterencode(o, **kwargs)[source]

Required to also work with json.dump.

property indent_str: str