gtfs-to-fptf

0.1.1 • Public • Published

gtfs-to-fptf

Convert GTFS data to FPTF: library and CLI.

Work in progress. This software is not stable yet. See the to-do section.

npm version dependency status dev dependency status license chat on gitter

Installation

CLI

npm install -g gtfs-to-fptf

Library

npm install --save gtfs-to-fptf

Usage

CLI

gtfs-to-fptf gtfs-directory fptf-directory

Library

toFPTF(gtfsDirectory, workingDirectory = null)

gtfsDirectory is the path to a directory containing .txt files, via the optional workingDirectory you can change where the scripts creates a temporary level db. Returns a Promise that will resolve in an object containing FPTF object streams.

Currently, the following GTFS files are supported:

  • agency.txt required
  • stops.txt required
  • routes.txt required
  • trips.txt required
  • stop_times.txt required
  • calendar.txt optional, required if calendar_dates.txt is not provided
  • calendar_dates.txt optional, required if calendar.txt is not provided
const toFPTF = require('gtfs-to-fptf')
 
toFPTF('./bus-gtfs/')
.then((fptf) => {
    fptf.stations.pipe(someStream)
    fptf.schedules.pipe(someOtherStream)
})

The FPTF object contains the following streams:

  • operators
  • stops
  • stations
  • lines
  • routes
  • schedules

To do

  • extended testing (there's probably still a lot of bugs)
  • improve error handling
  • dependency cleanup
  • tests

Contributing

If you found a bug, want to propose a feature or feel the urge to complain about your life, feel free to visit the issues page.

Package Sidebar

Install

npm i gtfs-to-fptf

Weekly Downloads

1

Version

0.1.1

License

ISC

Unpacked Size

18.5 kB

Total Files

12

Last publish

Collaborators

  • juliuste