DataClient types¶
BaseDataClient¶
ExcelRange¶
-
class
ExcelRange
(path, range_, sheet=None, keyids=None)[source]¶ Mapping class for accessing Excel ranges
An ExcelRange is a dict-like object that represents a range in an Excel file. The user can read values from the range or write values to it by the subscription operator
[]
. ExcelRange is a mapping class, thus it implements all the mapping methods and operations.ExcelRange objects can only be created by the
Model.new_excel_range
orUserSpace.new_excel_range
method.ExcelRange
is a subclass of theBaseDataClient
abstract class. Thedataclients
property list all theBaseDataClient
instances held in the Model includingExcelRange
objects.New in version 0.9.0.
PandasData¶
-
class
PandasData
(path, data, filetype, is_hidden)[source]¶ A subclass of
BaseDataClient
that associates a pandas DataFrame or Series with a fileA
PandasData
holds a pandas DataFrame or Series object, and associates it with a file for writing and reading the object.A
PandasData
can be created only byUserSpace.new_pandas
orModel.new_pandas
.The DataFrame or Series held in
PandasData
objects are accessible throughvalue
property or a call()
method.- Parameters
path – Path to a file for saving data. If a relative path is given, it is relative to the model folder.
data – a pandas DataFrame or Series.
filetype (
str
) – String to specify the file format. “excel” or “csv”
-
path
¶ A path to the associated file as a pathlib.Path object.
-
property
PandasData.
value
¶ pandas DataFrame or Series held in the object
ModuleData¶
-
class
ModuleData
(path, module)[source]¶ A subclass of
BaseDataClient
that associates a user module with its source file in the modelA
ModuleData
is created either byUserSpace.new_module
orModel.new_module
when a user module is assigned to a Reference. TheModuleData
is assigned to the_mx_dataclient
attribute of the module.New in version 0.13.0.
-
property
ModuleData.
value
¶ Module held in the object