General Transit Files Specification is a file format defining of transit timetables.
This project allows to validate the format and semantics of the timetable.
-
This project is written in Rust. Install it.
-
Clone the project:
git clone https://github.com/etalab/transport-validator/
cd transport-validator
- Run it as standalone
The release version (significantly faster) can be run as:
cargo run --release -- --input test_data/unused_stop
The development version can be run as:
cargo run -- --input test_data/unused_stop
The validator can also read a zip file, or an url:
cargo run --release -- -i some_gtfs.zip
cargo run --release -- -i https://example.com/network.gfts
- Lint it
To lint our code we use rustfmt
Install it running:
rustup component add rustfmt-preview
Lint your code running:
cargo fmt --all -- --write-mode=diff
- Run it as a dæmon
The validator can run as a HTTP dæmon to validate any file from a url.
For now the call is synchronous. Be aware that if the file is large, the time required to download the GTFS zip, the request might time out.
cargo run --release
You can then ask for a validation:
curl http://localhost:7878/validate?url=https://example.com/gtfs.zip