tiled.media_type_registration.SerializationRegistry.register

SerializationRegistry.register(structure_family, media_type, func)[source]

Register a new media_type for a structure family.

Parameters
structure_familystr

The structure we are encoding, as in “array”, “dataframe”, “variable”, …

media_typestr

MIME type, as in “application/json” or “text/csv”. If there is not standard name, use “application/x-INVENT-NAME-HERE”.

funccallable

Should accept the relevant structure as input (e.g. a numpy array) and return bytes or memoryview