Python 2.7+, pip, Redis
- Move to
<project-dir>
, create virual environment and then activate it as
$ cd <project-dir>
$ virtualenv .environment
$ source .environment/bin/activate
- Copy
settings.sample.py
and createsettings.py
. Default configuration/settings will suffice in most of the cases. Edit the configuration if required.
Note: step-1 is required because
settings.py
contains configurations & settings which can vary platform-to-plaform.
- Add project to
PYTHONPATH
as
$ export PYTHONPATH="$PYTHONPATH:." # . corresponds to current directory(project-dir)
- Under
<project-dir>
install requirements/dependencies as
$ pip install -r requirements.txt
- Then run
app.py
as
$ python app.py
Now you can access the application by visiting http://localhost:8080
(default settings)
Note: You can change
host
andport
undersettings.py
file.
Method | URL | Body | Description |
---|---|---|---|
GET | {host} | NA | Homepage |
GET | {host}/metar/ping | NA | { |
GET | {host}/metar/info?scode={station_code}&nocache={0 or 1} | NA | Station report as - { |
Station codes can be found at http://tgftp.nws.noaa.gov/data/observations/metar/stations
Assumption: Assuming that metar endpoint will return reponse in foillowing format -
2001/11/17 15:38
KSGS 171538Z AUTO 19005KT 7SM CLR M01/M05 A3021 RMK AO2