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
Metadata
Release files for django-airports-xtd 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_airports_xtd-0.3.0.tar.gz | 10.7 kB | With provenance | Details for django_airports_xtd-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_airports_xtd-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for django_airports_xtd-0.3.0-py3-none-any.whl |
Total release size: 21.2 kB
Release files / django_airports_xtd-0.3.0.tar.gz
| Download URL | django_airports_xtd-0.3.0.tar.gz |
|---|---|
| Size | 10.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6eb998322109943bc66a3473961b63d333be8c12aa7c363eac1c3a2be1910eec
|
|
BLAKE2b-256 checksum How to use checksums |
2ef540f43c120c8d590e16c7ce0e4669f3a56232b41e3ea4a51ea0befa029fc1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 3, 2026.
Transparency logRelease files / django_airports_xtd-0.3.0-py3-none-any.whl
| Download URL | django_airports_xtd-0.3.0-py3-none-any.whl |
|---|---|
| Size | 10.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
98cc5b923413033d57ffb1d6c097f232b03628e9c7ee969d70ded29c84503899
|
|
BLAKE2b-256 checksum How to use checksums |
da55af7b1524298e06dbed3a44e5597eae874374134ad4ed7375bb27b5ac0495
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 3, 2026.
Transparency logSecurity for django-airports-xtd 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for django_airports_xtd-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 3, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.