canonical_json#

scikitplot.agent.canonical_json(value)[source]#

Return the canonical JSON text of a plain value.

Keys are sorted, separators carry no whitespace, non-ASCII text is kept as is, and NaN or infinity raise.

Parameters:
valueobject

A value plain accepts.

Returns:
str
Parameters:

value (Any)

Return type:

str

Examples

>>> from scikitplot.agent._canonical import canonical_json
>>> canonical_json({"b": 1, "a": [True, None]})
'{"a":[true,null],"b":1}'