Skip to main content

Tabular row

class TabularRow

Represents a single row in a tabular attribute. Provides access to the cells in the row, as well as the linking value and identifier of the row.

Notes

Do not create instances of this class. Use AttributeTabular.rows to access existing rows and AttributeTabular.append_row() to create new rows.

set_linking_value(value)

Sets the linking value of the row. Set to None to clear the linking value. The row will no longer be linked to any records.
  • Parameters: value (str or None) – The new linking value for the row.
  • Raises: ValueError – If is_exported is True and destructive editing is not enabled.

SEE ALSO

AttributeTabular.is_destructive_editing_allowed : Whether destructive editing of the tabular attribute value is allowed.

property cells : tuple[TabularCell | tuple[TabularCell, …], …]

The cells in the row.

property cells_by_column : Mapping[str, TabularCell | tuple[TabularCell, …]]

The cells in the row, indexed by the column name.
  • Returns: Mapping of column name to TabularCell.
  • Return type: Mapping[str, TabularCell]

property identity : int

The identity of the row.
  • Return type: int

property is_exported : bool

Whether the row represents an existing row in the database.

property linking_value : str | None

The linking value of the row.
  • Return type: str or None

Linked tabular cells

class TabularCell

Abstract base class for tabular cell value types. Extended by EditableTabularCell. See the following concrete implementations:

class ShortTextValue

Represents a single short text value in a linked short text tabular cell.

Notes

Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class.

property is_empty : bool

Whether the tabular cell is populated or not.

property value : str | None

Text value associated with this tabular cell.
  • Return type: str or None

class LongTextValue

Represents a single long text value in a linked long text tabular cell.

Notes

Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class.

property is_empty : bool

Whether the tabular cell is populated or not.

property value : str | None

Text value associated with this tabular cell.
  • Return type: str or None

class LogicalValue

Represents a single logical value in a linked logical tabular cell.

Notes

Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class.

property is_empty : bool

Whether the tabular cell is populated or not.

property value : bool | None

Logical value associated with this tabular cell.
  • Return type: bool or None

class IntegerValue

Represents a single integer value in a linked integer tabular cell.

Notes

Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class.

property is_empty : bool

Whether the tabular cell is populated or not.

property value : int | None

Integer value associated with this cell.
  • Return type: int or None

class DateValue

Represents a single date value in a linked date tabular cell.

Notes

Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class.

property is_empty : bool

Whether the tabular cell is populated or not.

property value : date | None

Date value associated with this tabular cell.

class PictureValue

Represents a picture value in a linked picture tabular cell.

Notes

Tabular Picture Cells only support a single binary data value, together with an optional URL and MIME file type. Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class.

save(path)

Save binary data to disk.
  • Parameters: path (str or pathlib.Path) – File path where the binary data will be saved.
  • Raises:

property binary_data : bytes | None

Binary data associated with this tabular cell.

property is_empty : bool

Whether the tabular cell is populated or not.

property mime_file_type : str | None

MIME (Multipurpose Internet Mail Extensions) file type.
  • Return type: str or None

property url : str | None

URL associated with this tabular cell. In a future version this property will raise an exception if the attribute is exported with include_binary_data = True. See Planned file and picture data changes for more details.
  • Return type: str or None

property value : bytes | None

Binary data if present. In a future version this property will return the URL if the attribute is exported with include_binary_data = False. See Planned file and picture data changes for more details.
  • Return type: bytes or None

class FileValue

Represents a file data value in a linked file tabular cell.

Notes

Tabular File Cells support a single binary data value and a file name, together with an optional description, URL, and MIME file type. Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class.

save(path)

Save binary data to disk.
  • Parameters: path (str or pathlib.Path) – File path where the binary data will be saved.
  • Raises:

property binary_data : bytes | None

Binary data associated with this tabular cell.

property description : str | None

Description of the file.
  • Return type: str or None

property file_name : str | None

Name of the file, including the file extension.
  • Return type: str or None

