blpapi.Name

class blpapi.Name(nameString, internalHandle=None)

Name represents a string in a form which is efficient for hashing and comparison, thus providing efficient lookup when used as a key in either ordered or hash-based containers.

Name objects are used to identify and access the classes which define the schema - SchemaTypeDefinition, SchemaElementDefinition, Constant, ConstantList. They are also used to access the values in Element objects and Message objects.

The Name class is an efficient substitute for a string when used as a key, providing constant time comparison and ordering operations. Two Name objects constructed from equal strings will always compare equally.

Name objects should be initialized once and then reused. Creating a Name object involves a search in a container requiring multiple string comparison operations.

Note

Each Name instance refers to an entry in a global static table. Name instances for identical strings will refer to the same data. There is no provision for removing entries from the static table so Name objects should only be used when the set of input strings is bounded.

For example, creating a Name for every possible field name and type in a data model is reasonable (in fact, the API will do this whenever it receives schema information). However converting sequence numbers on incoming messages to strings and creating a Name from each one of those strings will cause the static table to grow in an unbounded manner.

destroy()

Destroy the handle using stored dtor

Return type:

None

static findName(nameString)
Parameters:

nameString (str) – String represented by an existing Name

Return type:

Optional[Name]

Returns:

An existing Name object representing nameString. If no such object exists, None is returned.

static hasName(nameString)
Parameters:

nameString (str) – String represented by an existing Name

Return type:

bool

Returns:

True if a Name object representing nameString exists

isValid()

Returns: True if this class holds a handle and the handle is not None.

Return type:

bool