Skip to main content

Production-grade airport data and flight geometry library

Project description

AeroNavX

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

Features

  • 🛫 Airport Database: Global airport data 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

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
nearest = aeronavx.nearest_airport(41.0, 29.0, n=5)

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

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

Place your airports.csv file in the data/ directory. The CSV should contain:

  • Basic info: id, ident, type, name
  • Coordinates: latitude_deg, longitude_deg, elevation_ft
  • Location: continent, iso_country, iso_region, municipality
  • Codes: gps_code (ICAO), iata_code, local_code
  • Optional: scheduled_service, home_link, wikipedia_link, keywords

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-0.1.2.tar.gz (23.2 kB view details)

Uploaded Source

Built Distribution

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

aeronavx-0.1.2-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aeronavx-0.1.2.tar.gz
  • Upload date:
  • Size: 23.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for aeronavx-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7aaf91f6e5e05e7d8822f2ab4e3da0adea8de636cbe455c26aa3fe17f8612696
MD5 708f516cd69aec37cf2500bfbae06591
BLAKE2b-256 90e235c9dc82e71fc2a929e9d8852b07a959c9d2ba0122eff08cc3e5602d8614

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aeronavx-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for aeronavx-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d23f82d489c556fdc511b509a5189f508e0f5ba1ee78548301cb281f1ef2e079
MD5 c6d5fb795284bfd3e8a90a2ae5b9a4cc
BLAKE2b-256 9754c3b6af9542ffd2801623688624770bb1b7484f1277d9b76d1c1232aa1723

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