NOTICE: All information contained herein is, and remains
the property of TechnoCore Automate.
The ObjImportApi class in ObjDataImportOds.py imports data from
OpenDocument Spreadsheet (.ods) files — the native format for LibreOffice
Calc and a common format in South African government and public-sector data.
The first row of the selected sheet is treated as the column header.
Requires: odfpy
prep_file(filename) -> strNo-op — returns the filename unchanged.
open_file(filename)Loads the ODS file and reads all rows from the sheet at sheet_index
(default 0). The first row is used as column names.
close_file()Releases the in-memory record list.
column_list() -> listReturns column names from the header row.
next_row() -> list | strReturns the next data row as a list of string values in column order. Short
rows are padded with "" to match the header length. Returns "EOF" when
all rows have been read.
| Attribute | Default | Purpose |
|---|---|---|
sheet_index |
0 |
0-based index of the sheet to read |
importer = ObjImportApi()
importer.sheet_index = 0 # first sheet (default)
importer.open_file("report.ods")
columns = importer.column_list()
while True:
row = importer.next_row()
if row == "EOF":
break
print(dict(zip(columns, row)))
importer.close_file()
Updated : 2026-03-13