Code Monkey home page Code Monkey logo

gtfsman's Introduction

gtfsman

Manage and keep up-to-date large numbers of huge GTFS feeds. Holds cache of feed information to avoid parsing large feeds every time a command is run.

Usage

$ ./gtfsman.py --help

Examples

Init

$ ./gtfsman.py init palermo http://www.comune.palermo.it/gtfs/amat_feed_gtfs.zip
Downloading http://www.comune.palermo.it/gtfs/amat_feed_gtfs.zip to /var/lib/gtfs/palermo/gtfs.zip (10518 kB)
Extracting zip file /var/lib/gtfs/palermo/gtfs.zip
Setting feed url for /var/lib/gtfs/palermo/gtfs.zip to http://www.comune.palermo.it/gtfs/amat_feed_gtfs.zip
Initialized new feed in /var/lib/gtfs/palermo/gtfs.zip

List

$ ./gtfsman.py list
mailand                         12/01/2015  09/02/2015      s   u
fortworth                       01/02/2015  06/06/2015      s   u
trentino_city                   12/06/2014  09/06/2015          u
fivecounties_suntran            01/09/2012  31/12/2015      s   u
bctransit                       27/01/2014  31/12/2015      s   u
hartford                        10/11/2014  18/04/2015      s   u
portugal                        14/12/2014  12/12/2015      s   u
matera                          01/09/2014  31/08/2015      s    
kolumbus                        20/12/2014  27/03/2015      s   u
susono                          02/02/2015  02/05/2015      s   u
sweden                          07/01/2015  14/06/2015      s   u
omaezaki                        02/02/2015  31/03/2015      s   u
paris                           15/01/2015  15/07/2015      s    
canberra                        01/01/2015  28/02/2015      s   u
newjersey_rail                  23/10/2014  20/04/2015      s    
milwaukee_county                04/01/2015  08/03/2015      s   u

Update

$ ./gtfsman.py update palermo
Trying to update "palermo"...
Downloading http://www.comune.palermo.it/gtfs/amat_feed_gtfs.zip to /var/lib/gtfs/palermo/gtfs.zip (10518 kB)
Extracting zip file /var/lib/gtfs/palermo/gtfs.zip
Updated palermo

or

$ ./gtfsman.py update-all

Feed postprocessing

$ ./gtfsman.py set-pp palermo 
Enter cmd: echo ***this would postprocess feed {feed_path}
Storing postprocessing cmd for palermo
$ ./gtfsman.py update palermo
Trying to update "palermo"...
Downloading http://www.comune.palermo.it/gtfs/amat_feed_gtfs.zip to /var/lib/gtfs/palermo/gtfs.zip (10518 kB)
Extracting zip file /var/lib/gtfs/palermo/gtfs.zip
===========================
Running postprocess command
===========================
***this would postprocess feed /var/lib/gtfs/palermo
Updated palermo

Show

$ ./gtfsman.py show palermo
palermo
data from:       16/09/2014
data until:      31/12/2014
url:             http://www.comune.palermo.it/gtfs/amat_feed_gtfs.zip
has shapes:      Yes
Postprocess cmd: echo ***this would postprocess feed {feed_path}

gtfsman's People

Contributors

nlehuby avatar patrickbr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

nlehuby

gtfsman's Issues

Add ability to download stand-alone feed_info.txt

trafiklab.se provides the feed_info.txt as a separate download (it also included in their .zips) which you can download without it counting as a download of the limited monthly usage for an API key.
It would be nice with a feature to pre-fetch this and compare against the one of the last download (would probably work by checking a file content hash).
Also, their servers don't seem to support HEAD requests, so the data is always downloaded every time update is run.

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.