import json
import urllib.request, urllib.error, urllib.parse

def get_geonames(lat, lng, types):
    url = ('http://maps.googleapis.com/maps/api/geocode/json' +
        '?latlng={},{}&sensor=false'.format(lat, lng))
jsondata = json.load(urllib.request.urlopen(url))
address_comps = jsondata['results'][0]['address_components']
filter_method = lambda x: len(set(x['types']).intersection(types))
return list(filter(filter_method, address_comps))
lat, lng = 59.3, 18.1
types = ['locality', 'administrative_area_level_1']
for geoname in get_geonames(lat, lng, types):
    common_types = set(geoname['types']).intersection(set(types))
print('{} ({})'.format(geoname['long_name'], ', '.join(common_types)))
Как изменить геокодирование на стороне сервера с помощью карт python, json и google?