跳转到主要内容

地理查询变得简单。

项目描述

pygeons

https://img.shields.io/pypi/v/pygeons.svg https://img.shields.io/travis/mpenkov/pygeons.svg Documentation Status Updates

使地理查询变得简单。

一些示例

>>> from pygeons.api import Country, find_cities
>>> Country('ivory coast')
Country('Ivory Coast')
>>> Country('côte d’ivoire')
Country('Ivory Coast')
>>> Country('civ')
Country('Ivory Coast')
>>> _.iso
'CI'
>>> Country('ivory coast').capital.name
'Yamoussoukro'
>>> Country('ivory coast').neighbors
[Country('Liberia'), Country('Ghana'), Country('Guinea'), Country('Burkina Faso'), Country('Mali')]
>>>
>>> Country('us').cities['moscow']
City.gid(5601538, 'Moscow', 'US')
>>> Country('us').cities['moscow'].admin2
State.gid(5598264, 'ADM2', 'Latah County', 'US')
>>> Country('us').cities['moscow'].admin1
State.gid(5596512, 'ADM1', 'Idaho', 'US')
>>> Country('us').cities['moscow'].distance_to(Country('ru').cities['moscow'])
8375.215117486288
>>>
>>> find_cities("oslo")[:2]
[City.gid(3143244, 'Oslo', 'NO'), City.gid(5040425, 'Oslo', 'US')]

特性

  • 确定一个(城市、州和国家)组合是否对应于现有的地名

  • 清洁(城市、州、国家)组合

  • 将城市、州和国家名称规范化为其规范表示形式

  • 使用英语以及每个特定国家的本土语言来构建查询

致谢

此包是用Cookiecutteraudreyr/cookiecutter-pypackage项目模板创建的。

历史

0.9.1 (2020-09-17)

  • 将顶级 G` 集合添加到 pygeons.api

  • 实现了对替代地名的处理

0.9.0 (2020-09-11)

  • 添加了新的API

  • 将数据库后端从MongoDB切换到sqlite3

  • 实现了Python中的导入脚本

0.1.1 (2017-12-03)

  • 第一个工作版本。包括导入脚本和源代码。

0.1.0 (2017-11-26)

  • 第一个在PyPI上的版本。

项目详情


下载文件

下载您平台的文件。如果您不确定选择哪一个,请了解更多关于安装包的信息。

源分布

pygeons-0.9.2.tar.gz (66.0 kB 查看哈希值)

上传时间

支持