I wrote some new docs on this recently:
* https://wiki.documentfoundation.org/Macros/Python_Guide/Call...
By having Python in Basic, it becomes available to cells too, since Basic macros are callable from cells.
Note that you may need to reduce the security level to 'medium' in the drop down Tools->Options->Libre Office->Security->Macro Security. When LibreOffice opens, it will ask you whether you want to enable macros or not.