compas.utilities.DataEncoder

class compas.utilities.DataEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: json.encoder.JSONEncoder

Data encoder for custom JSON serialization with support for COMPAS data structures and geometric primitives.

Notes

In the context of Remote Procedure Calls,

Methods

default(o)

Implement this method in a subclass such that it returns a serializable object for o, or calls the base implementation (to raise a TypeError).

encode(o)

Return a JSON string representation of a Python data structure.

iterencode(o[, _one_shot])

Encode the given object and yield each string representation as available.

Attributes

item_separator

key_separator