Search code examples
pythondatabaselibreoffice-base

Get database from LibreOffice Base with python


I would like to make a Database editable with LibreOffice Base and usable with python. I can't find a way with the normal HSQLDB as it requires Java (I would as less as possible dependencies) and the same thing with SQLite3 as it requires the drivers for LibreOffice.


Solution

  • Be sure to use a split database setup, rather than the default embedded setup. Otherwise it will crash a lot.

    One solution that does not require Java is to switch to a different DB engine, for example MySQL. With this setup, see How do I connect to a MySQL Database in Python? LibreOffice Base works well with MySQL.

    See also https://wiki.openoffice.org/wiki/FAQ_(Base)#Do_I_need_Java_to_use_Base.3F. Split databases are discussed on that page as well.