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 serialisation with support for COMPAS data structures and geometric primitives.
Notes
In the context of Remote Procedure Calls,
Methods
__init__
(*[, skipkeys, ensure_ascii, …])Constructor for JSONEncoder, with sensible defaults.
default
(o)Implement this method in a subclass such that it returns a serializable object for
o
, or calls the base implementation (to raise aTypeError
).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.