Skip to content

genttunn/python-rest-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-rest-api

Flask backend to ETL raw CSVs with pandas, communicate with database, and provide REST api for managing QIB collections.

Repos

GitHub repositories link:
•Back-end: https://github.com/genttunn/python-rest-api.git
•Front-end: https://github.com/genttunn/feature-manager

To set up the project

Setup a MySQL server, either online or local. Create a database called‘features-db’
Install node.js
Pull this project’s back-end and front-end from Github
Open the back-end application (python-rest-api), install the requisite packages with pip
Make a file in python-rest-api/feature_manager/ called dbparams.py, fill it like below with the variables being the created MySQL db from above:
mysql_host = *****
mysql_user = *****
mysql_db = *****
mysql_password = *****
connection_string = 'mysql+pymysql://{0}:{1}@{2}/{3}'.format(mysql_user,mysql_password,mysql_host,mysql_db)

Open a terminal at python-rest-api/ and type pipenv shell to activate pipenvshell
Type python to enter python console there
Type the following commands one by one to create the data model in database and insert some basic metadata:
from feature_manager import db
db.create_all()
from feature_manager.routes import *
quick_start()


Quit Python console and start the back-end application with python app.py
Open a terminal in the front-end application (feature-manager), type npm to install dependencies, then npm start to start the React application. The app is now empty because there are no QIB uploaded yet. These files can be found in python-rest-api/csv/. *Note: upload the qib collections file first before uploading list_patient_outcome.csv

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages