天天看点

python读取odb,如何在Python 2.7中访问ODB文件

python读取odb,如何在Python 2.7中访问ODB文件

I want to access an ODB file (made with LibreOffice Base) in Python and extract a table for further use. The ODB contains several tables, one relation design and several forms.

Is it possible to achieve this without using any SQL?

Edit: Since it seems overcomplicated to parse this format on my own, i'll consider using a proper HSQLDB engine.

What python module accesses via HSQL (like sqlite3 for SQLite does)?

解决方案

You can consider Python Uno API that comes with OpenOffice. There are several Python examples to interact with the API, including one with the sample database

There is also this SO question where it is explained how to use uno with LibreOffice.