bw2io.extractors.excel
#
Module Contents#
Classes#
Extract data from an Excel file. |
Functions#
Get the value of a cell, handling error types. |
- class bw2io.extractors.excel.ExcelExtractor[source]#
Bases:
object
Extract data from an Excel file.
- Parameters
object (type) β The parent object for the ExcelExtractor class
- Returns
An instance of the class
- Return type
object
- classmethod extract(filepath)[source]#
Extract data from an Excel file.
- Parameters
filepath (str) β The path to the Excel file.
- Returns
A list of tuples containing the name of each sheet in the file and the data from each sheet.
- Return type
list
- Raises
AssertionError β If the file at βfilepathβ does not exist.
- classmethod extract_sheet(wb, name, strip=True)[source]#
Extract data from a single sheet in an Excel file.
- Parameters
wb (openpyxl.workbook.Workbook) β The workbook object with the sheet to extract data from.
name (str) β The name of the sheet to extract data from.
strip (bool, optional) β If True, strip whitespace from cell values, by default True.
- Returns
A list of lists containing the data from each cell in the sheet.
- Return type
list