weboob.tools.application.formatters.json

class weboob.tools.application.formatters.json.JsonFormatter

Bases: weboob.tools.application.formatters.iformatter.IFormatter

Formats the whole list as a single JSON list object.

flush()
format_collection(collection, only)

Format a collection to be human-readable.

Parameters:collection (BaseCollection) – collection to format
Return type:str
format_dict(item)

Format a dict to be human-readable.

Parameters:obj (dict) – dict to format
Return type:str
class weboob.tools.application.formatters.json.JsonLineFormatter(display_keys=True, display_header=True, outfile=None)

Bases: weboob.tools.application.formatters.iformatter.IFormatter

Formats the list as received, with a JSON object per line. The advantage is that it can be streamed.

format_dict(item)

Format a dict to be human-readable.

Parameters:obj (dict) – dict to format
Return type:str