Ods automation
pyexcel versus Openpyxl versus pyexcel-ods versus ....
pyexcel: A wrapper library that provides one API to read. A wrapper library that provides one API to read, manipulate and writedata in different excel formats
pyexcel-ods
https://pypi.org/project/pyexcel-ods/
pyexcel-ods is a tiny wrapper library to read, manipulate and write data in ods format using python 2.6 and python 2.7.
You are likely to use it with pyexcel
pyexcel-ods3 is a sister library that depends on ezodf and lxml.
pyexcel-odsr is the other sister library that has no external dependency but do ods reading only
openpyxl: A Python library to read/write Excel 2010 xlsx/xlsm files. A Python library to read/write Excel 2010 xlsx/xlsm files.
Openpyxl was made to deal with excel files and is oriented to excel functionality.
Use it if you need fine control over the contents of the file, for example to use Excel tables or charts or to have a specific cell which value you need to control, etc.
Pandas is aimed to work with tabular information in general.
It can work with excel files, but you can do your analysis without using xlsx files. Plus, it is based on Numpy, so it can use vectorization to significantly speed up calculations. Ans it can work with a lot of input and output files.
There’s a big overlap of stuff that can be done with both tools, after all you can always use python to calculate numbers and your tool of preference to put those numbers in a spreadsheet, but unless you absolutely need that fine control on an Excel spreadsheet, I’d ==go with Pandas, since its syntax aimed to deal with tables.==
Its learning curve is far from nice, but dealing with data ends up being way simpler and faster than using lists and sending them to openpyxl.
https://pandas.pydata.org/
a good approach
install pip install pandas-ods-reader
https://pypi.org/project/pandas-ods-reader/
reads ods (=xml) and returns a pandas dataframe
or: https://stackoverflow.com/questions/70047335/openpyxl-pandas-or-both =>
use Openpyxl to get the data
import it into Pandas (?dataframe?) object
use Pandas to manipulate
use Openpyxl towrite the data
pip install pyexcel-ods3
Import “pyexcel_ods3” could not be resolvedPylance reportMissingImports
https://github.com/microsoft/pylance-release/blob/main/DIAGNOSTIC_SEVERITY_RULES.md#diagnostic-severity-rules
hier, een vs code config error
Command Palette (Ctrl+Shift+P) -> Python Select Interpreter
set it to the matching ‘which python3’ on the command line.
/usr/bin/python3 ipv /bin/python3
error is weg
! https://www.geeksforgeeks.org/different-ways-to-iterate-over-rows-in-pandas-dataframe/