To reduce memory footprint : a function to load only one worksheet

Issue #655 invalid
Nicolas created an issue

Hi,

Can't be a solution to load only one sheet in memory to reduce footprint ?

(My xlsx file : 5 sheets of 10000 rows x 10 columns
=> 3 MB on disk
=> Loaded with openpyxl : python process go to 500 MB)

Function :

wb = load_workbook("file.xlsx", only_sheet="My Sheet", data_only=True, ...)

Comments (4)

  1. Nicolas reporter

    That is practical :
    1) Make a template with excel (column header, color, format, conditionnal formatting, etc..) and put it on server.
    2) Programmatically load template to fill sheets with datarows and produce the document. In fact, I don't want to read it, but I need to load to complete it.

    This is a very common practice to produce Excel, Word, PDF or any document, without putting format in code (column header, color, format, conditionnal formatting varriyng with sheet) .

  2. Log in to comment