porimol / countryinfo

A python module for returning data about countries, ISO info and states/provinces within them.
MIT License
140 stars 44 forks source link

Way to use .borders() info? #28

Open thisismyuniquegithubusername opened 3 years ago

thisismyuniquegithubusername commented 3 years ago

I want to get the population of the bordering countries to my input, the .borders() method returns, I believe, the alpha3 ISO code for the bordering countries, but the library does not accept alpha3 ISO codes as input. Is there an easy way to convert between the ISO code and the country name? Or to output .borders() info in an input-able format? In the meantime, I am going to add the ISO codes to the altSpellings list which will make them input-able, but I would love an official, cleaner fix!

thisismyuniquegithubusername commented 3 years ago

I fixed this one too on my end :) I edited this if self.__country_name in map(lambda an: an.lower(), country_info.get('altSpellings', [])) or self.__country_name in map(lambda an: an.lower(), country_info.get('ISO', {}).values()): on line 36 so that ISO values are included as alternate names. Thanks again for this wonderful library!