Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Analysis tool for London Oyster Card statements
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
.jshintrc
.npmignore
.travis.yml
CHANGELOG.md
LICENCE
README.md
index.js
package.json

README.md

oy

oy is a library for analysis of London Oyster card history statements. It performs basic statistical analysis of journeys providing average and median journey times, journey time variation etc.

It accepts Oyster history files in CSV format. They can be downloaded from TfL website: https://oyster.tfl.gov.uk/oyster/

Build Status Coverage Status Dependency Status Code Climate

Installation

npm install oy --save

Usage

oy exposes a single function, which accepts CSV string as input and returns summarised journey data:

var oy = require('oy');

oy(csvData, function(err, data) {
  if(err) { /* handle error */ }
  console.log(data);
});

Journey object

Data variable in the example above is an array consisting of multiple journey objects. Here is a sample journey object:

 {
  "from": {
    "text": "Dalston Junction [London Overground]",
    "type": "overground"
  },
  "to": {
    "text": "Shoreditch High Street [London Overground]",
    "type": "overground"
  },
  "durations": {
    "data": [19, 20, 21, 18],
    "stats": {
      "size": 4,
      "min": 18,
      "max": 21,
      "mean": 19.5,
      "median": 19.5,
      "stdev": 1.29
    }
  },
  "times": {
    "data": [
      "2013-11-14T14:24:00.000Z",
      "2013-11-15T14:24:00.000Z",
      "2013-11-16T14:24:00.000Z",
      "2013-11-14T14:24:00.000Z"
     ],
    "stats": {}
  }

Release history

Changelog

Tests

npm test

License

MIT

Something went wrong with that request. Please try again.