vincentarelbundock / countrycode

R package: Convert country names and country codes. Assigns region descriptors.
https://vincentarelbundock.github.io/countrycode
GNU General Public License v3.0
342 stars 84 forks source link

Python package of this library not working #318

Closed morrisseyj closed 1 year ago

morrisseyj commented 1 year ago

Appreciate this is for the R package, but I just had an experience with the Python package and noted that it isn't working. The python package (https://pypi.org/project/countrycode/) points to this github page, which is dead: https://github.com/vincentarelbundock/pycountrycode

The issue and its resolution is described here: https://stackoverflow.com/questions/73734003/typeerror-module-object-is-not-callable-error-shows-wrong-temp-file-appdat/73734225#73734225

In short the problem is that accessing the library requires going a level down after importing:

#import the module as per the vignette
from countrycode import countrycode
#Go an extra level down to access the package to make it work
countrycode.countrycode(['codes=['Algeria', 'United States'],  origin='country_name', target='iso3c')
#Failing to call the extra level (`countrycode(['codes=['Algeria', 'United States'],  origin='country_name', target='iso3c')`) does not work, returning a TypeError object not callable 

Is this python port dead? Is there anything to be done?

Thanks

vincentarelbundock commented 1 year ago

Frankly, I don't even remember putting this python code together, and I have not touched it in years. So yes, I would say it is abandonned/dead.

Someone wrote me an email a while ago about using our dictionary in a python port, so there may be an alternative out there somewhere, but I'm not sure.