A simple, standalone frontend for database editing using Python. It is based on the following libraries:
- sqlalchemy: database connections and data models
- Flask: web application framework
- Flask-Admin: provides ModelView class for data model editing
- pywebview: uses PyQT to provide webview GUI window containing application
- Data models defined in Python using SQL Alchemy are database agnostic
- View and sort database table contents
- Form for creating and editing items
- Widgets such as foreign-key dropdowns and date pickers
Set up a Python virtual environment, then:
pip install -r requirements.txt
python app.py
A window will pop up containing the running application. Close the window to end.
This example uses a SQLite database, but SQLAlchemy can connect to many other types e.g. PostgreSQL or Oracle (via psycopg2
and cxOracle
respectively).
Just update the SQLALCHEMY_DATABASE_URI.
Use sqlacodegen to automatically generate model definitions from existing database tables.