Package google :: Package protobuf :: Module descriptor
[frames] | no frames]

Module descriptor

source code

Descriptors essentially contain exactly the information found in a .proto file, in types that make this information accessible in Python.


Author: robinson@google.com (Will Robinson)

Classes
  Error
Base error for this module.
  TypeTransformationError
Error transforming between python proto type and corresponding C++ type.
  DescriptorMetaclass
type(object) -> the object's type type(name, bases, dict) -> a new type
  DescriptorBase
Descriptors base class.
  Descriptor
Descriptor for a protocol message type.
  FieldDescriptor
Descriptor for a single field in a .proto file.
  EnumDescriptor
Descriptor for an enum defined in a .proto file.
  EnumValueDescriptor
Descriptor for a single value within an enum.
  OneofDescriptor
Descriptor for a oneof field.
  ServiceDescriptor
Descriptor for a service.
  MethodDescriptor
Descriptor for a method in a service.
  FileDescriptor
Descriptor for a file.
Functions
 
MakeDescriptor(desc_proto, package='')
Make a protobuf Descriptor given a DescriptorProto protobuf.
source code
Variables
  __package__ = 'google.protobuf'
Function Details

MakeDescriptor(desc_proto, package='')

source code 
Make a protobuf Descriptor given a DescriptorProto protobuf.

Args:
  desc_proto: The descriptor_pb2.DescriptorProto protobuf message.
  package: Optional package name for the new message Descriptor (string).

Returns:
  A Descriptor for protobuf messages.