Python Forum

Full Version: Looking for a start to GUI for DB maintenance
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I currently use an OpenOffice spreadsheet for budgeting and cash flow purposes. It has many sheets to 'drive' the main ones. It is for cash flow on a number of accounts. It is very time consuming when there are changes, which is often. Need to start work on a Python GUI to:

* Open a KMyMoney file ( a gunzipped XML file)
* Parse through the file and total balances for various accounts, then load an SQL/PostgreSQL db table
* Be able to select different accounts (dropdown) and view the cash flow.

The tables in the db could , in theory, be loaded from the spreadsheet sheets to a respective table. The ability to update these tables, add new row, edit, delete, etc. There will be code needed to create a 'view' of each account, transactions being created by dates within periods.

Can someone advise where there is sample code to make a start on this please ? Possibly there are some example systems that may prove to be close to the needs of this GUI ? I don't mind if there are some costs involved.
openpyxl will do the trick, tried and true

can be installed using pip from command line: pip install openpyxl
documentation is here
Thanks. I had a look at openpyxl, it seems for Excel only and not OpenOffice. Yet my objective was to move away from a 'spreadsheet' as such. Maintain a db with Python, then use some code to do the reporting.

This seems more suited to the needs - https://www.pgadmin.org/download/pgadmin-4-python/
There are packages for open office can be fouund here.
I haven't tried any, but perhaps you can.

These are dated, but perhaps still useful (never tried them myself)
perhaps PyUNO.
and a package that runs on top of PyUNO named pyoo
This simplest way to convert an OpenOffice / LibreOffice spreadsheet is to export it to a csv, or some type that can be read easily, and go on from there.
Thanks @Larz60+ and @woooee for your replies. I'm wanting to use a Postgresql db for the spreadsheet data, and then use Python for reporting/GUI.
As my preference for a database was Postgres, this looks suitable - https://tkinter.com/using-postgres-cloud...orial-187/
I rarely use databases anymore, but when I do, I will use Postgres. Postgis is so useful for many applications, and performance is great.
For simple applications, I'll use sqlite.