This project shows how to build a basic data access application that continuously runs in the background, processing a variety of weather data from the Weather Company Data for IBM REST API endpoints, including severe weather alerts, tropical storm forecasts, and the daily weather almanac to find conditions over time.
If you're participating in the Call for Code Global Challenge, go the the special Call for Code Weather web site and register. A time-limited API key will be sent to you via email. The documentation for the Weather Company APIs for Call for Code can be found the here.
All others, sign up for IBM Cloud here and provision the Weather Company Data service. The Weather Company Data service uses slightly different API versions. You can reference its documentation here.
Deploy this application to IBM Cloud.
-
Install and configure the IBM Cloud Developer Tools
-
Clone this repository
$ git clone https://github.com/Call-for-Code/weather-api-python.git $ cd weather-api-python
-
Deploy the application without starting it
$ ibmcloud cf push --no-start
-
Configure your Weather API key
<YOUR_API_KEY>
and start the application$ ibmcloud cf set-env weather-api-python WEATHER_API_KEY <YOUR_API_KEY> $ ibmcloud cf start weather-api-python
To run this application on your local machine, first install Node.js.
-
Clone this repository
$ git clone https://github.com/Call-for-Code/weather-api-python.git $ cd weather-api-python
-
Install the dependencies
$ pip install -r requirements.txt
-
Set your Weather API key
<YOUR_API_KEY>
when running the application$ export WEATHER_API_KEY=<YOUR_API_KEY> $ python app.py
This code is licensed under Apache 2.0. Full license text is available in LICENSE.