Skip to content

[FEATURE] Add possibility to find an airport #16

Open
@rignaneseleo

Description

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions