Skip to content

Latest commit

 

History

History
82 lines (55 loc) · 5.29 KB

README.md

File metadata and controls

82 lines (55 loc) · 5.29 KB

gtfs-validator Test Package Document End to end End to end big End to end 100 Docker image Join the gtfs-validator chat

A General Transit Feed Specification (GTFS) Schedule feed validator

This README contains information for v3.0.0 release of this project. If you'd like to view documentation for past releases of the project, see:

Introduction

This is a command-line tool written in Java that performs the following steps:

  1. Loads input GTFS zip file from a URL or disk
  2. Checks file integrity, numeric type parsing and ranges as well as string format according to the GTFS Schedule specification
  3. Performs GTFS business rule validation

Run the app via command line

Setup

  1. Install Java 11 or higher
  2. Download the v3.0.0 release jar of the validator.

Run it

To validate a GTFS dataset on your computer:

java -jar gtfs-validator-v3.0.0_cli.jar -i /myDirectory/gtfs.zip -o output -c ca

To download and validate a GTFS dataset from a URL:

java -jar gtfs-validator-v3.0.0_cli.jar -u https://www.abc.com/gtfs.zip -o output -c ca

where:

  • --input or -i: the path to the GTFS file (e.g., /myDirectory/gtfs.zip)
  • --url or -u: the fully qualified URL to the GTFS file (e.g., https://www.abc.com/gtfs.zip)
  • --output or -o: the path where the validation report will be stored (e.g., output)
  • (Optional) --country_code or -c: the country code of the feed as a valid ISO two letter country code (e.g., ca, us). It can be either lower or upper case (e.g. FR or GP). If -c is not provided or country code is unknown, phone numbers will be validated if they start by +.
  • (Optional) --thread or -t: the number of Java threads to use

More detailed instructions are on our "Usage" page.

Run the app using Docker

Setup

  1. Download and install Docker
  2. Pull the latest Docker image for this project. For example, docker pull ghcr.io/mobilitydata/gtfs-validator for the latest snapshot version of the validator.

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:latest

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 /myDirectory on the host will show up in /theContainerDirectory inside 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.

Validation rules

Possible future rules for:

Have a suggestion for a new rule? Open an issue. You can see the complete process for adding new rules on the "Adding new rules" page.

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.