Skip to main content

Taiwan Bus API for Python

Project description

TaiwanBus

台灣公車,全台皆可使用

前置作業

從pip下載/更新

pip install TaiwanBus -U

從儲存庫安裝

# 複製儲存庫
git clone https://github.com/AvianJay/TaiwanBus

# 進入資料夾
cd TaiwanBus

# 安裝
pip install .

更新公車資料庫

taiwanbus updatedb

用法

終端機

usage: taiwanbus [-h] [-p PROVIDER]
          {updatedb,showroute,searchroute,searchstop} ...

TaiwanBus

positional arguments:
   {updatedb,showroute,searchroute,searchstop}
       updatedb            更新公車資料庫
       showroute           顯示公車路線狀態
       searchroute         查詢路線
       searchstop          查詢站點

options:
   -h, --help            show this help message and exit
   -p PROVIDER, --provider PROVIDER
                             資料庫

Python

# 引入依賴庫
from taiwanbus.session import BusSession
from taiwanbus import api

# 更新資料庫
api.update_database()

# 地區資料庫
# 全台(無站點資料,無法查詢單一車站):twn
# 台中:tcc
# 台北:tpe
# 取得路線
bus = BusSession("304030", api.Provider.TWN)  # 綠3, 全台

# 更新資訊
bus.update()

# 取得資訊
bus.get_info()

# 取得站點
bus.get_stop(...)

# 模擬功能
bus.start_simulate()
bus.get_simulated_info()

Termux/Discord

項目已移至AvianJay/TaiwanBus-Utils

Credit

API by Yahoo!
(謝謝Yahoo 沒有你就不會有這個)

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

taiwanbus-0.1.0.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

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

taiwanbus-0.1.0-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file taiwanbus-0.1.0.tar.gz.

File metadata

  • Download URL: taiwanbus-0.1.0.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for taiwanbus-0.1.0.tar.gz
Algorithm Hash digest
SHA256 764d2bbf27111754bec17f2ad68b91ad5a6036dbfb896ba5f8276b7f0f46a78a
MD5 76f392e138cb5c17b9e00ff546c03f04
BLAKE2b-256 f2b828c92536d46ef81d4095feb7ee529219b65357836be16f916a8dae5b817d

See more details on using hashes here.

Provenance

The following attestation bundles were made for taiwanbus-0.1.0.tar.gz:

Publisher: release.yml on AvianJay/TaiwanBus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file taiwanbus-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: taiwanbus-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for taiwanbus-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d7e79a2a1b18bb2e712f28af44e28b3b1dc66382fd3c4aad8b73f0b0b6fcc24
MD5 34278a03d06347d2d42d5a8f0ceb0c33
BLAKE2b-256 0c8e937d230efa3039a41a6b4dea645938117fab0e33e5e2e45c9f2306924800

See more details on using hashes here.

Provenance

The following attestation bundles were made for taiwanbus-0.1.0-py3-none-any.whl:

Publisher: release.yml on AvianJay/TaiwanBus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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