I'm not sure whether I'm using the library correctly but it looks like all data access involves method calls which are very slow. This more than outweighs the performance of the parser.
For example, I can find all the cells extremely quickly with XPath but if I want to find the coordinates of the cells I have to call the node().attribute("r").value()
archive = zipfile.ZipFile("workbook.xlsx")
sheet = archive.read("xl/worksheets/sheet1.xml")
doc = XMLDocument()
doc.load_file(sheet, len(sheet)
cells = doc.select_nodes("/worksheet/sheetData/row/c")
print(len(cells))
coords = [cell.node().attribute("r").value() for cell in cells]
On my machine, parsing and getting the list of cells takes less than a second. It then takes 12 seconds to create the list of coordinates. Is there an alternative way of doing this?
I'm not sure whether I'm using the library correctly but it looks like all data access involves method calls which are very slow. This more than outweighs the performance of the parser.
For example, I can find all the cells extremely quickly with XPath but if I want to find the coordinates of the cells I have to call the
node().attribute("r").value()On my machine, parsing and getting the list of cells takes less than a second. It then takes 12 seconds to create the list of coordinates. Is there an alternative way of doing this?