Skip to content

georust/transitfeed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

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),
    };
}

About

Public transit serializer/deserializer and manipulation library for Rust

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages