Skip to main content

Advanced Aviation Analytics: Network Intelligence, Synthetic Routes, Emissions v2, Geo-Spatial Analysis & Passenger Experience

Project description

AeroNavX

A production-grade Python library for airport data and flight geometry calculations.

🆕 v0.2.0: Now with 84,000+ airports from OurAirports (MIT License)

Features

  • 🛫 Airport Database: 84,000+ global airports with efficient IATA/ICAO indexing
  • 📏 Distance Calculations: Haversine, Vincenty, and Spherical Law of Cosines
  • 🌍 Geodesy: Bearings, midpoints, great circle paths
  • 🔍 Search: Fuzzy name search, nearest neighbor queries, radius search
  • 🛤️ Routing: Multi-segment routes, flight time estimation, shortest paths
  • 📊 Analytics: Statistics by country, continent, type, and elevation
  • Timezone Support: Automatic timezone detection and local time
  • 🌱 Emissions: CO2 emissions estimation per passenger
  • 🌤️ Weather: METAR and TAF data fetching
  • 💻 CLI: Command-line interface for quick queries
  • 🌐 REST API: FastAPI-based web service

Installation

pip install aeronavx

Or from source:

git clone https://github.com/teyfikoz/AeroNavX.git
cd AeroNavX
pip install -e .

Quick Start

import aeronavx

# Get airports
ist = aeronavx.get_airport("IST")
jfk = aeronavx.get_airport("JFK")

# Calculate distance
dist_km = ist.distance_to(jfk)
print(f"Distance: {dist_km:.2f} km")

# Find nearest airports (plural for multiple results)
nearest = aeronavx.nearest_airports(41.0, 29.0, n=5)
for airport in nearest:
    print(f"  {airport.iata_code}: {airport.name}")

# Or get single nearest airport
closest = aeronavx.nearest_airport(41.0, 29.0)
print(f"Closest: {closest.name}")

# Estimate emissions
co2 = aeronavx.estimate_co2_kg_for_segment("IST", "JFK")
print(f"CO2: {co2:.2f} kg per passenger")

Advanced: Filtering Airports

from aeronavx.core import loader

# Load only major airports (large + medium with scheduled service)
major_airports = loader.load_airports(
    include_types=['large_airport', 'medium_airport'],
    scheduled_service_only=True
)
print(f"Major airports: {len(major_airports):,}")  # ~3,200

# Load specific countries
us_airports = loader.load_airports(countries=['US'])
print(f"US airports: {len(us_airports):,}")  # ~20,000

# Load airports with IATA codes only
iata_airports = loader.load_airports(has_iata_only=True)
print(f"IATA airports: {len(iata_airports):,}")  # ~9,000

CLI Usage

# Calculate distance
aeronavx distance --from IST --to JFK --unit nmi

# Find nearest airports
aeronavx nearest --lat 41.0 --lon 29.0 --n 5

# Search by name
aeronavx search --name "Heathrow"

# Estimate emissions
aeronavx emissions --from IST --to LHR

# Flight time
aeronavx flight-time --from IST --to JFK

API Server

python -m aeronavx.api.server

Then access:

Data

AeroNavX includes 84,000+ airports from OurAirports, which provides:

  • Global Coverage: Airports, heliports, seaplane bases, and more
  • MIT License: Free to use commercially
  • Regular Updates: Community-maintained and updated
  • Comprehensive Data: IATA/ICAO codes, coordinates, types, and more

Data Attribution: Airport data from OurAirports (David Megginson et al.) - Licensed under MIT License

Examples

See examples/ directory for:

  • basic_distance.py: Distance calculations
  • nearest_airports.py: Finding nearby airports
  • routing_example.py: Multi-segment routes
  • emissions_example.py: CO2 estimation

Testing

pytest

Dependencies

Required: Python >= 3.10

Optional:

  • pandas: DataFrame support
  • scipy: Faster spatial indexing
  • rapidfuzz: Better fuzzy search
  • timezonefinder: Timezone support
  • fastapi, uvicorn: API server
  • requests: Weather data

License

MIT License

Contributing

Contributions welcome! Please open an issue or pull request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aeronavx-2.0.1.tar.gz (3.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aeronavx-2.0.1-py3-none-any.whl (3.8 MB view details)

Uploaded Python 3

File details

Details for the file aeronavx-2.0.1.tar.gz.

File metadata

  • Download URL: aeronavx-2.0.1.tar.gz
  • Upload date:
  • Size: 3.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for aeronavx-2.0.1.tar.gz
Algorithm Hash digest
SHA256 0438910d3107d5ee204b30fe9e7f5d6304c7e939fa9d26d607f468d2a8601a2e
MD5 4e9e0d0e948b759d88e3eb33dd38849c
BLAKE2b-256 016b8e08c0bce19d4941e8aa8e61aefb933e23ead840995d6a362e784bb723c9

See more details on using hashes here.

File details

Details for the file aeronavx-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: aeronavx-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for aeronavx-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fefd8badbf305a5dab11f951c188fd711d17e21d00759268880d2f1e2ea206ff
MD5 b7b10e14d08c3d0da9212e51979ebcd7
BLAKE2b-256 fc520ce1d4b988dd774531e4a4e5f0114a57cd376e349b4bc086f8891d977167

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page