GithubHelp home page GithubHelp logo

isabella232 / landtransportsg Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yuhui/landtransportsg

0.0 0.0 0.0 98 KB

Unofficial Python package for interacting with APIs available at Land Transport Authority's DataMall.

License: GNU General Public License v3.0

Python 100.00%

landtransportsg's Introduction

landtransportsg

Python 3 PyPi PyPi status GNU General Public License v3.0 Documentation Status

This is an unofficial Python package for interacting with APIs available at LTA DataMall.

Installing the package

Install the package using pip:

pip install landtransportsg

Using the package

Pre-requisite:

The main steps are:

  1. Import a class.
  2. Instantiate an object from the class.
  3. Call a function on that object.

For more information, refer to the documentation.

Usage overview

Interacting with LTA DataMall's API is done through one of three clients, where each client corresponds with a set of endpoints.

The four clients are: ActiveMobility, Geospatial, PublicTransport and Traffic.

Each client contains several public functions, one function per endpoint. A function's name is the same as its corresponding endpoint's ending path.

Some functions accept named arguments, where an argument corresponds with a parameter that the endpoint accepts.

Why have separate clients instead of one single client?

Without knowing how LTA DataMall's API will evolve, and noticing that the endpoints were themselves already partitioned into sets, it seemed like a good idea to keep each set of endpoints in its own contextual client. This allows for each set of endpoints to be customised on their own, e.g. the PublicTransport passenger volume-related endpoints allow for a string to be returned, whereas the other endpoints return a list.

Reference

LTA DataMall's Developer Guide

landtransportsg's People

Contributors

yuhui avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.