Forecast-API is a a weather web service, allowing you to get forecaste information.
Given longitude and latitude, the API return the temperature and precipitation measures in this area.
Originaly this project used AWS- an EC2 instance with python virtual evnironment.
In this case, installation works bit different:
-
Open SSH connection with .pem file.
-
Use the package-management system of the server operation system to install requirements.
Alternatively, if package-management system can't install some requirements (like yum):
- Install Python 3.6:
sudo yum install rh-python36
- Create new virtual environment:
python3 -m venv venv
- Activate the virtual environment:
source venv/bin/activate
- Install git in your EC2 instance, and clone this repository:
sudo yum install git -y git clone https://github.com/shiraz-it/Forecast-API.git
- Install project's python dependencies (no need to mention pip3 in venv):
pip install -r requirements.txt
- Create your oun DB:
python DBCreation.py
- Run the app:
python forecast_api_app.py &
- First, clone the repository:
- Install project's python dependencies:
pip install -r requirements.txt
Unless you are using remote web server, the app is running and listening in http://127.0.0.1:5000/.
- For the forecast information in longitude = -180.0 and latitude = -90.0:
http://127.0.0.1:5000/weather/data?lat=-90.0&lon=-180.0
- For the summary of forecast information in longitude = -152.0 and latitude = -90.0, hence the minimum, maximum and average of temperature and precipitation:
http://127.0.0.1:5000/weather/summarize?lat=-90.0&lon=-152.0
Enjoy :)