A HTTP service that reads the data from the external services and returns the mean and sum of those values.
app.py : Run Flask script
code_hw.yml : Conda environment to run this project
config.ini : Link to endpoints
integration_test.py : A class used to perform integration test
load_data.py : A class used to load the CSV and JSON data
processor.py : A class used to handle, treat and calculate the CSV and JSON data
unit_test.py : A class used to perform unit tests
-
Conda environment:
conda env create -f code_hw.yml -n code_hw
-
Activate new environment:
conda activate code_hw
-
Run flask server
UNIX:
export FLASK_ENV=development
export FLASK_APP=app.py
Windows: set FLASK_ENV=development set FLASK_APP=app.py
flask run -h localhost -p 8000
- In a separate Terminal: curl http://localhost:8000 It's expected to get the JSON results
-
For unit tests:
python unit_test.py -
For integration test:
python integration_test.py