avwx-rest/avwx-engine

lookup station by IATA code?

Closed this issue · 2 comments

i maintain a discord bot that uses this library, and it would be really usful for there to be a way to lookup a station by the iata code, instead of just by the icao code.

It's possible to do this already by doing a text search, but yeah this can be added via a LazyCalc similar to ICAO lookups

Added in 1.6.5. Uses LazyCalc so the data and mapping isn't generated unless needed.

>>> import avwx
>>> 
>>> london = avwx.Station.from_iata("LHR")
>>> 
>>> london == avwx.Station.from_icao(london.icao)  # EGLL
True