Skip to content

model.block_model

Import and export block-model CSV data.

3 functions / 0 types

Index

FunctionDescription
export_csv_stringExport a block model in the model store to a CSV string.
import_csvLoad a block model from a CSV.
import_csv_stringLoad a block model from an inline CSV string into the model store.

export_csv_string

def export_csv_string(*, model: types.RemoteHandle, _transaction_id: str | None = None) -> str

Export a block model in the model store to a CSV string.

Returns str.

model : RemoteHandle

Guid of the block model to export (hyphenated UUID string).

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

import_csv

def import_csv(
    *,
    path: str,
    header_config: types.model.csv.HeaderConfigMap,
    _transaction_id: str | None = None
) -> types.RemoteHandle

Load a block model from a CSV.

Returns RemoteHandle.

path : str

Path to the CSV

header_config : HeaderConfigMap

Import configuration for each CSV column, keyed by the column’s header name.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

import_csv_string

def import_csv_string(
    *,
    csv: str,
    header_config: types.model.csv.HeaderConfigMap,
    _transaction_id: str | None = None
) -> types.RemoteHandle

Load a block model from an inline CSV string into the model store.

Returns RemoteHandle.

csv : str

CSV content (header row plus one row per block).

header_config : HeaderConfigMap

Import configuration for each CSV column, keyed by the column’s header name.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.