here.platform.schema.parser module
here.platform.schema.parser module
HERE Platform Parser module
class here.platform.schema.parser.Parser
Bases: ABC
Base class for parsing data of a catalog layer partition.
LAYER_DESCRIPTORS = 'layer.fds'
LAYER_MANIFEST = 'layer.manifest.json'
static extract_layer_info(input_zip: str | Path | BytesIO) Tuple[dict | None, bytes | None]
Extract layer info from an input zipfile.
Parameters:
input_zip – input Protobuf schema zipfile
Returns:
content of the layer manifest and descriptor set
abstract parse_message(message: bytes) Message | dict
Parse a message and returns the corresponding partition class instance.
Parameters:
message – message received as blob
Returns:
parsed message
abstract serialize_bytes(data: Message | dict) bytes
Parse a message and returns the bytes.
Parameters:
data – message
Returns:
bytes