airportsdata
airportsdata copied to clipboard
[FEATURE] Add possibility to find an airport
Hi, great library. I am wondering if you could implement a function to search for an airport, given the city name, the airport name, the airport code or a portion of them.
Example:
import airportsdata
airports_db = airportsdata.load()
#returns a list of airports in Milan
airports = airports_db.search("Milan")
#returns FCO airport in Rome
airports = airports_db.search("Fiumicino")
#returns Eindhoven airport in Netherlands
airports = airports_db.search("EIN")
I guess you can easily do this by merging airport name, city and airport code and then use .contains(query) on that value. The result is approximative but still valuable I think.
What do you think? Thanks!