#transit #gtfs #transitfeed

transitfeed

GTFS public transit decoder/encoder and utilities

7 releases

Uses old Rust 2015

0.3.0 Jul 8, 2019
0.2.0 Sep 5, 2017
0.1.4 Aug 15, 2016
0.1.3 Jun 30, 2016

#2 in #gtfs

Download history 11/week @ 2022-03-09 25/week @ 2022-03-16 24/week @ 2022-03-23 5/week @ 2022-03-30 7/week @ 2022-04-06 7/week @ 2022-04-13 4/week @ 2022-04-20 67/week @ 2022-04-27 46/week @ 2022-05-04 110/week @ 2022-05-11 35/week @ 2022-05-18 32/week @ 2022-05-25 54/week @ 2022-06-01 17/week @ 2022-06-08 7/week @ 2022-06-15 15/week @ 2022-06-22

94 downloads per month
Used in timetable

MIT license

30KB
741 lines

Transit

Fast transit library for Rust that provides GTFS serialization/deserialization, validation, and manipulation.

Usage

For files on your file system just us GTFSIterator::from_path

extern crate transitfeed;
use transitfeed::{GTFSIterator, Agency};

fn read_agencies() {
    let iterator : GTFSIterator<_, Agency> = GTFSIterator::from_path("~/Downloads/gtfs/agency.txt").unwrap();
    for result in iterator {
        match result {
            Ok(entry) => println!("{:?}", entry),
            Err(err) => println!("{}", err),
        };
    }
}

If you have your own csv::Reader then just give GTFSIterator::new a meaningful name

let iterator : GTFSIterator<_, Agency> = GTFSIterator::new(reader, "example_data").unwrap();
for result in iterator {
    match result {
        Ok(entry) => println!("{:?}", entry),
        Err(err) => println!("{}", err),
    };
}

lib.rs:

Transit Feed provides a consistent set of data structures, parsers, and API clients for obtaining usable transit related information such as routes, stop, trips, stop times, and more.

Dependencies

~5MB
~76K SLoC