lta-datamall-crawler
LTA is responsible for planning, operating, and maintaining Singapore's land transport and systems.
This repository contains a python module to get data from LTA's datamall (free). Maybe I should not name this repository as LTA-datamall-crawler but you can always create a simple cronjob for crawling purposes.
Installation
pip install ltadatamallcrawler
Or, you can always clone this project and run the script directly.
Requirements
You will need LTA datamall API key and GUUID. To get the API key, click "Request for API Access" on the LTA datamall page. API key will be granted immediately. Using the API key, you can generate a GUUID on this page.
Usage
# to view the available APIs:
lta-datamall-crawler -h
# Expected output:
Usage: lta-datamall-crawler [options]
#Options:
# -h, --help show this help message and exit
#
# Available APIs:
# Please select one!
#
# --traffic-incidents
# --bus-arrival
# --bus-routes
# --estimated-travel-times
# --road-openings
# --erp-rates
# --vms-emas
# --taxi-availability
# --faulty-traffic-lights
# --carpark-availability
# --bus-stops
# --traffic-images
# --traffic-speed-bands
# --bus-services
# --road-works
# to get 'real-time' traffic incidents data
lta-datamall-crawler --traffic-incidents
Motivation
Sometimes it can be quite labourous to create boilerplate codes for doing HTTP get requests to different APIs even though the requests package can make life slightly easier. I've created this project to make life easier for people who are interested in getting traffic data from Singapore LTA datamall.
Available API
Project Roadmap
- use as a library in python script
- allow HTTP requests with parameters for filtering results
- create appropriate unittests