Skip to content

Commit

Permalink
Update README with the CLI approach
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnau Siches committed Apr 9, 2016
1 parent 71d07d2 commit fc01e1e
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 6 deletions.
51 changes: 46 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,48 @@
# Transit For London GTFS Exporter
# Transport For London GTFS Exporter

This simple rust program pulls data from the TFL Unified API
and converts it to a directory with GTFS files in it.
This simple Rust CLI allows you to fetch data from the
[Tfl Unified API][tfl-api] and transform it to [GTFS][gtfs].

Clone and "cargo run --release" to generate a gtfs directory with all the
required .txt csv files.

## Install

Clone [the repository][tfl-cli] and compile:

```sh
cargo build --release
```

*WARNING*: If you compile under OSX 10.11 you might need to specify the
OpenSSL include path. For example, having OpenSSL installed via Homebrew,
the command is:

```sh
OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include cargo build --release
```

You will find the binary in `./target/release/`.

## Usage

Check the help `./target/release/tflgtfs help` for details.

In short, you can fetch Tfl lines with the `fetch-lines` command and transform
the cached values with the `transform gtfs` command.

You can do it in one shot via:

```sh
./target/release/tflgtfs fetch-lines --format gtfs
```

You will find the resulting GTFS files inside `./gtfs`.


## License

See [License](./LICENSE).


[tfl-cli]: https://github.com/CommuteStream/tflgtfs/
[tfl-api]: https://api.tfl.gov.uk/
[gtfs]: https://developers.google.com/transit/gtfs/
2 changes: 1 addition & 1 deletion src/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn transform_gtfs(lines: Vec<Line>) {
line_count += 1;
line_ids.insert(line.id.clone());
}
println!("Duplicate Lines: {}, Duplicate Route Sections: {}", line_count-line_ids.len(), route_section_count-route_section_ids.len());
println!("Duplicate Lines: {}, Duplicate Route Sections: {}", line_count - line_ids.len(), route_section_count-route_section_ids.len());

println!("Schedule Names:");
for schedule_name in &schedule_names {
Expand Down

0 comments on commit fc01e1e

Please sign in to comment.