地理查询变得很容易。
pygeons的Python项目详细描述
侏儒
地理查询变得简单。
- 自由软件:麻省理工学院许可证
- 文档:https://pygeons.readthedocs.io。
>>> from pprint import pprint >>> import pygeons >>> # Scrub a (city, state, country) combination >>> scrubbed = pygeons.csc_scrub('sydney', 'nsw', 'au') >>> result = scrubbed.pop('result') >>> scrubbed {'score': 0.9, 'st_status': 'O', 'cc_status': 'O', 'count': 1} >>> pprint(result) {'_id': 2147714, 'abbr': [], 'admin1': 'State of New South Wales', 'admin1names': ['new south wales', 'nsw', 'state of new south wales'], 'admin2': '17200', 'admin2names': [], 'asciiname': 'Sydney', 'countryCode': 'AU', 'featureClass': 'P', 'featureCode': 'PPLA', 'latitude': -33.86785, 'longitude': 151.20732, 'name': 'Sydney', 'names': ['syd', 'sydney', 'sydney city'], 'names_lang': {'en': ['syd', 'sydney', 'sydney city']}, 'population': 4627345} >>> pygeons.csc_scrub('sydney', 'nsw', None)['result']['_id'] # same GeoNames ID as above 2147714 >>> # Normalize a state abbreviation >>> pygeons.norm('admin1', 'AU', 'nsw') 'State of New South Wales' >>> # Translate a country name in the native language into English >>> pygeons.country_info('россия')['names_lang']['en'][:4] ['ru', 'rus', 'russia', 'russian federation']
功能
-
[LI]确定一个(城市、州和国家)组合是否对应于现有地名
- 擦洗(城市、州、国家)组合
- 将城市、州和国家名称规范化为其规范表示形式
- 用英语和每个特定国家的母语框式查询
学分
这个包是用Cookiecutter和audreyr/cookiecutter-pypackage项目模板创建的。
历史记录
0.1.1(2017-12-03)
- 首次工作释放。包括导入脚本和源代码。
0.1.0(2017-11-26)
- pypi上的第一个版本。