porimol / countryinfo

A python module for returning data about countries, ISO info and states/provinces within them.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Way to use .borders() info?

thisismyuniquegithubusername opened this issue · comments

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!

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!