Coder Social home page Coder Social logo

juliuste / build-mav-gtfs Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 1.0 14 KB

UNMAINTAINED AND PROBABLY NOT WORKING ANYMORE. Build GTFS for the Hungarian State Railways (Magyar Államvasutak, MÁV).

License: ISC License

JavaScript 100.00%
library cli public-transport railway

build-mav-gtfs's Introduction

build-mav-gtfs

Build GTFS from the Magyar Államvasutak (MÁV, Hungarian State Railways) REST API using the mav JS module. Please ask MÁV for permission before using this module in production.

Please note that the data basis used by the MÁV API allows GTFS data to be generated only 25 days in advance.

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

Library

npm install --save build-mav-gtfs

CLI

npm install -g build-mav-gtfs

Usage

Library

The script takes a startDate and an endDate JS Date() object (the feed will include the endDate, days will be calculated in Europe/Lisbon timezone) and return a Promise that will resolve in an object containing GTFS object streams:

const generateGTFS = require('build-mav-gtfs')

generateGTFS(new Date("2017-12-01T00:00:00"), new Date("2018-05-31T00:00:00"))
.then((gtfs) => {
    gtfs.routes.pipe(someStream)
    gtfs.stops.pipe(anotherStream)
})

The GTFS object contains the following streams:

  • agency
  • stops
  • routes
  • trips
  • stop_times
  • calendar_dates
  • feed_info

CLI

build-mav-gtfs start-date end-date directory
build-mav-gtfs 01.12.2017 31.05.2018 ~/cp-gtfs

To do

  • minify/optimize gtfs calendar_dates to calendar

@juliuste will be working on this the next few days.

See also

  • mav - Magyar Államvasutak API client in JavaScript
  • build-cp-gtfs - Build GTFS from the Comboios de Portugal (CP, Portugese Railways) REST API
  • db-api-to-gtfs - Build GTFS from the Deutsche Bahn (DB, German Railways) REST API

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.

build-mav-gtfs's People

Contributors

juliuste avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

famil0

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.