Skip to content

ivorysoap/OCTranspo-API-Wrapper2

 
 

Repository files navigation

OC Transpo API Wrapper 🚏 🚍

Build Status

Instead of messing around with oddly-formed GET requests, why not just call the API from your terminal and get real-time transit data at your fingertips - for any bus stop in Ottawa?

⚠️ Under construction — Around the time the Confederation Line was opened, OC Transpo updated their API and I'm still working to adapt to the changes.

Overview

This is a wrapper for the OC Transpo API that provides the user more readability and ease of use than interfacing with the API directly.

The oc.py script can be used to interface with the OC Transpo API. You give it a stop number, and it will give you either a summary of the upcoming trips for that stop, or just the formatted JSON that the API spits out when you give it a stop number (useful for debugging purposes).

The goal of this project was originally to make the API's output more readable, since at the time of creation, the API output was a complicated mess of XML that a non-technical person might not easily understand. Currently, I'm working on creating a bash command to interface with the API.

Usage

$ python3 oc.py (app_id) (api_key) [-json]

where:

  • (app_id) is your Application ID
  • (api_key) is your API key
  • -json is an optional parameter - if you include it, you'll just get the API's JSON output. Otherwise, you get the regular bus stop summary.

Dependencies

  • Python 3.7
  • OC Transpo API credentials (you'll need to get these yourself)

About

Transit data — at your fingertips.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%