More insight into the Foodsoft database.
Go to file
2021-05-19 14:54:21 +02:00 Init 2021-05-19 14:50:24 +02:00 Link to bindings 2021-05-19 14:54:21 +02:00
requirements.txt Init 2021-05-19 14:50:24 +02:00 Init 2021-05-19 14:50:24 +02:00


More insight into the Foodsoft database. The approach here is (because we're not Ruby programmers) that we're doing a MySQL database dump of the Foodsoft database (live @ and then loading that dump locally. Then, using sqlacodegen to generate Python-based API bindings so we can write scripts to learn more about what is happening in the database (e.g. what products from which suppliers were never ordered?).



$ python3 -m venv .venv && source .venv/bin/activate
$ pip install -U pip setuptools -r requirements.txt

Import (ask on the chat for the database dump):

$ mysql foodsoft < 2021-05-19-foodsoft.sql


$ export DB_PASSWORD=mypassword
$ python

Generate bindings

You need to have access to a database which has the Foodsoft schema loaded.

$ sqlacodegen "mysql+pymysql://<user>:<password>@<host>/<name>" >

Bindings are already included for now in