Skip to main content

Neshan 地图的 Python 客户端库

项目描述

Neshan 服务的 Python 客户端

构建状态 PyPI 版本

描述

这个库是https://github.com/googlemaps/google-maps-services-python的副本,它被更改为与 Neshan API 一起使用。如果您有任何问题,请打开一个问题。

Neshan 服务的 Python 客户端是用于以下 Neshan API 的 Python 客户端库:

  • 静态地图
  • 路线 API
  • 距离矩阵 API
  • 反向地理编码 API
  • 地图匹配 API
  • 搜索 API

要求

  • Python 3.5 或更高版本。
  • Neshan API 密钥。

安装

$ pip install -U neshan

请注意,如果要指定连接/读取超时,则需要 2.4.0 或更高版本的请求。

用法

此示例使用带有 API 密钥的 Geocoding API 和 Directions API:

import neshan
from datetime import datetime

nmaps = neshan.Client(key='Add Your Key here')

# Look up an address with reverse geocoding
reverse_geocode_result = nmaps.reverse_geocode((40.714224, -73.961452))

# Request directions via public transit
now = datetime.now()
directions_result = nmaps.direction((36.268706, 59.610011),
                                    (36.287607, 59.599527))

特征

失败重试

发生间歇性故障时自动重试。也就是说,当任何可重试的 5xx 错误从 API 返回时。

构建项目

# Installing nox
$ pip install nox

# Running tests
$ nox

# Generating documentation
$ nox -e docs

# Copy docs to gh-pages
$ nox -e docs && mv docs/_build/html generated_docs && git clean -Xdi && git checkout gh-pages

文档和资源

API 文档

支持

变更日志

此项目的所有显着更改都将记录在此文件中。

[v1.1.1]

固定的

  • Readme.md 和 pypi 包说明

[v1.1.0]

添加

  • 静态地图api

[v1.0.0]

添加

  • 初始版本

项目详情


下载文件

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

源分布

neshan-1.1.1.tar.gz (22.4 kB 查看哈希)

已上传 source

内置分布

neshan-1.1.1-py3-none-any.whl (22.3 kB 查看哈希)

已上传 py3