Session object
The Session section documents theSession class. The Session class is instantiated by
specifying Granta MI connection information, and the returned object represents a connection to the server. It acts as
the root object from which most other Streamlined API objects are spawned, and is typically used to:
- Get
Databaseobjects, which can be used to accessTableandRecordobjects. - Perform text searches across all records on the server with the
Session.search_for_records_by_text()andSession.search_for_records_by_name()methods. - Write changes to the Granta MI server with the
Session.update()andSession.update_links()methods.
Database and table classes
The Database section documents theDatabase class, which represents Granta MI databases.
Database objects are typically obtained by using the Session.get_db() method.
The Table section documents Table class, which represents tables on the Granta MI server.
Table objects are typically obtained by using the Database.get_table() method.
Database and Table objects are used to:
- Get
Recordobjects from aTableobject based on their location in the record tree. - Get
Recordobjects from aDatabaseorTableobject by text, record name, or attribute value searching. - Access schema information, such as
mi_meta_classes.TableLayoutandmi_meta_classes.LinkGroupDetailsobjects.
Record classes
The Record section documents theRecord class, which represents a record on the Granta MI server.
Record objects are used to:
- Access and modify data stored in attributes via the
Record.attributesdictionary. - Access and modify properties of the record, such as
Record.nameandRecord.color - Access links via the
Record.linksdictionary, and modify them with theRecord.set_links()method. - Copy and move the record with the
Record.copy_to()andRecord.move_to()methods.
Attribute definition classes
The Attribute definitions section documents theAttributeDefinition class and all sub-classes.
These classes represent the definition of an attribute on a Granta MI server, as opposed to an instance of an
attribute which contains data. They are not associated with a particular record, only with the table that they are
defined in. AttributeDefinition classes can be used to access the attribute name, attribute unit, and
additional schema-level configuration based on the type of the attribute.
The AttributeDefinition class is subclassed according to the hierarchy described below:
AttributeDefinition(no objects are direct instances of this type)AttributeDefinitionDatetimeAttributeDefinitionDiscreteAttributeDefinitionFileAttributeDefinitionHyperlinkAttributeDefinitionIntegerAttributeDefinitionLogicalAttributeDefinitionLongTextAttributeDefinitionPictureAttributeDefinitionRangeAttributeDefinitionShortTextAttributeDefinitionTabularAttributeDefinitionMultiValue(no objects are direct instances of this type)AttributeDefinitionUnsupported(no objects are direct instances of this type)
PseudoAttributeDefinition class. Objects of this type can generally be used in
place of AttributeDefinition objects to search or export pseudo-attributes.
Attribute classes
The Attribute values section documents theAttributeValue class and all sub-classes. These
classes are analogous to the attribute definition classes, but represent attribute values. They are associated with
both the table and record that they relate to. In addition to being able to access the attribute name and attribute
unit, they can be used to access data values (if the attribute is populated for the associated record).
The AttributeValue class is subclassed according to
the hierarchy described below:
AttributeValue: Base class for all attributesAttributeBinary: Parent class for binary attributes (no objects are direct instances of this type)AttributePicture: Picture dataAttributeFile: File data
AttributeDate: Datetime dataAttributeDiscrete: Discrete dataAttributeFunctional: Parent class for float functional data (no objects are direct instances of this type)FunctionalSeries: Float functional series dataFunctionalGrid: Float functional gridded data
AttributeHyperlink: Hyperlink dataAttributeInteger: Integer dataAttributeLogical: Logical dataAttributePoint: Point (optionally with parameter) dataAttributeRange: Range dataAttributeTabular: Tabular dataAttributeShortText: Short text dataAttributeLongText: Long text dataAttributeUnsupported: Unsupported dataPseudoAttributeValue: Pseudo-attribute value class covering all pseudo-attribute types
Sub-attribute classes
The Schema and supporting items section documents classes that are used by attribute objects but are not attributes themselves. This includes:- The
ParameterDefinitionsection, which documents the classes used to describe parameters. - The
ObjectHistory,RecordVersionHistory, andDataRevisionHistoryclasses, which are used to describe revision information of certain items within a Granta MI database. - The
Hyperlinkclass, which describes a Granta MI hyperlink attribute’s URL, target, and description. - The
BinaryType,Picture, andFileclasses, which contain binary data, and provide methods or saving and loading that data to/from disk.