Country conversion to ISO code in TomTom bulk geocoding

This commit is contained in:
cgonzalez 2021-01-26 12:09:34 +00:00
parent d3720d6953
commit 253e0c9c18
2 changed files with 5 additions and 1 deletions

View File

@ -5,6 +5,7 @@ from cartodb_services.geocoder import geocoder_error_response
from cartodb_services.tomtom import TomTomGeocoder
from cartodb_services.tools.qps import qps_retry
from cartodb_services.tools.exceptions import ServiceException
from cartodb_services.tools.country import country_to_iso3
class TomTomBulkGeocoder(TomTomGeocoder, StreetPointBulkGeocoder):
@ -35,6 +36,9 @@ class TomTomBulkGeocoder(TomTomGeocoder, StreetPointBulkGeocoder):
results = []
for search in searches:
(search_id, address, city, state, country) = search
country = country_to_iso3(country) or country
address = address.encode('utf-8') if address else None
city = city.encode('utf-8') if city else None
state = state.encode('utf-8') if state else None

View File

@ -10,7 +10,7 @@ from setuptools import setup, find_packages
setup(
name='cartodb_services',
version='0.23.4',
version='0.23.4-cgonzalez-dev',
description='CartoDB Services API Python Library',