Is it possible to call Python functions from Libre Office Calc?
Hope this helps.. https://www.openoffice.org/udk/python/python-bridge.html
and this page talks about integrating python https://sites.google.com/site/rampatilsprofile/resources/python-resources/programming-in-python-for-friends-and-relations