https://github.com/buckley-w-david/python-ottawa-transit
Python interface for the OCTranspo API
https://github.com/buckley-w-david/python-ottawa-transit
Last synced: 7 months ago
JSON representation
Python interface for the OCTranspo API
- Host: GitHub
- URL: https://github.com/buckley-w-david/python-ottawa-transit
- Owner: buckley-w-david
- Created: 2018-07-08T21:21:53.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-08T22:34:36.000Z (over 7 years ago)
- Last Synced: 2025-02-28T23:22:44.585Z (7 months ago)
- Language: Python
- Homepage: https://pypi.org/project/python-ottawa-transit/
- Size: 17.6 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://circleci.com/gh/buckley-w-david/python-ottawa-transit)
# python-ottawa-transitPython interface to the [OC Transpo](http://www.octranspo.com/developers/documentation) API and utilities for working with the returned data.
## Installation
The package is available on [PyPi](https://pypi.org/project/python-ottawa-transit)
```bash
pip install python-ottawa-transit
```Alternativly it can be installed from source using [Poetry](https://github.com/sdispater/poetry)
```bash
git clone https://github.com/buckley-w-david/python-ottawa-transit.git
cd python-ottawa-transit
poetry install
```## Usage
```python3
>>> from python_ottawa_transit import OCTransportApi
>>> api = OCTransportApi(app_id = 'APPLICATION_ID', app_key = 'APPLICATION_KEY')
>>> api.get_route_summary_for_stop(stop_no=8435)
{"GetRouteSummaryForStopResult":{"StopNo":"8435","StopDescription":"BANK \\/ COLLINS","Error":"","Routes":{"Route":{"RouteNo":6,"DirectionID":1,"Direction":"Northbound","RouteHeading":"Rockcliffe"}}}}
```