gtfs-validator [](https://github.com/MobilityData/gtfs-validator/actions?query=workflow%3A%22Test+Package+Document%22) [](https://mobilitydata-io.herokuapp.com/)
August 25, 2021 ยท View on GitHub
A GTFS Schedule (static) General Transit Feed Specification (GTFS) feed validator
Introduction
This command-line tool written in Java that performs the following steps:
- Loads input GTFS zip file from a URL or disk
- Checks file integrity, numeric type parsing and ranges as well as string format according to the GTFS Schedule specification
- Performs GTFS business rule validation (work-in-progress)
Run the app via command line
Setup
- Install Java 8 or higher
- Download gtfs-validator-v2.0.0_cli.jar
Run it
To validate a GTFS dataset on your computer:
java -jar gtfs-validator-v2.0.0_cli.jar --input /myDirectory/gtfs.zip --output_base output --feed_name ca-myfeedname
To download and validate a GTFS dataset from a URL:
java -jar gtfs-validator-v2.0.0_cli.jar --url https://www.abc.com/gtfs.zip --output_base output --feed_name ca
where:
--inputor-i: the path to the GTFS file (e.g.,/myDirectory/gtfs.zip). Please note that if the input is a.zipfile, it must be the result of the compression of the set of GTFS files. If you compressed the folder that contains the GTFS files no validation will be processed.--urlor-u: the fully qualified URL to the GTFS file (e.g.,https://www.abc.com/gtfs.zip)--output_baseor-o: the path where the validation report will be stored (e.g.,output)--feed_nameor-f: the name of the feed as a valid ISO two letter country code, followed by-, followed by a user-defined name for the feed that cannot contain capital letters. (e.g.,ca-myfeedname,us-myfeedname)- (Optional)
--threador-t: the number of Java threads to use
More detailed instructions are on our "Usage" page.
Run the app using Docker
Setup
- Download and install Docker
- Pull the v2.0.0 Docker image of this project. For example,
docker pull ghcr.io/mobilitydata/gtfs-validator:v2.0.0.
Run it
For Mac and Linux
To run the Docker image in a new container:
docker run -v /myDirectory:/theContainerDirectory -it ghcr.io/mobilitydata/gtfs-validator:v2.0.0
where:
-v /myDirectory:/theContainerDirectory: syntax to share directories and data between the container and the host (your computer). With the above command, any files that you place in/myDirectoryon the host will show up in/theContainerDirectoryinside the container and vice versa.
NOTE: On Windows, you must provide the local volume (e.g., c:) as well:
... c:/myDirectory:/theContainerDirectory ...
The validator can then be executed via bash commands. See the preceeding instructions for command line usage.
Build the code
We suggest using IntelliJ to import, build, and run this project.
Instructions to build the project from the command-line using Gradle are available in our Build documentation.
Architecture
The architecture of the gtfs-validator is described on our Architecture page.
License
Code licensed under the Apache 2.0 License.
Contributing
We welcome contributions to the project! Please check out our Contribution guidelines for details.