Running PythonLanguage in a FreeSoftware SpreadSheet like LibreOffice should be super powerful.
And therefore, exactly the kind of thing you'd think would be easily available and well developed.
Unfortunately, it's an incredible faff.
I've found some good recent tutorials here : https://tutolibro.tech/2019/07/26/libreoffice-calc-python-programming-part-1-requirements/
Well worth checking out because if you want to do this, this is the best intro I've found.
See also :
- Resolver Systems was an attempt to make a Pythonic spreadsheet. It's long gone, but there's an open-source remnant as DirigibleSpreadsheet