Skip to main content

Django app providing airport data from OpenFlights

Project description

django-airports-xtd

Django app providing transport hub data (airports, train stations, ferry terminals) from OpenFlights.

Documentation | PyPI | GitHub

Requirements

  • Python 3.10+
  • Django 5.0+
  • GeoDjango with PostGIS or Spatialite
  • django-cities-xtd >= 0.7.0

Installation

pip install django-airports-xtd

Add to your INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    "django.contrib.gis",
    "cities",
    "airports",
    ...
]

Configure the cities model settings:

CITIES_COUNTRY_MODEL = "cities.Country"
CITIES_CITY_MODEL = "cities.City"

Run migrations:

python manage.py migrate

Usage

Import data from OpenFlights:

# Import airports only (default)
python manage.py airports

# Import airports and train stations
python manage.py airports --stations

# Import airports and ferry terminals
python manage.py airports --ports

# Import all types
python manage.py airports --all

For detailed usage examples and spatial queries, see the documentation.

Models

Three models are provided, all with GeoDjango PointField support:

Model Description
Airport Airports and airfields
TrainStation Train stations with IATA codes
Port Ferry terminals with IATA codes

Common fields (shared via abstract base):

Field Description
id Django auto-generated primary key
openflights_id Unique identifier from OpenFlights database
name Hub name
iata 3-character IATA code (e.g., "JFK")
icao 4-character ICAO code (e.g., "KJFK")
altitude Altitude in meters
location GeoDjango PointField (SRID 4326)
country ForeignKey to cities.Country
city ForeignKey to cities.City
timezone IANA timezone (e.g., "America/New_York")
source Data source ("OurAirports", "Legacy", "User")

Compatibility

Python Django 5.0 Django 5.1 Django 5.2 Django 6.0
3.10 Yes Yes Yes -
3.11 Yes Yes Yes -
3.12 Yes Yes Yes -
3.13 - Yes Yes Yes
3.14 - - Yes Yes

Development

See the development documentation for setup instructions.

Quick Start

# Clone the repository
git clone https://github.com/arthanson/django-airports-xtd.git
cd django-airports-xtd

# Run tests
just test-quick

# Run linting
just lint

Disclaimer

This project is not affiliated with, endorsed by, or associated with OpenFlights or its maintainers. It is an independent, third-party Django integration that consumes publicly available OpenFlights data.

License

MIT License

Credits

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

django_airports_xtd-0.3.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

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

django_airports_xtd-0.3.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file django_airports_xtd-0.3.0.tar.gz.

File metadata

  • Download URL: django_airports_xtd-0.3.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_airports_xtd-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6eb998322109943bc66a3473961b63d333be8c12aa7c363eac1c3a2be1910eec
MD5 16afa7eac34151cca68ba864ec309b7e
BLAKE2b-256 2ef540f43c120c8d590e16c7ce0e4669f3a56232b41e3ea4a51ea0befa029fc1

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_airports_xtd-0.3.0.tar.gz:

Publisher: publish.yml on arthanson/django-airports-xtd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_airports_xtd-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_airports_xtd-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 98cc5b923413033d57ffb1d6c097f232b03628e9c7ee969d70ded29c84503899
MD5 a16a3ff83e379ebae5018b163c4de00f
BLAKE2b-256 da55af7b1524298e06dbed3a44e5597eae874374134ad4ed7375bb27b5ac0495

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_airports_xtd-0.3.0-py3-none-any.whl:

Publisher: publish.yml on arthanson/django-airports-xtd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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