Tools to deal with FAA NASR data
RDBMS settings are set via environment variables. Tested with Postgresql 13 and 16. Sqlite3 used for testing.
Tested with Python 3.13.
See the following for an example application: https://api.aeronautical.info/dev/?airport=ORD&include=demographic&include=geographic&include=ownership&include=runways
- uv is used to manage dependancies and virtual environments. Install that, if you don't have it yet.
- Next set up your database. I'm using postgresql, but I've tried sqlite3, too. Assuming postgresql, create the database and a user with permissions to create/alter tables.
- Clone this repo. In the repo directory, run
uv syncto set up the virtual environment and install dependancies. - Create environment variables with your database information. See details here:
aeroinfo/aeroinfo/database/__init__.py
Lines 53 to 57 in e13e314
- Run
uv run alembic upgrade headto build the database schema. - Finally, run
uv run aeroinfo/download_nasr.pyto download the current FAA NASR subscription data to a local directory and then runuv run aeroinfo/import.py /path/to/unzipped/directoryto create the database tables and populate the database.
It's probably a good idea to run uv run alembic upgrade head after pulling down a new version of aeroinfo. Or, at least check to see if there's been a database schema update and run uv run alembic upgrade head if required.
I've set up a web-based API to query an instance of aeroinfo I have running.
See details on how to use here.