@ltbuses/gtfs-parser

Parses GTFS data into usable structures using streams

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
Minified + gzip package size for @ltbuses/gtfs-parser in KB

Readme

LTBuses GTFS Parse

This is a simple parser the takes a stream containing a GTFS-formatted zip file, and extracts the data relevant to the LTBuses applications.

It uses unzip-stream to extract the data on the fly, without having to completely unpack the entire zip file.

The current result format is very specific to what is needed for the LTBuses apps, which currently only supports the LTC buses in London, Ontario.

Installation

npm install @ltbuses/gtfs-parser

Usage

const fs = require('fs');
const GtfsParser = require('@ltbuses/gtfs-parser');

const transitZip = fs.createReadStream('google_transit.zip');
const gtfsParser = new GtfsParser(transitZip);

gtfsParser.getData().then((gtfs) => {
  console.log(gtfs.getStops());
});

See the developer documentation for full details.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.