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.