Formatted JSON output
A module that provides a custom JSON encoder for JSON-like data structures, that is more compact than the default encoder but still readable.
- class CompactEncoder(*args: Any, **kwargs: Any)[source]
Bases:
JSONEncoderJSONEncoder can be used as cls argument to json.dump and json.dumps. It creates formatted JSON strings, with indentation that are more compact than the dafault formatting from json module. The main difference is that the lists of primitives are not split into multiple lines.