AVWX is a global aviation weather fetching and parsing engine. It sources reports from a variety of government sources, parses individual elements, and calculates additional information like flight rules and time range interpolation.
AVWX currently supports:
The easiest way to get started is to download the library from pypi using pip:
python -m pip install avwx-engine
Reports use ICAO idents when specifying the desired station. Exceptions are thrown if a potentially invalid ident is given.
>>> import avwx
>>>
>>> metar = avwx.Metar('KJFK')
>>> metar.station.name
'John F Kennedy International Airport'
>>> metar.update()
True
>>> metar.data.flight_rules
'IFR'
You can learn more by reading the project documentation
Note: This library requires Python 3.7 or above
Download and install the source code and its development dependencies:
git clone https://github.com/avwx-rest/avwx-engine
cd avwx-engine
python -m pip install -Ur requirements.txt
python -m pip install -e .
Code formatting should be handled by hooks in pre-commit. Before committing any code, be should to install pre-commit into the local git project:
pre-commit install
The easiest way to test the package is using the nox
library, which is installed as a dev dependency. It will manage all tests, sessions, supported versions (when available), and cleanup. The tests will pick up the local version of avwx
.
nox
If you want to run the tests directly, the test suite was built while using the pytest
library, which is also installed as a dev dependency.
pytest
The end-to-end test files were generated using util/build_tests.py
and placed into tests/{report}
. Because Timestamp generation interprets the text based on the current date, Timestamp objects are nullified in the end-to-end tests.
AVWX uses mkdocs
to build its documentation. It's just another install:
python -m pip install .[docs]
To serve the docs during development:
cd docs
mkdocs serve
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。