Skip to main content

SDK for Ekispert API

Project description

駅すぱあと API SDK for Python

駅すぱあと APIをPythonから利用するためのSDKです。

インストール

pip でインストールします。

pip install ekispert

初期化

初期化時には、駅すぱあと APIのAPIキーを指定します。APIキーはトライアル申し込みより取得してください。

from ekispert.client import Ekispert

client = Ekispert("YOUR_API_KEY")

駅情報の取得

駅情報取得APIを実行します。検索条件、結果は駅情報 - 駅すぱあと API Documents 駅データ・経路検索のWebAPIを参照してください。

query = client.stationQuery()
query.code = 22828
points = query.execute()
assert len(points) == 1
assert points[0].station.name == '東京'
assert points[0].geo_point.lati_d == 35.678083
assert points[0].prefecture.name == '東京都'
assert points[0].prefecture.code == 13

駅簡易情報の取得

駅簡易情報APIを実行します。検索条件、結果は駅簡易情報 - 駅すぱあと API Documents 駅データ・経路検索のWebAPIを参照してください。

query = client.stationLightQuery()
query.name = '東京'
points = query.execute()
assert len(points) > 0
assert points[0].station.name == '東京'
assert points[0].prefecture.name == '東京都'
assert points[0].prefecture.code == 13

平均待ち時間探索

平均待ち時間探索APIを実行します。検索条件、結果は平均待ち時間探索 - 駅すぱあと API Documents 駅データ・経路検索のWebAPIを参照してください。

query = client.searchCoursePlainQuery()
query.from_ = 25077
query.to = 29090
courses = query.execute()
assert len(courses) > 0
assert courses[0].routes[0] is not None
assert courses[0].prices[0].kind == "ChargeSummary"
assert courses[0].prices[0].one_way == 2530
assert courses[0].prices[0].round == 5060

ライセンス

MITライセンスです。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ekispert-0.1.6.tar.gz (24.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ekispert-0.1.6-py3-none-any.whl (53.1 kB view details)

Uploaded Python 3

File details

Details for the file ekispert-0.1.6.tar.gz.

File metadata

  • Download URL: ekispert-0.1.6.tar.gz
  • Upload date:
  • Size: 24.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for ekispert-0.1.6.tar.gz
Algorithm Hash digest
SHA256 b1e9b5ae25d98b77ba757c30ae8c36a0ff1709ac4c94b78513ee128c5302ae82
MD5 647b172529b1dec350885571f10ed277
BLAKE2b-256 02cec48747e1201c8bf49484ef119bb7fd71015a634e5fc43f69d72e230a076a

See more details on using hashes here.

File details

Details for the file ekispert-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: ekispert-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 53.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for ekispert-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e326564a579cc8e3460f7c7bdc5d993192bfdcbeb1d0c7c76bbf884770be37d5
MD5 4f46bb591c579f870f59ac1263cbf744
BLAKE2b-256 623f7e1b17326eb4e2c025e7df6aec49c56aa759cc6b16c1a3affed08669b77a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page