GithubHelp home page GithubHelp logo

ronanmu / luas.py Goto Github PK

View Code? Open in Web Editor NEW
3.0 0.0 1.0 23 KB

Python module for Luas :tram: travel updates API

License: MIT License

Python 100.00%
python travel luas dublin-ireland dublin commute

luas.py's Introduction

Introduction

Build Status Coverage Status PyPI version

luas.py is a python module providing an interface to the the Luas Forecasting API from data.gov.ie.

luas.py is licensed under the MIT license.

Getting started

This module permits you to request:

  • details for all trams at a stop
  • trams in a particular direction at a stop

It validates that the stop names exist in data set available at data.gov.ie. Note that the stop abbreviation or name can used when querying the Luas API, e.g.:

'BAL' or 'Balally'
'RAN' or 'Ranelagh'
'MYS' or 'Mayor Square - NCI'

Requirements

luas.py requires:

  • requests>=2.0

Install

pip install luas.py

Usage

import luas.api
from luas.api import LuasLine, LuasDirection

luas_client = luas.api.LuasClient()

# This will return the status text for the Green Line
green_line_status = luas_client.line_status(LuasLine.Green)

# This will return the next tram from Balally, in the default direction (inbound)
next_bal = luas_client.next_tram('BAL')

# This will return the next outbound tram from Ranelagh
next_ran = luas_client.next_tram('RAN', LuasDirection.Outbound)

# Return raw JSON for a stop
stop_details = luas_client.stop_details('Balally')

Developer

luas.py is hosted by Github at https://github.com/ronanmu/luas.py.

Code has been tested with the following before commit:

flake8 luas
pylint luas
coverage run --source luas -m unittest discover tests

Copyright (c) 2018 Ronan Murray.

luas.py's People

Contributors

dependabot-preview[bot] avatar ronanmu avatar

Stargazers

 avatar  avatar

Forkers

r21gh

luas.py's Issues

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.