here.platform.schema.schema module#

HERE Platform Schema module

A schema contains the protobuf parsed schema and provides helper methods for working with the schema and decoding data to a protobuf Message or Python Dict.

class here.platform.schema.schema.Schema(schema_hrn: str, parser: Parser, platform_config: PlatformConfig)[source]#

Bases: object

A schema registered on the HERE platform.

decode_blob(data: bytes) Message | dict[source]#

Decode an encoded blob and returns the corresponding partition main message.

Parameters:

data – encoded content

Returns:

decoded message

decode_blob_by_fully_qualified_message_name(data: bytes, fully_qualified_message_name: str) Message | dict[source]#

Decode a protobuf-encoded blob by its fully_qualified_message_name class and returns the corresponding partition main message.

Parameters:
  • data – encoded protobuf content

  • fully_qualified_message_name – class name and its fully qualified message name

Returns:

decoded protobuf message

encode_blob(data: Message | dict) bytes[source]#

Encode Message and returns the corresponding bytes.

Parameters:

data – encoded content

Returns:

encoded bytes

open_in_portal()[source]#

Open the schema page on the HERE platform portal.

property parser: Parser#

To return parser object.

property supported_content_types: List[str]#

The content types this schema describes.