property is_empty : bool

Whether the tabular cell is populated or not.

property mime_file_type : str | None

MIME (Multipurpose Internet Mail Extensions) file type.
  • Return type: str or None

property url : str | None

URL associated with this tabular cell. In a future version this property will raise an exception if the attribute is exported with include_binary_data = True. See Planned file and picture data changes for more details.
  • Return type: str or None

property value : bytes | None

Binary data if present. In a future version this property will return the URL if the attribute is exported with include_binary_data = False. See Planned file and picture data changes for more details.
  • Return type: bytes or None

class PointValue

Represents a single point value in a linked point tabular cell.

Notes

Tabular Point Cells only support a single value and an optional unit. Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class.

property is_empty : bool

Whether the tabular cell is populated or not.

property unit : str | None

Unit symbol of the tabular cell.
  • Returns: Unit symbol, or None if the cell is dimensionless.
  • Return type: str or None

property value : int | float | None

Point value associated with this cell.
  • Return type: float or None

class RangeValue

Represents a range value in a linked range tabular cell.

Notes

Tabular Range Cells support a low and high value, both of which can be inclusive or exclusive, together with an optional unit. Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class.

property high : float | None

High value of the range.
  • Return type: float or None

property high_value_is_inclusive : bool

Whether the high value is included in the range.

property is_empty : bool

Whether the tabular cell is populated or not.

property low : float | None

Low value of the range.
  • Return type: float or None

property low_value_is_inclusive : bool

Whether the low value is included in the range.

property unit : str | None

Unit symbol of the tabular cell.
  • Returns: Unit symbol, or None if the cell is dimensionless.
  • Return type: str or None

class DiscreteValue

Represents a single discrete value in a linked discrete tabular cell.

Notes

Tabular Discrete Cells only support a single value and an order, which is the index of the value in the list of possible discrete values for the column. This does not imply that the associated discrete type is ordered. Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class.

property is_empty : bool

Whether the tabular cell is populated or not.

property order : int | None

Position of the current discrete value in the discrete type.
  • Returns: Position (1-indexed) in the discrete type. Relevant for ordered discrete types only.
  • Return type: int or None

property value : str | None

Discrete value associated with this tabular cell.
  • Return type: str or None

class HyperlinkValue

Represents a hyperlink value in a linked hyperlink tabular cell.

Notes

Tabular Hyperlink Cells support a value, a display type, and a description. Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class. Text which displays instead of the URL in MI applications.
  • Return type: str or None
How the hyperlink should be opened in MI applications. Takes one of the following values:
  • New: Open in a new window or tab.
  • Top: Open in the current window or tab.
  • Content: Open within the current MI application (for example, in a frame or dialog).
  • Return type: str or None

property is_empty : bool

Whether the tabular cell is populated or not.

property value : str | None

URL of the hyperlink.
  • Return type: str or None

Local tabular cells

class EditableTabularCell

Abstract base class for editable tabular cell value types. See the following concrete implementations:

class LocalShortTextValue

Represents a single short text value in a local short text tabular cell.

Notes

Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class.

clear()

Clear the value property.

property is_empty : bool

Whether the tabular cell is populated or not.

property value : str | None

Text value associated with this tabular cell.
  • Return type: str or None

class LocalLongTextValue

Represents a single long text value in a local long text tabular cell.

Notes

Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class.

clear()

Clear the value property.

property is_empty : bool

Whether the tabular cell is populated or not.

property value : str | None

Text value associated with this tabular cell.
  • Return type: str or None

class LocalLogicalValue

Represents a single logical value in a local logical tabular cell.

Notes

Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class.

clear()

Clear the value property.

property is_empty : bool

Whether the tabular cell is populated or not.

property value : bool | None

Logical value associated with this tabular cell.
  • Return type: bool or None

class LocalIntegerValue

Represents a single integer value in a local integer tabular cell.

Notes

Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class.

clear()

Clear the value property.

property is_empty : bool

Whether the tabular cell is populated or not.

