Skip to main content

Python library for connecting to TDX

Project description

Overview

This package can be used to connect transportation data from TDX (Transport Data eXchange) in a neat and efficient way in Python. TDX platform is supported by Ministry of Transportation and Communications (MOTC) in Taiwan, which provides lots of API for the members download the transportation data. Before using the function provided in this package, the authentication key is a must, which can be applied from TDX platform. After being a member of TDX, you will soon get the Client Id and Client Secret, please check out in the API key Dashboard.

If you are R user, please install the packages on Github via devtools::install_github("ChiaJung-Yeh/NYCU_TDX"), and all of the functions can be found in TDX Guide website.

Installation

Please install the package via following pip code.

pip install nycu-tdx-py

Usage

Data retrieving process requires an access token to obtain the data from TDX platform. Every function in this package should use function get_token() to obtain the token by entering your Client ID and Client Secret first. Note that the access token will expire in 1 day.

Take retrieving bus stops of Taipei City for example. The code is shown below. Here the argument client_id and client_secret is the authentication key applied from TDX.

from nycu_tdx_py import tdx

# get the access token first
access_token=tdx.get_token("CLIENT_ID", "CLIEN_SECRET")

# retrieve Taipei bus stops
taipei_bus=tdx.Bus_StopOfRoute(access_token, "Taipei")

Support

This package takes advantage of API service provided by TDX, MOTC.

Contact

For questions, bugs, and other discussion, please feel free to contact the package maintainer, Chia-Jung (Robert), Yeh.
Email: chia-jung.yeh@sydney.edu.au

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

nycu_tdx_py-0.1.46.tar.gz (10.6 kB view details)

Uploaded Source

File details

Details for the file nycu_tdx_py-0.1.46.tar.gz.

File metadata

  • Download URL: nycu_tdx_py-0.1.46.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for nycu_tdx_py-0.1.46.tar.gz
Algorithm Hash digest
SHA256 434ad5276bddb0c9b96fdd09fff9b7bf08d2186e05cb43a83026de3060e198ac
MD5 1c54d7bd561fae23542aa0033de25763
BLAKE2b-256 645d5326350a8a73c2335d6c6d2ea2c2a3e7cfd4fe9a54df3bc91f1d71eeb798

See more details on using hashes here.

Supported by

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