ubii.proto package

Message Types

This meta package is used to import the protobuf message types.

Note

Only import from ubii.proto, not directly from the module set in ubii.proto.__proto_module__

class ubii.proto.Client(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

id

Field of type STRING

Type

proto.fields.Field

name

Field of type STRING

Type

proto.fields.Field

devices

RepeatedField of type Device

Type

proto.fields.RepeatedField

tags

RepeatedField of type STRING

Type

proto.fields.RepeatedField

description

Field of type STRING

Type

proto.fields.Field

processing_modules

RepeatedField of type ProcessingModule

Type

proto.fields.RepeatedField

is_dedicated_processing_node

Field of type BOOL

Type

proto.fields.Field

host_ip

Field of type STRING

Type

proto.fields.Field

metadata_json

Field of type STRING

Type

proto.fields.Field

state

Field of type State

Type

proto.fields.Field

latency

Field of type FLOAT

Type

proto.fields.Field

class State(value)[source]

Bases: proto.enums.Enum

An enumeration.

ACTIVE = 0
INACTIVE = 1
UNAVAILABLE = 2
class ubii.proto.ClientList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type Client

Type

proto.fields.RepeatedField

class ubii.proto.ButtonEventType(value)[source]

Bases: proto.enums.Enum

An enumeration.

UP = 0
DOWN = 1
class ubii.proto.HandGestureType(value)[source]

Bases: proto.enums.Enum

An enumeration.

REST = 0
FINGERS_SPREAD = 1
WAVE_IN = 2
WAVE_OUT = 3
FIST = 4
DOUBLE_TAP = 5
class ubii.proto.Color(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

r

Field of type DOUBLE

Type

proto.fields.Field

g

Field of type DOUBLE

Type

proto.fields.Field

b

Field of type DOUBLE

Type

proto.fields.Field

a

Field of type DOUBLE

Type

proto.fields.Field

class ubii.proto.Image2D(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

width

Field of type INT32

Type

proto.fields.Field

height

Field of type INT32

Type

proto.fields.Field

data_format

Field of type DataFormat

Type

proto.fields.Field

data

Field of type BYTES

Type

proto.fields.Field

class DataFormat(value)[source]

Bases: proto.enums.Enum

An enumeration.

GRAY8 = 0
RGB8 = 1
RGBA8 = 2
class ubii.proto.Image2DList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type Image2D

Type

proto.fields.RepeatedField

class ubii.proto.KeyEvent(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

type

Field of type ButtonEventType

Type

proto.fields.Field

key

Field of type STRING

Type

proto.fields.Field

class ubii.proto.StringList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type STRING

Type

proto.fields.RepeatedField

class ubii.proto.DoubleList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type DOUBLE

Type

proto.fields.RepeatedField

class ubii.proto.FloatList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type FLOAT

Type

proto.fields.RepeatedField

class ubii.proto.BoolList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type BOOL

Type

proto.fields.RepeatedField

class ubii.proto.Int32List(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type INT32

Type

proto.fields.RepeatedField

class ubii.proto.Matrix3x2(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

m00

Field of type DOUBLE

Type

proto.fields.Field

m01

Field of type DOUBLE

Type

proto.fields.Field

m10

Field of type DOUBLE

Type

proto.fields.Field

m11

Field of type DOUBLE

Type

proto.fields.Field

m20

Field of type DOUBLE

Type

proto.fields.Field

m21

Field of type DOUBLE

Type

proto.fields.Field

class ubii.proto.Matrix4x4(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

m00

Field of type DOUBLE

Type

proto.fields.Field

m01

Field of type DOUBLE

Type

proto.fields.Field

m02

Field of type DOUBLE

Type

proto.fields.Field

m03

Field of type DOUBLE

Type

proto.fields.Field

m10

Field of type DOUBLE

Type

proto.fields.Field

m11

Field of type DOUBLE

Type

proto.fields.Field

m12

Field of type DOUBLE

Type

proto.fields.Field

m13

Field of type DOUBLE

Type

proto.fields.Field

m20

Field of type DOUBLE

Type

proto.fields.Field

m21

Field of type DOUBLE

Type

proto.fields.Field

m22

Field of type DOUBLE

Type

proto.fields.Field

m23

Field of type DOUBLE

Type

proto.fields.Field

m30

Field of type DOUBLE

Type

proto.fields.Field

m31

Field of type DOUBLE

Type

proto.fields.Field

m32

Field of type DOUBLE

Type

proto.fields.Field

m33

Field of type DOUBLE

Type

proto.fields.Field

class ubii.proto.MouseEvent(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

type

Field of type ButtonEventType

Type

proto.fields.Field

button

Field of type INT32

Type

proto.fields.Field

class ubii.proto.MyoEvent(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

emg

Field of type Vector8

Type

proto.fields.Field

orientation

Field of type Quaternion

Type

proto.fields.Field

gyroscope

Field of type Vector3

Type

proto.fields.Field

accelerometer

Field of type Vector3

Type

proto.fields.Field

gesture

Field of type HandGestureType

Type

proto.fields.Field

class ubii.proto.Object2D(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

id

Field of type STRING

Type

proto.fields.Field

pose

Field of type Pose2D

Type

proto.fields.Field

size

Field of type Vector2

Type

proto.fields.Field

user_data_json

Field of type STRING

Type

proto.fields.Field

class ubii.proto.Object2DList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type Object2D

Type

proto.fields.RepeatedField

class ubii.proto.Object3D(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

id

Field of type STRING

Type

proto.fields.Field

pose

Field of type Pose3D

Type

proto.fields.Field

size

Field of type Vector3

Type

proto.fields.Field

user_data_json

Field of type STRING

Type

proto.fields.Field

class ubii.proto.Object3DList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type Object3D

Type

proto.fields.RepeatedField

class ubii.proto.Pose2D(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

One Ofs

This message defines the following oneof group[s]

orientation
position

Field of type Vector2

Type

proto.fields.Field

direction

Field of type Vector2oneof orientation

Type

proto.fields.Field

angle

Field of type FLOAToneof orientation

Type

proto.fields.Field

class ubii.proto.Pose3D(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

One Ofs

This message defines the following oneof group[s]

orientation
position

Field of type Vector3

Type

proto.fields.Field

quaternion

Field of type Quaterniononeof orientation

Type

proto.fields.Field

euler

Field of type Vector3oneof orientation

Type

proto.fields.Field

class ubii.proto.Quaternion(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

x

Field of type DOUBLE

Type

proto.fields.Field

y

Field of type DOUBLE

Type

proto.fields.Field

z

Field of type DOUBLE

Type

proto.fields.Field

w

Field of type DOUBLE

Type

proto.fields.Field

class ubii.proto.QuaternionList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type Quaternion

Type

proto.fields.RepeatedField

class ubii.proto.TouchEvent(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

type

Field of type TouchEventType

Type

proto.fields.Field

position

Field of type Vector2

Type

proto.fields.Field

id

Field of type STRING

Type

proto.fields.Field

force

Field of type FLOAT

Type

proto.fields.Field

class TouchEventType(value)[source]

Bases: proto.enums.Enum

An enumeration.

TOUCH_START = 0
TOUCH_MOVE = 1
TOUCH_END = 2
class ubii.proto.TouchEventList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type TouchEvent

Type

proto.fields.RepeatedField

class ubii.proto.Vector2(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

x

Field of type DOUBLE

Type

proto.fields.Field

y

Field of type DOUBLE

Type

proto.fields.Field

class ubii.proto.Vector2List(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type Vector2

Type

proto.fields.RepeatedField

class ubii.proto.Vector3(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

x

Field of type DOUBLE

Type

proto.fields.Field

y

Field of type DOUBLE

Type

proto.fields.Field

z

Field of type DOUBLE

Type

proto.fields.Field

class ubii.proto.Vector3List(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type Vector3

Type

proto.fields.RepeatedField

class ubii.proto.Vector4(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

x

Field of type DOUBLE

Type

proto.fields.Field

y

Field of type DOUBLE

Type

proto.fields.Field

z

Field of type DOUBLE

Type

proto.fields.Field

w

Field of type DOUBLE

Type

proto.fields.Field

class ubii.proto.Vector4List(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type Vector4

Type

proto.fields.RepeatedField

class ubii.proto.Vector8(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

v0

Field of type DOUBLE

Type

proto.fields.Field

v1

Field of type DOUBLE

Type

proto.fields.Field

v2

Field of type DOUBLE

Type

proto.fields.Field

v3

Field of type DOUBLE

Type

proto.fields.Field

v4

Field of type DOUBLE

Type

proto.fields.Field

v5

Field of type DOUBLE

Type

proto.fields.Field

v6

Field of type DOUBLE

Type

proto.fields.Field

v7

Field of type DOUBLE

Type

proto.fields.Field

class ubii.proto.Vector8List(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type Vector8

Type

proto.fields.RepeatedField

class ubii.proto.Component(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

topic

Field of type STRING

Type

proto.fields.Field

message_format

Field of type STRING

Type

proto.fields.Field

io_type

Field of type IOType

Type

proto.fields.Field

device_id

Field of type STRING

Type

proto.fields.Field

tags

RepeatedField of type STRING

Type

proto.fields.RepeatedField

description

Field of type STRING

Type

proto.fields.Field

id

Field of type STRING

Type

proto.fields.Field

name

Field of type STRING

Type

proto.fields.Field

class IOType(value)[source]

Bases: proto.enums.Enum

An enumeration.

PUBLISHER = 0
SUBSCRIBER = 1
class ubii.proto.ComponentList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type Component

Type

proto.fields.RepeatedField

class ubii.proto.Device(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

id

Field of type STRING

Type

proto.fields.Field

name

Field of type STRING

Type

proto.fields.Field

device_type

Field of type DeviceType

Type

proto.fields.Field

components

RepeatedField of type Component

Type

proto.fields.RepeatedField

client_id

Field of type STRING

Type

proto.fields.Field

tags

RepeatedField of type STRING

Type

proto.fields.RepeatedField

description

Field of type STRING

Type

proto.fields.Field

class DeviceType(value)[source]

Bases: proto.enums.Enum

An enumeration.

PARTICIPANT = 0
WATCHER = 1
class ubii.proto.DeviceList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type Device

Type

proto.fields.RepeatedField

class ubii.proto.TopicDemux(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

id

Field of type STRING

Type

proto.fields.Field

name

Field of type STRING

Type

proto.fields.Field

data_type

Field of type STRING

Type

proto.fields.Field

output_topic_format

Field of type STRING

Type

proto.fields.Field

class ubii.proto.TopicDemuxList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type TopicDemux

Type

proto.fields.RepeatedField

class ubii.proto.TopicMux(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

id

Field of type STRING

Type

proto.fields.Field

name

Field of type STRING

Type

proto.fields.Field

data_type

Field of type STRING

Type

proto.fields.Field

topic_selector

Field of type STRING

Type

proto.fields.Field

identity_match_pattern

Field of type STRING

Type

proto.fields.Field

class ubii.proto.TopicMuxList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type TopicMux

Type

proto.fields.RepeatedField

class ubii.proto.Error(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

title

Field of type STRING

Type

proto.fields.Field

message

Field of type STRING

Type

proto.fields.Field

stack

Field of type STRING

Type

proto.fields.Field

class ubii.proto.ErrorList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type Error

Type

proto.fields.RepeatedField

class ubii.proto.Success(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

title

Field of type STRING

Type

proto.fields.Field

message

Field of type STRING

Type

proto.fields.Field

class ubii.proto.SuccessList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type Success

Type

proto.fields.RepeatedField

class ubii.proto.LockstepProcessingRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

processing_module_ids

RepeatedField of type STRING

Type

proto.fields.RepeatedField

records

RepeatedField of type TopicDataRecord

Type

proto.fields.RepeatedField

delta_time_ms

Field of type INT32

Type

proto.fields.Field

class ubii.proto.LockstepProcessingReply(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

processing_module_ids

RepeatedField of type STRING

Type

proto.fields.RepeatedField

records

RepeatedField of type TopicDataRecord

Type

proto.fields.RepeatedField

class ubii.proto.ProcessingMode(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

One Ofs

This message defines the following oneof group[s]

mode
frequency

Field of type Frequencyoneof mode

Type

proto.fields.Field

lockstep

Field of type Locksteponeof mode

Type

proto.fields.Field

trigger_on_input

Field of type TriggerOnInputoneof mode

Type

proto.fields.Field

free

Field of type Freeoneof mode

Type

proto.fields.Field

class Frequency(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Processing Callback is executed at a fixed time interval, with target frequency

hertz

Field of type INT32

Type

proto.fields.Field

class Lockstep(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Processing Callback is executed when the master node sends a lockstep processing request

process_request_endpoint

Field of type STRING

Type

proto.fields.Field

class TriggerOnInput(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Processing Callback is executed when all or any of the input data changes

min_delay_ms

Field of type INT32

Type

proto.fields.Field

all_inputs_need_update

Field of type BOOL

Type

proto.fields.Field

class ubii.proto.ModuleIO(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

internal_name

Field of type STRING

Type

proto.fields.Field

message_format

Field of type STRING

Type

proto.fields.Field

is_record_list

Field of type BOOL

Type

proto.fields.Field

class ubii.proto.ProcessingModule(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

id

Field of type STRING

Type

proto.fields.Field

name

Field of type STRING

Type

proto.fields.Field

authors

RepeatedField of type STRING

Type

proto.fields.RepeatedField

tags

RepeatedField of type STRING

Type

proto.fields.RepeatedField

description

Field of type STRING

Type

proto.fields.Field

node_id

Field of type STRING

Type

proto.fields.Field

session_id

Field of type STRING

Type

proto.fields.Field

status

Field of type Status

Type

proto.fields.Field

processing_mode

Field of type ProcessingMode

Type

proto.fields.Field

inputs

RepeatedField of type ModuleIO

Type

proto.fields.RepeatedField

outputs

RepeatedField of type ModuleIO

Type

proto.fields.RepeatedField

language

Field of type Language

Type

proto.fields.Field

on_processing_stringified

Field of type STRING

Type

proto.fields.Field

on_created_stringified

Field of type STRING

Type

proto.fields.Field

on_halted_stringified

Field of type STRING

Type

proto.fields.Field

on_destroyed_stringified

Field of type STRING

Type

proto.fields.Field

class Status(value)[source]

Bases: proto.enums.Enum

An enumeration.

INITIALIZED = 0
CREATED = 1
PROCESSING = 2
HALTED = 3
DESTROYED = 4
class Language(value)[source]

Bases: proto.enums.Enum

An enumeration.

CPP = 0
PY = 1
JS = 2
CS = 3
JAVA = 4
class ubii.proto.ProcessingModuleList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type ProcessingModule

Type

proto.fields.RepeatedField

class ubii.proto.Constants(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

DEFAULT_TOPICS

Field of type DefaultTopics

Type

proto.fields.Field

MSG_TYPES

Field of type MsgTypes

Type

proto.fields.Field

class DefaultTopics(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

SERVICES

Field of type Services

Type

proto.fields.Field

INFO_TOPICS

Field of type InfoTopics

Type

proto.fields.Field

class Services(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

SERVER_CONFIG

Field of type STRING

Type

proto.fields.Field

CLIENT_REGISTRATION

Field of type STRING

Type

proto.fields.Field

CLIENT_DEREGISTRATION

Field of type STRING

Type

proto.fields.Field

CLIENT_GET_LIST

Field of type STRING

Type

proto.fields.Field

DEVICE_REGISTRATION

Field of type STRING

Type

proto.fields.Field

DEVICE_DEREGISTRATION

Field of type STRING

Type

proto.fields.Field

DEVICE_GET

Field of type STRING

Type

proto.fields.Field

DEVICE_GET_LIST

Field of type STRING

Type

proto.fields.Field

COMPONENT_GET_LIST

Field of type STRING

Type

proto.fields.Field

PM_DATABASE_SAVE

Field of type STRING

Type

proto.fields.Field

PM_DATABASE_DELETE

Field of type STRING

Type

proto.fields.Field

PM_DATABASE_GET

Field of type STRING

Type

proto.fields.Field

PM_DATABASE_GET_LIST

Field of type STRING

Type

proto.fields.Field

PM_DATABASE_ONLINE_GET_LIST

Field of type STRING

Type

proto.fields.Field

PM_DATABASE_LOCAL_GET_LIST

Field of type STRING

Type

proto.fields.Field

PM_RUNTIME_ADD

Field of type STRING

Type

proto.fields.Field

PM_RUNTIME_REMOVE

Field of type STRING

Type

proto.fields.Field

PM_RUNTIME_GET

Field of type STRING

Type

proto.fields.Field

PM_RUNTIME_GET_LIST

Field of type STRING

Type

proto.fields.Field

PM_REGISTRY_ADD

Field of type STRING

Type

proto.fields.Field

PM_REGISTRY_REMOVE

Field of type STRING

Type

proto.fields.Field

SESSION_DATABASE_SAVE

Field of type STRING

Type

proto.fields.Field

SESSION_DATABASE_DELETE

Field of type STRING

Type

proto.fields.Field

SESSION_DATABASE_GET

Field of type STRING

Type

proto.fields.Field

SESSION_DATABASE_GET_LIST

Field of type STRING

Type

proto.fields.Field

SESSION_DATABASE_ONLINE_GET_LIST

Field of type STRING

Type

proto.fields.Field

SESSION_DATABASE_LOCAL_GET_LIST

Field of type STRING

Type

proto.fields.Field

SESSION_RUNTIME_ADD

Field of type STRING

Type

proto.fields.Field

SESSION_RUNTIME_REMOVE

Field of type STRING

Type

proto.fields.Field

SESSION_RUNTIME_GET

Field of type STRING

Type

proto.fields.Field

SESSION_RUNTIME_GET_LIST

Field of type STRING

Type

proto.fields.Field

SESSION_RUNTIME_START

Field of type STRING

Type

proto.fields.Field

SESSION_RUNTIME_STOP

Field of type STRING

Type

proto.fields.Field

SESSION_RUNTIME_UPDATE

Field of type STRING

Type

proto.fields.Field

TOPIC_DEMUX_DATABASE_SAVE

Field of type STRING

Type

proto.fields.Field

TOPIC_DEMUX_DATABASE_DELETE

Field of type STRING

Type

proto.fields.Field

TOPIC_DEMUX_DATABASE_GET

Field of type STRING

Type

proto.fields.Field

TOPIC_DEMUX_DATABASE_GET_LIST

Field of type STRING

Type

proto.fields.Field

TOPIC_DEMUX_RUNTIME_GET

Field of type STRING

Type

proto.fields.Field

TOPIC_DEMUX_RUNTIME_GET_LIST

Field of type STRING

Type

proto.fields.Field

TOPIC_MUX_DATABASE_SAVE

Field of type STRING

Type

proto.fields.Field

TOPIC_MUX_DATABASE_DELETE

Field of type STRING

Type

proto.fields.Field

TOPIC_MUX_DATABASE_GET

Field of type STRING

Type

proto.fields.Field

TOPIC_MUX_DATABASE_GET_LIST

Field of type STRING

Type

proto.fields.Field

TOPIC_MUX_RUNTIME_GET

Field of type STRING

Type

proto.fields.Field

TOPIC_MUX_RUNTIME_GET_LIST

Field of type STRING

Type

proto.fields.Field

SERVICE_LIST

Field of type STRING

Type

proto.fields.Field

TOPIC_LIST

Field of type STRING

Type

proto.fields.Field

TOPIC_SUBSCRIPTION

Field of type STRING

Type

proto.fields.Field

LATENCY_CLIENTS_LIST

Field of type STRING

Type

proto.fields.Field

class InfoTopics(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

REGEX_ALL_INFOS

Field of type STRING

Type

proto.fields.Field

REGEX_PM_INFOS

Field of type STRING

Type

proto.fields.Field

NEW_PM

Field of type STRING

Type

proto.fields.Field

START_PM

Field of type STRING

Type

proto.fields.Field

DELETE_PM

Field of type STRING

Type

proto.fields.Field

CHANGE_PM

Field of type STRING

Type

proto.fields.Field

PROCESSED_PM

Field of type STRING

Type

proto.fields.Field

REGEX_SESSION_INFOS

Field of type STRING

Type

proto.fields.Field

NEW_SESSION

Field of type STRING

Type

proto.fields.Field

DELETE_SESSION

Field of type STRING

Type

proto.fields.Field

CHANGE_SESSION

Field of type STRING

Type

proto.fields.Field

START_SESSION

Field of type STRING

Type

proto.fields.Field

STOP_SESSION

Field of type STRING

Type

proto.fields.Field

RUNNING_SESSION

Field of type STRING

Type

proto.fields.Field

class MsgTypes(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

ERROR

Field of type STRING

Type

proto.fields.Field

SUCCESS

Field of type STRING

Type

proto.fields.Field

SERVER

Field of type STRING

Type

proto.fields.Field

CLIENT

Field of type STRING

Type

proto.fields.Field

CLIENT_LIST

Field of type STRING

Type

proto.fields.Field

DEVICE

Field of type STRING

Type

proto.fields.Field

DEVICE_LIST

Field of type STRING

Type

proto.fields.Field

COMPONENT

Field of type STRING

Type

proto.fields.Field

COMPONENT_LIST

Field of type STRING

Type

proto.fields.Field

TOPIC_MUX

Field of type STRING

Type

proto.fields.Field

TOPIC_MUX_LIST

Field of type STRING

Type

proto.fields.Field

TOPIC_DEMUX

Field of type STRING

Type

proto.fields.Field

TOPIC_DEMUX_LIST

Field of type STRING

Type

proto.fields.Field

SERVICE

Field of type STRING

Type

proto.fields.Field

SERVICE_LIST

Field of type STRING

Type

proto.fields.Field

SERVICE_REQUEST

Field of type STRING

Type

proto.fields.Field

SERVICE_REPLY

Field of type STRING

Type

proto.fields.Field

SERVICE_REUEST_TOPIC_SUBSCRIPTION

Field of type STRING

Type

proto.fields.Field

SESSION

Field of type STRING

Type

proto.fields.Field

SESSION_LIST

Field of type STRING

Type

proto.fields.Field

SESSION_IO_MAPPING

Field of type STRING

Type

proto.fields.Field

PM

Field of type STRING

Type

proto.fields.Field

PM_LIST

Field of type STRING

Type

proto.fields.Field

PM_MODULE_IO

Field of type STRING

Type

proto.fields.Field

PM_PROCESSING_MODE

Field of type STRING

Type

proto.fields.Field

TOPIC_DATA

Field of type STRING

Type

proto.fields.Field

TOPIC_DATA_RECORD

Field of type STRING

Type

proto.fields.Field

TOPIC_DATA_RECORD_LIST

Field of type STRING

Type

proto.fields.Field

TOPIC_DATA_TIMESTAMP

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_BOOL

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_BOOL_LIST

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_INT32

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_INT32_LIST

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_STRING

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_STRING_LIST

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_FLOAT

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_FLOAT_LIST

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_DOUBLE

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_DOUBLE_LIST

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_COLOR

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_IMAGE

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_IMAGE_LIST

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_KEY_EVENT

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_MATRIX_3X2

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_MATRIX_4X4

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_MOUSE_EVENT

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_OBJECT2D

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_OBJECT2D_LIST

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_OBJECT3D

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_OBJECT3D_LIST

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_POSE2D

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_POSE3D

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_QUATERNION

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_TOUCH_EVENT

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_VECTOR2

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_VECTOR3

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_VECTOR4

Field of type STRING

Type

proto.fields.Field

DATASTRUCTURE_VECTOR8

Field of type STRING

Type

proto.fields.Field

class ubii.proto.Server(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

id

Field of type STRING

Type

proto.fields.Field

name

Field of type STRING

Type

proto.fields.Field

ip_ethernet

Field of type STRING

Type

proto.fields.Field

ip_wlan

Field of type STRING

Type

proto.fields.Field

port_service_zmq

Field of type STRING

Type

proto.fields.Field

port_service_rest

Field of type STRING

Type

proto.fields.Field

port_topic_data_zmq

Field of type STRING

Type

proto.fields.Field

port_topic_data_ws

Field of type STRING

Type

proto.fields.Field

constants_json

Field of type STRING

Type

proto.fields.Field

external_address_service_zmq

Field of type STRING

Type

proto.fields.Field

external_address_service_http_json

Field of type STRING

Type

proto.fields.Field

external_address_service_http_binary

Field of type STRING

Type

proto.fields.Field

external_address_topic_data_zmq

Field of type STRING

Type

proto.fields.Field

external_address_topic_data_ws

Field of type STRING

Type

proto.fields.Field

class ubii.proto.Service(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

topic

Field of type STRING

Type

proto.fields.Field

request_message_format

Field of type STRING

Type

proto.fields.Field

response_message_format

Field of type STRING

Type

proto.fields.Field

tags

RepeatedField of type STRING

Type

proto.fields.RepeatedField

description

Field of type STRING

Type

proto.fields.Field

class ubii.proto.ServiceList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type Service

Type

proto.fields.RepeatedField

class ubii.proto.ServiceReply(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

success

Field of type Successoneof type

Type

proto.fields.Field

error

Field of type Erroroneof type

Type

proto.fields.Field

client

Field of type Clientoneof type

Type

proto.fields.Field

device

Field of type Deviceoneof type

Type

proto.fields.Field

server

Field of type Serveroneof type

Type

proto.fields.Field

session

Field of type Sessiononeof type

Type

proto.fields.Field

session_list

Field of type SessionListoneof type

Type

proto.fields.Field

processing_module

Field of type ProcessingModuleoneof type

Type

proto.fields.Field

processing_module_list

Field of type ProcessingModuleListoneof type

Type

proto.fields.Field

string_list

Field of type StringListoneof type

Type

proto.fields.Field

topic_mux

Field of type TopicMuxoneof type

Type

proto.fields.Field

topic_mux_list

Field of type TopicMuxListoneof type

Type

proto.fields.Field

topic_demux

Field of type TopicDemuxoneof type

Type

proto.fields.Field

topic_demux_list

Field of type TopicDemuxListoneof type

Type

proto.fields.Field

client_list

Field of type ClientListoneof type

Type

proto.fields.Field

device_list

Field of type DeviceListoneof type

Type

proto.fields.Field

service

Field of type Serviceoneof type

Type

proto.fields.Field

service_list

Field of type ServiceListoneof type

Type

proto.fields.Field

lockstep_processing_reply

Field of type LockstepProcessingReplyoneof type

Type

proto.fields.Field

component

Field of type Componentoneof type

Type

proto.fields.Field

component_list

Field of type ComponentListoneof type

Type

proto.fields.Field

class ubii.proto.ServiceRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

topic

Field of type STRING

Type

proto.fields.Field

client

Field of type Clientoneof type

Type

proto.fields.Field

device

Field of type Deviceoneof type

Type

proto.fields.Field

topic_subscription

Field of type TopicSubscriptiononeof type

Type

proto.fields.Field

session

Field of type Sessiononeof type

Type

proto.fields.Field

session_list

Field of type SessionListoneof type

Type

proto.fields.Field

processing_module

Field of type ProcessingModuleoneof type

Type

proto.fields.Field

processing_module_list

Field of type ProcessingModuleListoneof type

Type

proto.fields.Field

topic_mux

Field of type TopicMuxoneof type

Type

proto.fields.Field

topic_mux_list

Field of type TopicMuxListoneof type

Type

proto.fields.Field

topic_demux

Field of type TopicDemuxoneof type

Type

proto.fields.Field

topic_demux_list

Field of type TopicDemuxListoneof type

Type

proto.fields.Field

client_list

Field of type ClientListoneof type

Type

proto.fields.Field

device_list

Field of type DeviceListoneof type

Type

proto.fields.Field

lockstep_processing_request

Field of type LockstepProcessingRequestoneof type

Type

proto.fields.Field

component

Field of type Componentoneof type

Type

proto.fields.Field

component_list

Field of type ComponentListoneof type

Type

proto.fields.Field

class ubii.proto.TopicSubscription(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

client_id

Field of type STRING

Type

proto.fields.Field

subscribe_topics

RepeatedField of type STRING

Type

proto.fields.RepeatedField

unsubscribe_topics

RepeatedField of type STRING

Type

proto.fields.RepeatedField

subscribe_topic_regexp

RepeatedField of type STRING

Type

proto.fields.RepeatedField

unsubscribe_topic_regexp

RepeatedField of type STRING

Type

proto.fields.RepeatedField

class ubii.proto.SessionStatus(value)[source]

Bases: proto.enums.Enum

An enumeration.

CREATED = 0
RUNNING = 1
PAUSED = 2
STOPPED = 3
class ubii.proto.TopicInputMapping(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

One Ofs

This message defines the following oneof group[s]

topic_source
input_name

Field of type STRING

Type

proto.fields.Field

topic

Field of type STRINGoneof topic_source

Type

proto.fields.Field

topic_mux

Field of type TopicMuxoneof topic_source

Type

proto.fields.Field

class ubii.proto.TopicInputMappingList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type TopicInputMapping

Type

proto.fields.RepeatedField

class ubii.proto.TopicOutputMapping(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

One Ofs

This message defines the following oneof group[s]

topic_destination
output_name

Field of type STRING

Type

proto.fields.Field

topic

Field of type STRINGoneof topic_destination

Type

proto.fields.Field

topic_demux

Field of type TopicDemuxoneof topic_destination

Type

proto.fields.Field

class ubii.proto.TopicOutputMappingList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type TopicOutputMapping

Type

proto.fields.RepeatedField

class ubii.proto.IOMapping(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

processing_module_id

Field of type STRING

Type

proto.fields.Field

input_mappings

RepeatedField of type TopicInputMapping

Type

proto.fields.RepeatedField

output_mappings

RepeatedField of type TopicOutputMapping

Type

proto.fields.RepeatedField

processing_module_name

Field of type STRING

Type

proto.fields.Field

class ubii.proto.IOMappingList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type IOMapping

Type

proto.fields.RepeatedField

class ubii.proto.Session(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

id

Field of type STRING

Type

proto.fields.Field

name

Field of type STRING

Type

proto.fields.Field

processing_modules

RepeatedField of type ProcessingModule

Type

proto.fields.RepeatedField

io_mappings

RepeatedField of type IOMapping

Type

proto.fields.RepeatedField

tags

RepeatedField of type STRING

Type

proto.fields.RepeatedField

description

Field of type STRING

Type

proto.fields.Field

authors

RepeatedField of type STRING

Type

proto.fields.RepeatedField

status

Field of type SessionStatus

Type

proto.fields.Field

editable

Field of type BOOL

Type

proto.fields.Field

class ubii.proto.SessionList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type Session

Type

proto.fields.RepeatedField

class ubii.proto.Timestamp(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

seconds

Field of type INT64

Type

proto.fields.Field

nanos

Field of type INT32

Type

proto.fields.Field

millis

Field of type INT64

Type

proto.fields.Field

class ubii.proto.TopicData(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

One Ofs

This message defines the following oneof group[s]

type
topic_data_record

Field of type TopicDataRecordoneof type

Type

proto.fields.Field

topic_data_record_list

Field of type TopicDataRecordListoneof type

Type

proto.fields.Field

error

Field of type Erroroneof type

Type

proto.fields.Field

class ubii.proto.TopicDataRecord(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

continuous index: 38

topic

Field of type STRING

Type

proto.fields.Field

timestamp

Field of type Timestamp

Type

proto.fields.Field

client_id

Field of type STRING

Type

proto.fields.Field

double

Field of type DOUBLEoneof type

Type

proto.fields.Field

bool

Field of type BOOLoneof type

Type

proto.fields.Field

string

Field of type STRINGoneof type

Type

proto.fields.Field

int32

Field of type INT32oneof type

Type

proto.fields.Field

float

Field of type FLOAToneof type

Type

proto.fields.Field

vector2

Field of type Vector2oneof type

Type

proto.fields.Field

vector2_list

Field of type Vector2Listoneof type

Type

proto.fields.Field

vector3

Field of type Vector3oneof type

Type

proto.fields.Field

vector3_list

Field of type Vector3Listoneof type

Type

proto.fields.Field

vector4

Field of type Vector4oneof type

Type

proto.fields.Field

vector4_list

Field of type Vector4Listoneof type

Type

proto.fields.Field

quaternion

Field of type Quaterniononeof type

Type

proto.fields.Field

quaternion_list

Field of type Quaterniononeof type

Type

proto.fields.Field

matrix3x2

Field of type Matrix3x2oneof type

Type

proto.fields.Field

matrix4x4

Field of type Matrix4x4oneof type

Type

proto.fields.Field

color

Field of type Coloroneof type

Type

proto.fields.Field

touch_event

Field of type TouchEventoneof type

Type

proto.fields.Field

touch_event_list

Field of type TouchEventListoneof type

Type

proto.fields.Field

key_event

Field of type KeyEventoneof type

Type

proto.fields.Field

mouse_event

Field of type MouseEventoneof type

Type

proto.fields.Field

myo_event

Field of type MyoEventoneof type

Type

proto.fields.Field

pose2D

Field of type Pose2Doneof type

Type

proto.fields.Field

pose3D

Field of type Pose3Doneof type

Type

proto.fields.Field

object2D

Field of type Object2Doneof type

Type

proto.fields.Field

object3D

Field of type Object3Doneof type

Type

proto.fields.Field

object2D_list

Field of type Object2DListoneof type

Type

proto.fields.Field

object3D_list

Field of type Object3DListoneof type

Type

proto.fields.Field

int32_list

Field of type Int32Listoneof type

Type

proto.fields.Field

float_list

Field of type FloatListoneof type

Type

proto.fields.Field

double_list

Field of type DoubleListoneof type

Type

proto.fields.Field

string_list

Field of type StringListoneof type

Type

proto.fields.Field

bool_list

Field of type BoolListoneof type

Type

proto.fields.Field

image2D

Field of type Image2Doneof type

Type

proto.fields.Field

image2D_list

Field of type Image2DListoneof type

Type

proto.fields.Field

session

Field of type Sessiononeof type

Type

proto.fields.Field

class ubii.proto.TopicDataRecordList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

elements

RepeatedField of type TopicDataRecord

Type

proto.fields.RepeatedField

ubii.proto.__protobuf__ = ProtoModule(package='ubii.proto.v1', marshal='ubii.proto.v1', manifest=frozenset({'StringList', 'TopicInputMapping', 'TopicOutputMapping', 'Error', 'Vector2List', 'ProcessingMode', 'Vector3', 'Vector4', 'Quaternion', 'Matrix3x2', 'TopicDataRecordList', 'HandGestureType', 'QuaternionList', 'TopicMuxList', 'Vector8', 'Success', 'KeyEvent', 'Object3DList', 'ComponentList', 'TopicOutputMappingList', 'TopicInputMappingList', 'Timestamp', 'DoubleList', 'ButtonEventType', 'Pose2D', 'TopicMux', 'MouseEvent', 'DeviceList', 'LockstepProcessingReply', 'Constants', 'Vector8List', 'SuccessList', 'Server', 'Image2D', 'ProcessingModule', 'Matrix4x4', 'FloatList', 'TopicDemuxList', 'MyoEvent', 'ServiceList', 'Vector3List', 'Object2DList', 'IOMapping', 'ModuleIO', 'Vector2', 'BoolList', 'SessionStatus', 'IOMappingList', 'Component', 'ErrorList', 'Int32List', 'Object2D', 'TopicDataRecord', 'LockstepProcessingRequest', 'Color', 'Vector4List', 'SessionList', 'Device', 'Session', 'TopicData', 'Client', 'TopicSubscription', 'ServiceReply', 'TouchEvent', 'Image2DList', 'TouchEventList', 'ClientList', 'TopicDemux', 'ProcessingModuleList', 'Pose3D', 'Service', 'Object3D', 'ServiceRequest'}))

Used by Proto Plus for Python to aggregate defined protobuf message in the same descriptor pool. You need to import this attribute in every module that extends an existing protobuf wrapper class using ubii.proto.ProtoMeta. In essence this is a named tuple with attributes package and marshal containing the name for the Marshal used by this package and manifest containing a set of all Message available from this module.

Example

You may want to create a extension to the wrapper around ubii.proto.Error to be able to raise the error as an exception:

from functools import lru_cache
from proto.marshal import Marshal
from proto.marshal.rules.message import MessageRule

import ubii.proto as ub
__protobuf__ = ub.__protobuf__


class BaseError(ub.Error, Exception, metaclass=ub.ProtoMeta):
    @classmethod
    @lru_cache
    def rule(cls):
        return MessageRule(ub.Error.pb(), cls)

    @property
    def args(self):
        return self.title, self.message, self.stack

class SessionRuntimeStopServiceError(BaseError):
    pass

class OtherError(BaseError):
    pass

class ErrorRule(MessageRule):
    def to_python(self, value, *, absent: bool | None = None):
        title = value.title or ''
        rule = None

        if title.startswith('SessionRuntimeStopService'):
            rule = SessionRuntimeStopServiceError.rule()
        elif title.startswith('Other'):
            rule = OtherError.rule()
        else:
            rule = BaseError.rule()

        return rule.to_python(value, absent=absent)

    def to_proto(self, value):
        return super().to_proto(value)

# register the new marshal rule to automatically convert errors

Marshal(name=__protobuf__.marshal).register(ub.Error.pb(), ErrorRule(ub.Error.pb(), BaseError))
ubii.proto.__proto_module__ = 'ubii.proto.v1'

The actual import path of the module that contains the autogenerated protobuf code. Users are supposed to import from ubii.proto instead.

ubii.proto.__proto_package__ = 'ubii.proto.v1'

The name used for the Marshal.

You can look for the package from ubii.proto.__proto_module__ inside the auto-generated documentation:

Utility

ubii.proto.util.ProtoMeta and ubii.proto.util.ProtoEncoder from ubii.proto.util are directly importable from ubii.proto

Submodules

ubii.proto.util module

Utility features to format protobuf messages and implement protobuf wrapper classes with custom behaviour.

ubii.proto.util.__imported_types__

module level dictionary caching imported types

Type

dict

ubii.proto.util.get_import_name(message_type: str)[source]

The .proto files declare a package name ‘ubii’, but this is not reflected in the python package. Instead the package is named ubii.proto, to not clash with different packages in the ubii namespace. The python files are generated from updated proto files, to produce the correct directory structure. The directory structure determines python package names see https://developers.google.com/protocol-buffers/docs/reference/python-generated#package

Parameters

message_type (str) – string describing the data type

ubii.proto.util.import_type(message_type: str, reimport=False)[source]

See the documentation of the ubii-msg-compiler at https://github.com/saggitar/ubii-msg-compiler for more information about updating the .proto files to generate a different package structure.

Parameters
  • message_type (str) – string describing the data type

  • reimport (bool) – If true force reimport of type

class ubii.proto.util.ProtoMeta(name, bases, attrs)[source]

Bases: abc.ABCMeta, proto.message.MessageMeta

This metaclass is used to inherit from Proto Plus for Python wrapper classes

Example

Make sure you import and set ubii.proto.__protobuf__ in every module which defines new Message types:

import ubii.proto as ub
__protobuf__ = ub.__protobuf__

class Fancy(ub.Component, metaclass=ub.ProtoMeta):
    @property
    def something_amazing(self)
        return "Wow"
class ubii.proto.util.ProtoEncoder(*, 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

Custom encoder to convert Protobuf Messages and Proto-Plus Messages to valid json.

format_options: Dict[str, bool] = {'including_default_value_fields': True, 'preserving_proto_field_name': False, 'use_integers_for_enums': True}

dictionary of default arguments passed to the proto.message.Message.to_dict() or google.protobuf.json_format.MessageToDict() calls which are used to convert the message object.

default(o)[source]

returns a serializable object for o, or calls the base implementation (to raise a TypeError).

Parameters

o (object) – (hopefully) serializable object, e.g. Protobuf message

Returns

dict – Dictionary representation of message using proto.message.Message.to_dict() or google.protobuf.json_format.MessageToDict()

Raises

TypeError – If object is not serializable as Protobuf Message of by json.JSONEncoder.default()

ubii.proto.util.patch_wrapper_class_repr(replacement='...', max_len=50) None[source]

E.g. for documentation purposes it’s undesirable that the __repr__ method of proto.message.Message simply returns formatted json for the message object. For messages with many fields or long representation of field values this to much information.

This function simply monkeypatches the __repr__ method of proto.message.Message to replace output that is longer than max_len with replacement

Parameters
  • replacement – string used as replacement

  • max_len – shorter representations will not be converted