Tuesday, July 31, 2018

Text mode tools for Turku region public transport

Quite often when there is some nice API for something, the obvious application type seem to be a mobile application or somekind of web site/app. That is all quite nice and all but sometimes you just need a simple tool. Probably most Linux (or unix) user spend most of their time in a terminal so why not make some tiny command line utilities instead ? My latest little project is all about the command line.

Tools to query Turku Region public transport data from the command line, fast and much more efficient than opening a browser, finding the site and all that. For now there are two tools:
  • tkuftop: for the bike rental system showing real-time statistics about bike availability at the stations.
    It can also dump rack location the information as CSV and PostGIS SQL statements for easy import into any system. There is also support for relaying the information to an MQTT broker.
  • tkufstop: and one for real-time bus stop departure information.
These tools are simple and compact, written in C with a little help from curl and json-c.

tkufstop showing departues from stop T9

tkuftop showing bike rack availability information

 And of course everything is open source and available on github.