Package: airports-py
airports-pyA comprehensive Python library providing easy retrieval of airport data based on IATA, ICAO, city codes, country codes, and continents. Ideal for developers building applications related to aviation, travel, and geography in Python.FeaturesRetrieve airport data using IATA code.Retrieve airport data using ICAO code.Fetch data using city codes.Fetch data using country codes.Retrieve data based on continents.Built-in error handling for invalid input formats.Efficiently packaged with gzipped data.Comprehensive Data Access: Retrieve airport data using IATA code, ICAO code, city codes, country codes, and continents.Unique Link Integration: The first library to provide direct links toFlightRadar24,Radarbox, andFlightAwarefor each airport, giving users immediate access to live flight tracking and airport data.InstallationYou can installairports-pyusing pip:pipinstallairports-pyUsageHere's how you can use the library:fromairportsimportairport_data# Retrieve airport data using IATA codeairport_by_iata=airport_data.get_airport_by_iata("AAA")print(airport_by_iata)# Retrieve airport data using ICAO codeairport_by_icao=airport_data.get_airport_by_icao("NTGA")print(airport_by_icao)# Fetch data using city codesairport_by_city=airport_data.get_airport_by_city_code("NYC")print(airport_by_city)# Fetch data using country codesairport_by_country=airport_data.get_airport_by_country_code("US")print(airport_by_country)# Retrieve data based on continentsairport_by_continent=airport_data.get_airport_by_continent("AS")print(airport_by_continent)Using Command-Line Interface (CLI):You can also directly execute Python code from the CLI without entering the interactive shell. Navigate to the root of your project and run:python3-c"from airports import airport_data; result = airport_data.get_airport_by_iata('MAA'); print(result)"Replace'MAA'with other codes as needed.TestingTo test the library locally:Navigate to the root of the project:cdpath_to_airports-pyRun the tests using:python3-munittestdiscovertests-vThis command will discover and run all test files inside thetestsdirectory and provide a detailed output.Example Data FieldsFor Chennai International Airport:Field NameDataIATAMAAICAOVOMMTime ZoneAsia/KolkataCity CodeMAACountry CodeINNameChennai International AirportLatitude12.99Longitude80.1693Altitude (in feet)52StateTamil NaduCityPallavaramCountyKancheepuramState CodeTamil NaduAirport Typelarge_airportContinentASState AbbreviationIN-TNInternationalTRUEWikipedia LinkWikipediaOfficial WebsiteChennai AirportLocation ID12513629Phone Number044-2340551Runway Length (in meters)10050Flightradar24Flightradar24RadarboxRadarboxFlightaware LinkFlightawareSingapore Changi Airport:Field NameDataIATASINICAOWSSSTime ZoneAsia/SingaporeCity CodeSINCountry CodeSGNameSingapore Changi AirportLatitude1.35019Longitude103.994Altitude (in feet)22StateSingaporeCitySingaporeCountySingaporeState CodeSouth EastAirport Typelarge_airportContinentASState AbbreviationSG-04InternationalTRUEWikipedia LinkWikipediaOfficial WebsiteChangi AirportLocation ID12517525Phone Number(65) 6542 1122Runway Length (in meters)13200Flightradar24Flightradar24RadarboxRadarboxFlightawareFlightawareRunning the Project LocallyClone the repository:gitclonehttps://github.com/aashishvanand/airports-py.gitChange into the cloned directory:cdairports-pyInstall the necessary dependencies:pipinstall-rrequirements.txtTo run tests:python-munittestdiscovertestsLicenseThis project is licensed under the MIT License - see theLICENSEfile for details.ContributingContributions, issues, and feature requests are welcome! Feel free to check theissues page.