Python Forum
Looking for a start to GUI for DB maintenance
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Looking for a start to GUI for DB maintenance
#1
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.
Reply
#2
openpyxl will do the trick, tried and true

can be installed using pip from command line: pip install openpyxl
documentation is here
jehoshua likes this post
Reply
#3
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/
Reply
#4
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
jehoshua likes this post
Reply
#5
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.
jehoshua and Larz60+ like this post
Reply
#6
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.
Reply
#7
As my preference for a database was Postgres, this looks suitable - https://tkinter.com/using-postgres-cloud...orial-187/
Reply
#8
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.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020