property value : int | None

Integer value associated with this cell.
  • Return type: int or None

class LocalDateValue

Represents a single date value in a local date tabular cell.

Notes

Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class.

clear()

Clear the value property.

property is_empty : bool

Whether the tabular cell is populated or not.

property value : date | None

Date value associated with this tabular cell.

class LocalPictureValue

Represents a picture value in a local picture tabular cell.

Notes

Tabular Picture Cells only support a single binary data value, together with an optional URL and MIME file type. Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class.

clear()

Clear the binary_data, url, and mime_file_type properties.

load(path)

Load an image file into this PictureValue object.
  • Parameters: path (pathlib.Path or str) – Path to the image file to load. Relative paths are permitted. Takes the form C:\Users\username\Pictures\image.jpg or /home/username/Pictures/image.jpg.
  • Raises: TypeError – If path is not a pathlib.Path or string.

save(path)

Save binary data to disk.
  • Parameters: path (str or pathlib.Path) – File path where the binary data will be saved.
  • Raises:

property binary_data : bytes | None

Binary data associated with this tabular cell.

property is_empty : bool

Whether the tabular cell is populated or not.

property mime_file_type : str | None

MIME (Multipurpose Internet Mail Extensions) file type. If this object is populated via export, the mime_file_type property returns the MIME file type stored in Granta MI. If this object is populated via load(), or setting binary_data or value, the mime_file_type property is populated using the filetype library. If filetype cannot determine the MIME file type, the mime_file_type property is set to None and Granta MI determines the MIME file type during import.
  • Return type: str or None

Notes

The filetype PyPI page lists supported MIME types.

property url : str | None

URL associated with this tabular cell. In a future version this property will raise an exception if the attribute is exported with include_binary_data = True. See Planned file and picture data changes for more details.
  • Return type: str or None

property value : bytes | None

Binary data if present. In a future version this property will return the URL if the attribute is exported with include_binary_data = False. See Planned file and picture data changes for more details.
  • Return type: bytes or None

class LocalFileValue

Represents a file data value in a local tabular cell.

Notes

Tabular File Cells support a single binary data value and a file name, together with an optional description, URL, and MIME file type. Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class.

clear()

Clear the binary_data, url, mime_file_type, file_name, and description properties.

load(path)

Load a file into this FileValue object.
  • Parameters: path (pathlib.Path or str) – Path to the file to load. Relative paths are permitted. Takes the form C:\Users\username\Documents\file.pdf or /home/username/Documents/file.pdf.
  • Raises: TypeError – If path is not a pathlib.Path or string.

save(path)

Save binary data to disk.
  • Parameters: path (str or pathlib.Path) – File path where the binary data will be saved.
  • Raises:

property binary_data : bytes | None

Binary data associated with this tabular cell.

property description : str | None

Description of the file.
  • Return type: str or None

property file_name : str | None

Name of the file, including the file extension.
  • Return type: str or None

property is_empty : bool

Whether the tabular cell is populated or not.

property mime_file_type : str | None

MIME (Multipurpose Internet Mail Extensions) file type. If this object is populated via export, the mime_file_type property returns the MIME file type stored in Granta MI. If this object is populated via load(), or setting binary_data or value, the mime_file_type property is populated using the filetype library. If filetype cannot determine the MIME file type, the mime_file_type property is set to None and Granta MI determines the MIME file type during import.
  • Return type: str or None

Notes

The filetype PyPI page lists supported MIME types.

property url : str | None

URL associated with this tabular cell. In a future version this property will raise an exception if the attribute is exported with include_binary_data = True. See Planned file and picture data changes for more details.
  • Return type: str or None

property value : bytes | None

Binary data if present. In a future version this property will return the URL if the attribute is exported with include_binary_data = False. See Planned file and picture data changes for more details.
  • Return type: bytes or None

class LocalPointValue

Represents a single point value in a local point tabular cell.

Notes

