GithubHelp home page GithubHelp logo

agman / avwx-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from avwx-rest/avwx-api

0.0 1.0 0.0 1.91 MB

AVWX service API as a Flask app on Azure

License: MIT License

API Blueprint 51.84% Python 33.33% CSS 1.28% HTML 12.98% JavaScript 0.58%

avwx-api's Introduction

AVWX-API

Requirements Status License: MIT

About

The AVWX REST API is built as a Python Quart app which is a Flask-compatible async web backend. It sources METAR and TAF reports from NOAA ADDS and other localized weather sources (where available) via the AVWX-Engine library which I also maintain.

The core benefit of AVWX over other sources is its parsing engine. It provides a more accurate interpretation of the raw report string than aging government sources and includes value-added features like calculating flight-rules, translating report elements into English, and providing text-to-speech representations of the report and its elements.

For more information, go to the hosted version at avwx.rest.

Quickstart

The easiest way to get the app running is to create and run it in Docker. First, copy to example Dockerfile.

cp Dockerfile.example Dockerfile

Now we need to comment out three ENV vars in the Dockerfile. These are grouped together:

ENV MONGO_URI='...'
ENV PSQL_URI='...'
ENV GN_USER='...'

A quick explanation of what these do:

  • MONGO_URI: This connects the app to the request caching database. Commenting out disables caching
  • PSQL_URI: This connects the app to the account database for things like token authentication. Commenting out opens all endpoints
  • GN_USER: This is the GeoNames user name for coordinate lookup calls. Commenting out causes coord requests to fail. You can supply your own for testing

Now you should be able to build and run the Docker container:

docker build -t avwx_api .
docker run -p 8000:8000 avwx_api

It should now be available at http://localhost:8000

Setup

First we should install the app requirements and copy the env file. I recommend always installing into a virtual environment. Dotenv is not in the requirements file because it is only used in development.

pip install -r requirements.txt
pip install python-dotenv
cp .env.sample .env

For an explaination of the variables in .env, see the quickstart. Feel free to comment or replace these as you see fit.

Before we can run the app, we need to tell Quart where the app is.

export QUART_APP=avwx_api:app
export QUART_ENV=development

Running

Once the app is configured, use the Quart CLI to run it. It will be in development/debug mode.

quart run -p 8000

It should now be available at http://localhost:8000

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.