Python library for airport lookup by IATA code or name
Project description
airportfinder
airportfinder is a Python library that provides a simple interface for looking up airport information by IATA code or airport name. It uses a JSON dataset of airports worldwide to provide accurate and up-to-date information.
Installation
You can install airportfinder using pip:
pip install airportfinder
Usage
from airportfinder.airportfinder import Airports
# Create an instance of the Airports class
airports = Airports()
# Look up an airport by IATA code
airport = airports.airport_iata('LGA')
print(airport) # {'code': 'LGA', 'lat': '40.7731', 'lon': '-73.8756', 'name': 'LaGuardia Airport', 'city': 'Flushing', 'state': 'New York', 'country': 'United States', 'woeid': '12520509', 'tz': 'America/New_York', 'phone': '', 'type': 'Airports', 'email': '', 'url': '', 'runway_length': '7000', 'elev': '22', 'icao': 'KLGA', 'direct_flights': '82', 'carriers': '30'}
# Look up an airport by name
airport = airports.airport_name('LaGuardia Airport')
print(airport) # {'code': 'LGA', 'lat': '40.7731', 'lon': '-73.8756', 'name': 'LaGuardia Airport', 'city': 'Flushing', 'state': 'New York', 'country': 'United States', 'woeid': '12520509', 'tz': 'America/New_York', 'phone': '', 'type': 'Airports', 'email': '', 'url': '', 'runway_length': '7000', 'elev': '22', 'icao': 'KLGA', 'direct_flights': '82', 'carriers': '30'}
The airport_iata and airport_name methods return the airport object corresponding to the provided IATA code or name. If the airport is not found, it returns None.
Contributing Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue on the GitHub repository.
License This project is licensed under the BSD 3-Clause License. See the LICENSE.txt file for details.
Acknowledgments This project uses airport data provided by Thomas Reynolds's "Airports" gist on GitHub: https://gist.github.com/tdreyno/4278655
We would like to thank Thomas for his contributions to the open-source community and for making this data available to us.
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
File details
Details for the file airportfinder-1.0.0.tar.gz
.
File metadata
- Download URL: airportfinder-1.0.0.tar.gz
- Upload date:
- Size: 239.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fa5e9c8cfaa1f3f53935983c8a7f4923b073f33866491673448f20df156e439 |
|
MD5 | e9a09f17b06d9ffd2e38e8db192f9463 |
|
BLAKE2b-256 | 66c1a3df8892a4dc527ec9d290600d282a62f1afb3cf148d2e5af91375dcf20b |
File details
Details for the file airportfinder-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: airportfinder-1.0.0-py3-none-any.whl
- Upload date:
- Size: 255.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 580f7e356d5b6975bc361147ddd66d41fc3fa91bbdad3cee7cceca0810043bf9 |
|
MD5 | 345db30ad42a557448c6de031e07cd8b |
|
BLAKE2b-256 | 4e65f5621d5dc05efd35f38000bd1ce8a0d5a234e9d7b09ba50c682d39bc4688 |