-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serbia, using alternate spelling 'RS' will fail to create a valid CountryInfo object #31
Comments
Update serbia.json
This issue should be fixed when pull request #35 will be approved |
@Lama09 resolved this issue. @dilettagoglia thanks for your PR. |
You're welcome. And thank you for this library, it's so helpful! |
@Lama09 I'm closing this issue as its resolved! |
@porimol this issue isn't resolved it seems. Fetching country info using 'RS' still gives the same error as 'RS' is not present in altSpellings. |
The issue is not resolved for the standard PyPi version, i.e., if we do: pip install countryinfo It installs version where this issue is not fixed. Alternatively, if we do: pip install git+https://github.com/porimol/countryinfo.git@master Only then we install the version where it is fixed (at least currently). Conclusion: the fixed version is not synchronized with PyPi, it needs to be updated there too. |
I try to get the info() output from Serbia while I use iso alpha2 "RS" for the country name.
CountryInfo('RS').info()
The code fails with an key error for 'rs' While 'RS' is not in the altSpellings list.
File "..\countryinfo.py", line 133, in capital _capital = self.__countries[self.__country_name]['capital'] KeyError: 'rs'
Running this code for other countries using alpha2 will work.
CountryInfo('DE').info()
I'm not sure if the the constructor of CountryInfo should support the iso alpha2 name as well?
I tried than to switch to full country name and encountered a problem with country name Czechia. Your help is much appriceated.
BR Lama
The text was updated successfully, but these errors were encountered: