Warning

You are reading the documentation for the latest committed changes of the Protocol Buffers package for Python. Some features may not yet be released. Read the documentation for the latest released package at googleapis.dev.

google.protobuf.proto_builder

Dynamic Protobuf class creator.

google.protobuf.proto_builder.MakeSimpleProtoClass(fields, full_name=None, pool=None)

Create a Protobuf class whose fields are basic types.

Note: this doesn’t validate field names!

Parameters
  • fields – dict of {name: field_type} mappings for each field in the proto. If this is an OrderedDict the order will be maintained, otherwise the fields will be sorted by name.

  • full_name – optional str, the fully-qualified name of the proto type.

  • pool – optional DescriptorPool instance.

Returns

a class, the new protobuf class with a FileDescriptor.