GithubHelp home page GithubHelp logo

go_cli's Introduction

go_cli

A command line interface to lookup train information.

Disclaimers

  1. This is not ready to be used by anyone
  2. It does not (yet?) use the python Open API library
  3. This is a personal project, not affiliated with any organization, suggest you go and use the Open APIs

Some context

Uses Open Data - GO API and that page links to the API Specification.

Before you start

You'll need to request an Open API key from Metrolinx which only took a couple of days to receive via email.

Dependencies

This code imports from the following pacakges so make sure you install those first.

  • requests - to make REST calls
  • argparse - to parse command line arguments
  • json - to parsing response bodies

Options

Option Description
-k Your GO API key. See the "Before you start" section.
-s The Bus Stop or Train Station being queried e.g. "AP" for Appleby. See go_api.py for the list of station codes.

Mock diagram

Things to look at

  1. https://data.ontario.ca/dataset/ontario-railway-network-orwn
  2. https://data.ontario.ca/dataset/ontario-road-network-road-net-element
  3. https://data.ontario.ca/dataset/go-train-stations

go_cli's People

Contributors

thephm avatar

Watchers

 avatar

go_cli's Issues

Add command line option to dump the config

Add a -c or -config option to dump all of the config information. Useful for my debugging for now but could be useful to help me create future go_bus.json and go_train.json config files.

Dump config for a specific stop

If -s <stop> and -c are provided then just show the config for that specific stop.

If -c is provide without -s, dump the entire config

If -s <stop> is provided, for now dumps the NextService ie. calls GET api/V1/Stop/NextService/{stop}

Refactor to separate train and bus stops

Break the files up to have config for GO trains (lines and stations) and GO buses (routes and stops)

Eventually this will likely all be in a .json config file but for now it's embedded in python script

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.