Skip to content

amenai1979/wxflightpath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wxflightpath

License: GPL-3.0

Overview

wxflightpath retrieves a text-based observation and forecast for flight planning. Given specific origin and destination OACI codes, this project determines all stations within and around the flight path, retrieves all observations (METARs), and forecasts (TAFs) renders them in text mode and audio. There is an option to upload the result on an S3 bucket and return the result in a 200 OK response if you properly configure it. There is also an option to run it as a webserver. Enjoy!

Limitation

This is currently limited to French airfields. Future developments may include other airfields.

Installation

The steps below assume you're running on a Linux/MacOS system. To install wxflightpath, use the following steps:

Step1 Optional but recommended : create a venv

creating a python virtual environment avoids any problems with
existing python interpreter configurations on your system.

$ python3 -m venv wxflightpath-venv
$ source wxflightpath-venv/bin/activate

Step2 : install the requirements.

$ pip install -r requirements.txt

Step3 : configure wxflightpath.

in the project root directory there is aconfiguration file: default.cfg.

Step3.1 : get a security token for the avwx.rest api.

sign up and obtain a token from https://info.avwx.rest/

Step3.2 : Optional - configure your AWS infrastructure.

sign up to or use an AWS account on https://aws.amazon.com/
if you want to run this locally or remotely with AWS. details on how to do it are out of scope of this project. just know that you need an S3 bucket and You need to put your avwx
secret token in Secrets manager.

Step3.3 : configure default.cfg.

Configure default.cfg properly by either:

  • adding a token in the SECURITY section
  • adding the secrets and S3 bucket name in the AWS section to run the AWS Lambda demo (requires AWS prior configuration). if you wish to run this as an HTTPS endpoint configure properly the HTTPS section:
  • add the server certificate and key paths
  • add the https port your server will be listening to

There is an option to use an AWS generated certificate using ACM for free and use it on an EC2 instance.

Step3.4 : run the smoke test.

run the tests using the shell script in the scripts directory.

$ cd scripts/
$ sh run_tests.sh

Fix any issues if you can. Otherwize report an issue

Step3.5

Enjoy!

Usage

from the project root using a terminal (Linux)

$ cd scripts/
$ sh run_wxcrawler_demo.sh 

if you want to run the AWS lambda demo:

$ cd scripts/
$ sh run_wxcrawler_aws_demo.sh 

for demo purposes the run_wxcrawler_aws_demo.sh scripts also generates an audio briefing file, you can find it in the audio/ folder.

if you want to run it as a webserver (using Flask)

$ cd scripts/
$ sh run_wxcrawler_https_server.sh

Then in another terminal:

$ curl https://yourhostname.com:8443/brief?origin=LFPT&destination=LFRU

if you have AWS configured properly you may choose to use the S3 object generated:

$ curl -L https://yourhostname.com:8443/brief-redirect?origin=LFPT&destination=LFRU

This will automatically follow the redirect and display the briefing text.

MultiLanguage Support

It is possible to translate the text briefing to another language. To keep the code light we offer multiple translation API options in the openaitranslator.py file. You will need to sign up to Open AI and get an API key (highly recommended). The other options are available but limited. you'll need to sign up and configure appropriately the keys. remember to keep your settings in default.cfg. Happy Briefing! One of the demo methods in wxcrawler.py 'demo_wxcrawler_fr_trainer()' allows you to train a local keyvalue database to limit the reuest rate to the translation API.

Project Details

Author: Alexandre Menai
Email: amenai@amenai.net
Version: 1.1
Development Status: 3 - Alpha
Python Version: 3.11

Links

Source Code: https://github.com/amenai1979/wxflightpath/
Bug Reports: https://github.com/amenai1979/wxflightpath/issues

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.

Contributing

If you'd like to contribute to wxflightpath, please check the CONTRIBUTING.md file for guidelines.

Acknowledgments

Kudos to Sam Drew the author of picket that is used in this project. Kudos to Christian Quest who ceated the data used in this project Kudos to the Open source community!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published