google maps api的一个小包装
mygmap的Python项目详细描述
google maps api的简单python包装器。 使用它来获取任何位置的格式化地址或坐标。
代码是Python2,但与Python3兼容。
安装
快速安装:
pip install mygmap
对于手动安装,请获取此软件包:
wget https://github.com/nikhilkumarsingh/mygmap/archive/master.zip unzip master.zip rm master.zip cd mygmap-master
安装软件包:
python setup.py install
示例
fromgeoimportlocator# get formatted address of any locationprintlocator.get_address("rohini, delhi")# get co-ordinates of locationprintlocator.get_coordinates("delhi")
输出如下:
Rohini, New Delhi, Delhi, India (28.7040592, 77.10249019999999)