I am trying to add a new key called Country. My main problem is to convert the location into Country. The Users from Stackoverflow can write everything and it has no format. I have tried geopy but it doesn't detect some countries for Russia
or Tokyo
as a state.
The second problem is that geopy doesn't allow many requests. I have around 8 million Users.
That Code is just an edit version:
def geopytesting(testing, user):
from geopy import Nominatim
try:
geolocator = Nominatim()
location2 = geolocator.geocode(testing)
print(location2.address)
except BaseException:
print("Error")
geopytesting("Russia",None)
geopytesting("Hamburg",None)
geopytesting("Madrid",None)
geopytesting("Omaha",None)
geopytesting("Berlin",None)
geopytesting("Schleswig-Holzstein",None)
geopytesting("Asyż",None)
geopytesting("",None)
geopytesting("Tilted Tower",None)
I hope you can Help me. I really try many things and I haven't seen a post which handle this specific problem. Either it detect some countries or I get kicked out because I made too many requests.