Geo tools for Python
import requests
def geocode(address):
data = requests.get('http://geocode-maps.yandex.ru/1.x/', params={
'geocode': address,
'format': 'json',
}).json()
try:
point = data['response']['GeoObjectCollection']['featureMember'][0] \
['GeoObject']['Point']['pos']
except KeyError:
return None
return point.split()