Jan-16-2019, 11:22 AM
I upgraded the above post by adding a 'cachename' optional argument. It is useful if you run your program several times and need to load the same spreadsheet each time. Instead of calling libreoffice and openpyxl several times, the resulting dictionary can be stored in a pickle file and loaded directly from here. As long as the spreadsheet is not modified, the pickle file won't be rewritten. So you would use it this way
thedict = spreadsheet_to_dict('the-spreadsheet.ods', cachename='the-cache.pkl')The conversion will occur only the first time the program is run.