The NYC Mortality API is a web service designed to analyze and provide insights into mortality rates in New York City. This project leverages PostgreSQL as the database to store mortality data, Python (with Flask) as the backend framework, and React for the frontend user interface (TODO).
- Retrieve the version of the PostgreSQL database.
- Analyze mortality data based on various parameters (e.g., demographics, causes of death).
- Flexible and reusable query execution with connection pooling for efficient database access.
- Backend: Python, Flask
- Database: PostgreSQL
- Frontend: React
- Database Driver: psycopg2 for PostgreSQL interaction
-
Clone the repository:
git clone https://github.com/your-username/NYC-Mortality-Api.git cd NYC-Mortality-Api
Install dependencies:
pip install -r requirements.txt
Create a
.env
file in the root directory and populate with secrets. DO NOT store secrets inexample.env
. -
DO NOT write code in main
code in a different branch that is not main
example git checkout -b"update-readme"
on terminal
-
Always pull main before creating new code example
git pull origin main
on terminal -
Unzip the random_search_model.pkl.zip file
-
Run server
python3 app.py
-
Before writing code:
git pull origin main
-
When done writing code:
git add .
git commit -m "message"
git push origin main
curl -X POST http://localhost:5000/predict -H "Content-Type: application/json" -d '{
"Sex": ["Male"],
"Race Ethnicity": ["Hispanic"],
"Death Rate": [15.4],
"Age Adjusted Death Rate": [22.8]
}'
{
"predicted_leading_cause": "Meningitis (G00, G03)"
}
Ruby Ssk
Ezeddin Fadel
Jonathan Amsalem