By no means this is a best practices example application. It does basic plumbing to get the tasks done. This application is a python restapi application which utlises the power of swagger to fetch data from open web service which return some json data. It can store data to local file and also to mysql database.
Refer swagger.yml
for restapi calls
-
Shows user information from py-rest-api in homepage
http://localhost:9000
-
http://localhost:9000/api/get-people-web
reads py-rest-api and stores json data to a local filedata.json
-
http://localhost:9000/api/get-people-file
reads from localdata.json
-
http://localhost:9000/api/save-people-db
reads localdata.json
and inserts in mysql
- Make Galera cluster up and running, Ref https://github.com/mumehta/eth-stack
- Create database by connecting to one of the endpoint, Ref eth-stack
- Create database person and exit
create table person (id int(10) primary key not null auto_increment, fname varchar(255), lname varchar(255));
- Update the eth-stack's galara db (any node) endpoint to
people.py
file - pymysql.connect section
- Make virtual env
python -m venv .venv
-
pip install -r requirements.txt
-
python app.py
-
Open browser and make use of endpoint mentioned above