pg.object_utils.to_json#

Accessible via pg.object_utils.to_json.

to_json(value, **kwargs)[source]#

Serializes a (maybe) JSONConvertible value into a plain Python object.

Return type:

Any

Parameters:
  • value

    value to serialize. Applicable value types are:

    • Builtin python types: None, bool, int, float, string;

    • JSONConvertible types;

    • List types;

    • Tuple types;

    • Dict types.

  • **kwargs – Keyword arguments to pass to value.to_json if value is JSONConvertible.

Returns:

JSON value.