artemis.tools.xlstool

Module Contents

class artemis.tools.xlstool.DataSet(dataset, tables)

Helper Class

class artemis.tools.xlstool.XlsToolOptions

Class to hold user-defined options

class artemis.tools.xlstool.XlsTool(name, **kwargs)

Bases: artemis.core.tool.ToolBase

Read_excel returns a DataSet class which contains a protobuf DatasetObjectInfo and a list of protobuf Table model

initialize(self)
execute(self, location)

User input location of excel, calls read_excel

Parameters

location (path to excel dataset file) –

Returns

Return type

Dataset instance, contains a DatasetObjectInfo and a Table

read_excel(self, location)

Read excel from location, calls store_dataset and store_table

Parameters

location (path to excel dataset file) –

Returns

Return type

class DataSet which contains a Dataset and a list of Table

store_dataset(self, ds)

Convert the dataset metadata from template into protobuf object

Parameters

ds (Excel sheet that is named Dataset Info, usually the first sheet) –

Returns

Return type

a DatasetObjectInfo instance

store_table(self, tb)

Convert the table metadata from template into protobuf object

Parameters

tb (Excel sheet that is not named Dataset Info) –

Returns

Return type

a Table instance

to_bool(self, cell)

Convert a cell to boolean, y is true, blank and n are false

Parameters

cell (a cell value in Excel) –

Returns

Return type

True/False

mmap(self, ds, name)

Metadata map Search name in metadata name column in store_dataset If found, returns the corresponding value

Parameters
  • ds (Excel sheet that is named Dataset Info, usually the first sheet) –

  • name (Name of metadata) –

Returns

Return type

value in the corresponding cell