#  google.protobuf.descriptor_database  ¶

Provides a container for DescriptorProtos.

_class_ ` google.protobuf.descriptor_database. ` ` DescriptorDatabase ` ¶

    

A container accepting FileDescriptorProtos and maps DescriptorProtos.

` Add ` (  _file_desc_proto_ )  ¶

    

Adds the FileDescriptorProto and its types to this database.

Parameters  :

    

**file_desc_proto** – The FileDescriptorProto to add.

Raises  :

    

**DescriptorDatabaseConflictingDefinitionError** – if an attempt is made to
add a proto with the same name but different definition than an existing proto
in the database.

` FindAllExtensionNumbers ` (  _extendee_name_ )  ¶

    

` FindFileByName ` (  _name_ )  ¶

    

Finds the file descriptor proto by file name.

Typically the file name is a relative path ending to a .proto file. The proto
with the given name will have to have been added to this database using the
Add method or else an error will be raised.

Parameters  :

    

**name** – The file name to find.

Returns  :

    

The file descriptor proto matching the name.

Raises  :

    

**KeyError if no file by the given name was added.** –

` FindFileContainingExtension ` (  _extendee_name_ , _extension_number_ )  ¶

    

` FindFileContainingSymbol ` (  _symbol_ )  ¶

    

Finds the file descriptor proto containing the specified symbol.

The symbol should be a fully qualified name including the file descriptor’s
package and any containing messages. Some examples:

‘some.package.name.Message’ ‘some.package.name.Message.NestedEnum’
‘some.package.name.Message.some_field’

The file descriptor proto containing the specified symbol must be added to
this database using the Add method or else an error will be raised.

Parameters  :

    

**symbol** – The fully qualified symbol name.

Returns  :

    

The file descriptor proto containing the symbol.

Raises  :

    

**KeyError if no file contains the specified symbol.** –

_exception_ ` google.protobuf.descriptor_database. ` `
DescriptorDatabaseConflictingDefinitionError ` ¶

    

Raised when a proto is added with the same name & different descriptor.

` args ` ¶

    

` with_traceback ` (  )  ¶

    

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

_exception_ ` google.protobuf.descriptor_database. ` ` Error ` ¶

    

` args ` ¶

    

` with_traceback ` (  )  ¶

    

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

###  [ Table of Contents ](../../index.html)

  * [ google.protobuf ](../protobuf.html)
  * [ google.protobuf.any_pb2 ](any_pb2.html)
  * [ google.protobuf.descriptor ](descriptor.html)
  * google.protobuf.descriptor_database 
  * [ google.protobuf.descriptor_pb2 ](descriptor_pb2.html)
  * [ google.protobuf.descriptor_pool ](descriptor_pool.html)
  * [ google.protobuf.duration_pb2 ](duration_pb2.html)
  * [ google.protobuf.empty_pb2 ](empty_pb2.html)
  * [ google.protobuf.field_mask_pb2 ](field_mask_pb2.html)
  * [ google.protobuf.internal.containers ](internal/containers.html)
  * [ google.protobuf.json_format ](json_format.html)
  * [ google.protobuf.message ](message.html)
  * [ google.protobuf.message_factory ](message_factory.html)
  * [ google.protobuf.proto_builder ](proto_builder.html)
  * [ google.protobuf.reflection ](reflection.html)
  * [ google.protobuf.service ](service.html)
  * [ google.protobuf.service_reflection ](service_reflection.html)
  * [ google.protobuf.struct_pb2 ](struct_pb2.html)
  * [ google.protobuf.symbol_database ](symbol_database.html)
  * [ google.protobuf.text_encoding ](text_encoding.html)
  * [ google.protobuf.text_format ](text_format.html)
  * [ google.protobuf.timestamp_pb2 ](timestamp_pb2.html)
  * [ google.protobuf.type_pb2 ](type_pb2.html)
  * [ google.protobuf.unknown_fields ](unknown_fields.html)
  * [ google.protobuf.wrappers_pb2 ](wrappers_pb2.html)

###  Related Topics

  * [ Documentation overview ](../../index.html)
    * Previous: [ google.protobuf.descriptor ](descri