DataEncoder

class compas.data.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,

Inherited Attributes

item_separator

key_separator

Methods

default

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

Inherited Methods

encode

Return a JSON string representation of a Python data structure.

iterencode

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