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
- Original django-airports by Antonio Ercole De Luca
- Data from OpenFlights
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6eb998322109943bc66a3473961b63d333be8c12aa7c363eac1c3a2be1910eec
|
|
| MD5 |
16afa7eac34151cca68ba864ec309b7e
|
|
| BLAKE2b-256 |
2ef540f43c120c8d590e16c7ce0e4669f3a56232b41e3ea4a51ea0befa029fc1
|
Provenance
The following attestation bundles were made for django_airports_xtd-0.3.0.tar.gz:
Publisher:
publish.yml on arthanson/django-airports-xtd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_airports_xtd-0.3.0.tar.gz -
Subject digest:
6eb998322109943bc66a3473961b63d333be8c12aa7c363eac1c3a2be1910eec - Sigstore transparency entry: 1229984726
- Sigstore integration time:
-
Permalink:
arthanson/django-airports-xtd@10ebfb86ebc5f53f56cfd196a69a8a502bf085e1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/arthanson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@10ebfb86ebc5f53f56cfd196a69a8a502bf085e1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file django_airports_xtd-0.3.0-py3-none-any.whl.
File metadata
- Download URL: django_airports_xtd-0.3.0-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98cc5b923413033d57ffb1d6c097f232b03628e9c7ee969d70ded29c84503899
|
|
| MD5 |
a16a3ff83e379ebae5018b163c4de00f
|
|
| BLAKE2b-256 |
da55af7b1524298e06dbed3a44e5597eae874374134ad4ed7375bb27b5ac0495
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_airports_xtd-0.3.0-py3-none-any.whl -
Subject digest:
98cc5b923413033d57ffb1d6c097f232b03628e9c7ee969d70ded29c84503899 - Sigstore transparency entry: 1229984727
- Sigstore integration time:
-
Permalink:
arthanson/django-airports-xtd@10ebfb86ebc5f53f56cfd196a69a8a502bf085e1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/arthanson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@10ebfb86ebc5f53f56cfd196a69a8a502bf085e1 -
Trigger Event:
release
-
Statement type: