Python Forum
Spreadsheet to dictionary
Thread Rating:
  • 4 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spreadsheet to dictionary
#2
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.
Reply


Messages In This Thread
Spreadsheet to dictionary - by Gribouillis - Jan-16-2019, 11:17 AM
RE: Spreadsheet to dictionary - by Gribouillis - Jan-16-2019, 11:22 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  python spreadsheet app (visual-numpy) rome92 2 2,886 Oct-25-2021, 08:20 PM
Last Post: rome92

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020