Tabular Point Cells only support a single value and an optional unit. This class also exposes the default unit based on the column definition. Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class.

clear()

Clear the value property. Revert the unit property its default value.

property default_unit : str | None

Default unit symbol of the tabular cell.
  • Returns: Default unit symbol as defined by the column, or None if the column is dimensionless.
  • Return type: str or None

property is_empty : bool

Whether the tabular cell is populated or not.

property unit : str | None

Unit symbol of the tabular cell.
  • Returns: Unit symbol, or None if the cell is dimensionless.
  • Return type: str or None

property value : int | float | None

Point value associated with this cell.
  • Return type: float or None

class LocalRangeValue

Represents a range value in a local range tabular cell.

Notes

Tabular Range Cells support a low and high value, both of which can be inclusive or exclusive, together with an optional unit. This class also exposes the default unit based on the column definition. Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class.

clear()

Clear the low and high properties. Revert low_value_is_inclusive, high_value_is_inclusive, and unit properties to their default values.

property default_unit : str | None

Default unit symbol of the tabular cell.
  • Returns: Default unit symbol as defined on the column, or None if the column is dimensionless.
  • Return type: str or None

property high : float | None

High value of the range.
  • Return type: float or None

property high_value_is_inclusive : bool

Whether the high value is included in the range.

property is_empty : bool

Whether the tabular cell is populated or not.

property low : float | None

Low value of the range.
  • Return type: float or None

property low_value_is_inclusive : bool

Whether the low value is included in the range.

property unit : str | None

Unit symbol of the tabular cell.
  • Returns: Unit symbol, or None if the cell is dimensionless.
  • Return type: str or None

class LocalDiscreteValue

Represents a single discrete value in a local discrete tabular cell.

Notes

Tabular Discrete Cells only support a single value and an order, which is the index of the value in the list of possible discrete values for the column. This does not imply that the associated discrete type is ordered. This class also exposes the possible discrete values based on the column definition. Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class.

clear()

Clear the value property.

property is_empty : bool

Whether the tabular cell is populated or not.

property order : int | None

Position of the current discrete value in the discrete type.
  • Returns: Position (1-indexed) in the discrete type. Relevant for ordered discrete types only.
  • Return type: int or None

property possible_discrete_values : FrozenSet[str]

Set of the tabular cell’s possible discrete data values.
  • Return type: FrozenSet[str]

property value : str | None

Discrete value associated with this tabular cell.
  • Return type: str or None

class LocalHyperlinkValue

Represents a hyperlink value in a local hyperlink tabular cell.

Notes

Tabular Hyperlink Cells support a value, a display text, and a description. Do not create instances of this class; it represents a pre-existing database structure. Use TabularRow.cells or TabularRow.cells_by_column to access an instance of this class.

clear()

Clear the value, hyperlink_display, and hyperlink_description properties. Text which displays instead of the URL in MI applications.
  • Return type: str or None
How the hyperlink should be opened in MI applications. Takes one of the following values:
  • New: Open in a new window or tab.
  • Top: Open in the current window or tab.
  • Content: Open within the current MI application (for example, in a frame or dialog).
  • Return type: str or None

property is_empty : bool

Whether the tabular cell is populated or not.

property value : str | None

URL of the hyperlink.
  • Return type: str or None

Miscellaneous tabular cells

class IgnoredLocalTabularCell

Represents a tabular cell that has been marked as ignored.

Notes

Do not create instances of this class; it represents a pre-existing database structure. Instances of this class are returned by TabularRow.cells or TabularRow.cells_by_column for ignored local columns.

SEE ALSO

AttributeDefinitionTabular.columns_to_process : Specify ignored columns before data export.

class UnavailableTabularCell

Represents a cell that was not available for export.

Notes

This cell type is used when the presence of data could not be determined definitively, for example due to a missing target database. Do not create instances of this class; it represents a pre-existing database structure. Instances of this class are returned by TabularRow.cells or TabularRow.cells_by_column for unavailable columns.