#cli #gtfs #sqlite #db #point #data #queries

app townhopper_cli

CLI for queries on GTFS data (backed by SQLite DB)

2 releases

✓ Uses Rust 2018 edition

new 0.1.1 Jul 14, 2019
0.1.0 Mar 2, 2019

11 downloads per month




CLI program for simple queries on GTFS public transport timetables.




Create a config file at ~/.config/townhopper/config.toml and point to a directory with your GTFS data files, somewhat like:

kind = "dir_of_dirs"
path = "../../.local/share/townhopper/gtfs"

The above config assumes that under ~/.local/share/townhopper/gtfs there is at least one subdirectory containing GTFS txt files.

Run a refresh command which will read the GTFS data and populate townhopper's internal SQLite database:

$ townhopper refresh


More comprehensive guide or a proper manual page should be added once the program becomes more usable, but here's an example how to query the nearest connection in Brno from Hlavní nádraží to Česká with a transfer at Mendlovo náměstí:

$ townhopper trip -s brno-hlavni-nadrazi -s brno-mendlovo-namesti -s brno-ceska
Departure: 2019-03-02 19:04

              1 >> 19:12 Brno, Hlavní nádraží
                << 19:18 Brno, Mendlovo náměstí
              6 >> 19:18 Brno, Mendlovo náměstí
                << 19:25 Brno, Česká

              1 >> 19:22 Brno, Hlavní nádraží
                << 19:28 Brno, Mendlovo náměstí
              6 >> 19:28 Brno, Mendlovo náměstí
                << 19:35 Brno, Česká

              1 >> 19:32 Brno, Hlavní nádraží
                << 19:38 Brno, Mendlovo náměstí
              6 >> 19:38 Brno, Mendlovo náměstí
                << 19:45 Brno, Česká

For a description of current subcommands and features, use help:

$ townhopper -h
$ townhopper trip -h


~366K SLoC