I think proper Python macros is one thing LibreOffice could have implemented years ago, to help attract people and break MS near monopoly on spreadsheets. It exists today, but last time I tried felt very hacky. There was no proper macro editor for it, IIRC you had to extract spreadsheets as if they were zip files and save .py written elsewhere in directories inside. Very cumbersome.