Giter Club home page Giter Club logo

python-last-tube's Introduction

This quickly hacked together python takes the TXC xml from TFL's time table feed. It then attemtps to build a timetable for every tube journey in London (be patient there are a lot and this wasn't designed to be efficient).

The API then provides the 3 nearest tube stations and the last tubes for each line at that station. Don't trust this data! There are some assumptions, see the code!

When installed try:

http://localhost:5000/get/\<latitude>/<longitude>

or http://localhost:5000/test.html

You should get some JSON like...

[{'direction': 'N',
  'last': ['00:23:00', "Queen's Park"],
  'line': 'Bakerloo',
  'station': 'Elephant & Castle'},
 {'direction': 'N',
  'last': ['00:26:00', 'High Barnet'],
  'line': 'Northern',
  'station': 'Elephant & Castle'},
 {'direction': 'S',
  'last': ['00:44:00', 'Morden'],
  'line': 'Northern',
  'station': 'Elephant & Castle'},
 {'direction': 'S',
  'last': ['00:40:00', 'Elephant & Castle'],
  'line': 'Bakerloo',
  'station': 'Lambeth North'},
 {'direction': 'N',
  'last': ['00:25:00', "Queen's Park"],
  'line': 'Bakerloo',
  'station': 'Lambeth North'},
 {'direction': 'N',
  'last': ['00:32:00', 'Edgware'],
  'line': 'Northern',
  'station': 'Kennington Station'},
 {'direction': 'S',
  'last': ['00:46:30', 'Morden'],
  'line': 'Northern',
  'station': 'Kennington Station'}]

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.