Reading OpenOffice spreadsheet in Python?

Chris Angelico rosuav at gmail.com
Tue May 20 12:49:09 EDT 2014


On Wed, May 21, 2014 at 2:38 AM, Skip Montanaro <skip at pobox.com> wrote:
> Before someone suggests
> config parser/Windows INI files... A spreadsheet format is kinda handy
> in this case because I do use a few formulas to define some of the
> parameters. Adding a new row (new config file) or column (new
> parameter) is a breeze.

Okay, I won't suggest Windows INI files, but I'll still suggest taking
a step back and figuring out exactly what you're trying to accomplish.
Can you separate out the real data from the formula-derived info, put
the former into a git-managed file, and the latter into something you
regenerate by script (maybe off a makefile)? Organize your source file
in such a way that adding a new config file or new parameter is easy.
The beauty of a spreadsheet is that a cell could be *either* a formula
*or* actual data, completely indistinguishably (note, some may argue
that this is also a major weakness of spreadsheets); I would guess you
most likely don't need that flexibility, and can easily separate
"source" and "calculated". You could make your file format CSV or tab
delimited, and then use LibreOffice to edit it, if that makes the most
sense.

Something to consider, since I can't specifically advise on OO/LO
readers/writers. :)

ChrisA



More information about the Python-list mailing list