0.1.1 • Published 6 years ago
gtfs-to-fptf v0.1.1
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.
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
requiredstops.txt
requiredroutes.txt
requiredtrips.txt
requiredstop_times.txt
requiredcalendar.txt
optional, required ifcalendar_dates.txt
is not providedcalendar_dates.txt
optional, required ifcalendar.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.