GithubHelp home page GithubHelp logo

metro_service_extract's Introduction

Metro Data Extractor

This is a quick hack job to convert metro service reports into some form of structured data.

The entire output is in JSON, which I've dumped in the test_data/ directory.

Some issues:

  • Sometimes two messages get combined by accident.
  • Delays and Gaps are just whatever number happens to be in the message along with the word ('minute' and ('gap' or 'delay'))
  • I didn't check the timestamp too heavily either.
  • Python: My module/class/file/import structure is terrible. Can you help me fix it?

Future Stuff:

  • More accurate color/line reporting
  • What station did it happen at?
  • Depending on the station, which lines would it effect?
  • What direction was the train traveling?

Sample Data

[{
    "proc_text": "4:38 p.m. a shady grove-bound red line train at cleveland park was offloaded due to a door problem. passengers experienced a 10-minute delay.",
    "expressed": false,
    "id": "3292_16_38",
    "gap": null,
    "delay": {
      "minutes": 10
    },
    "colors": [
      "red"
    ],
    "event_dtg": "2015-08-06T16:38:00"
  },
{
    "proc_text": "3:37 p.m. a greenbelt-bound green line train at branch avenue did not operate, resulting in a 6-minute gap in service.",
    "expressed": false,
    "id": "3292_15_37",
    "gap": {
      "minutes": 6
    },
    "delay": null,
    "colors": [
      "green"
    ],
    "event_dtg": "2015-08-06T15:37:00"
  },
{
    "proc_text": "8:10 a.m. a branch avenue-bound green line train at suitland was expressed for schedule adherence/improved train spacing.",
    "expressed": true,
    "id": "3292_8_10",
    "gap": null,
    "delay": null,
    "colors": [
      "green"
    ],
    "event_dtg": "2015-08-06T08:10:00"
  }]

Contact me on twitter, @jimmysthoughts for questions. Feel free to submit a PR.

metro_service_extract's People

Contributors

jamesfe avatar

Stargazers

Hayley Brown avatar Just4jin avatar Al Johri avatar  avatar Ben Myers avatar Chris Combs avatar

Watchers

James Cloos avatar  avatar

metro_service_extract's Issues

Add a license

Hi,
I'm interested in contributing to this project, and would feel more comfortable doing so if there was a open source license on the code.

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.