pytrafik

PyTrafik


Keywords
vasttrafik, västtrafik
License
MIT
Install
pip install pytrafik==0.2

Documentation

PyTrafik

PyPI versionGitHub issues MIT license

I recently had some spare time, so I decided to implement a Python wrapper to match the new release of Västtrafik's API. The goal is to provide wrappers for all endpoints in the journey planner API to make it easier to work with it.

Getting started

Libraries

The wrapper uses the following libraries:

  • Requests to send all the API requests.
  • Tabulate to format shell output in a sweet way.

Usage

This package is published to PyPi and can be installed using

pip install pytrafik

Documentation for this package will be added to the wiki.

Hack on this

First make sure you have virtualenv installed.

Clone the repo

git clone https://github.com/axelniklasson/PyTrafik.git

Create virtualenv and activate it

cd PyTrafik
virtualenv env
source env/bin/activate

Install the required libraries

pip install -r etc/reqs.txt

Done!

API credentials

The new API uses OAuth2 as authorization and in order to acquire CONSUMER_KEY and CONSUMER_SECRET from the API, one needs to subscribe to it. Please refer to Västtrafik in to get your API credentials.

Version history

  • 24/11 - Version 0.2 is released. Some more endpoints covered and renaming to PyTrafik.
  • 22/11 - Version 0.1 is released!

Contributing

Pull Requests are always welcome and should be submitted to the development branch.

Contributors

  • persandstrom - Support for Python 3, pip install and improved Client constructor.
  • erikkinding - Code for livemap endpoint and all stops.