Instructions to run the application locally

August 25, 2021 · View on GitHub

If you're running a v1.x release JAR file you'll need Java 11, and can follow these instructions. The below instructions are for the master branch, which will be v2.0.

  1. Install Java 8 or higher.
  2. Download the latest gtfs-validator JAR file from our Releases page or snapshot artifact from GitHub Actions.

via cli-app

Full list of command line parameters available

Short nameLong namerequired?Description
-i--inputOptionalLocation of the input GTFS ZIP or unarchived directory.
-f--feed_nameRequiredName of the feed, e.g., nl-openov. It must start from two-letter country code (ISO 3166-1 alpha-2).
-o--output_baseOptionalBase directory to store the outputs.
-s--storage_directoryOptionalTarget path where to store the GTFS archive. Downloaded from network (if not provided, the ZIP will be stored in memory).
-t--threadsOptionalNumber of threads to use.
-u--urlOptionalFully qualified URL to download GTFS archive.

⚠️ Note that exactly one of the following options must be provided: --url or --input.

⚠️ Note that --storage_directory must not be provided if --url is not provided.

on a local GTFS zip file

Sample usage:

java -jar gtfs-validator-v2.0.0.jar --input relative/path/to/dataset.zip --output_base relative/output/path --feed_name <name_of_the_feed> --threads <number_of_threads_to_use> 

...which will:

  1. Search for a GTFS dataset located at relative/path/to/dataset.zip
  2. Validate the GTFS data and output the results to the directory located at relative/output/path.
  3. Export both validation and system errors reports to JSON by default. This folder will contain the .json file with information related to the validation process. The validation report will be named as report.json and the system errors report can be found under the name of system_errors.json.

on a hosted GTFS zip file at a URL

Sample usage:

java -jar gtfs-validator-v2.0.jar --url https://url/to/dataset.zip --output_base relative/output/path --feed_name <name_of_the_feed> --threads <number_of_threads_to_use> --storage_directory input.zip

...which will:

  1. Download the GTFS feed at the URL https://url/to/dataset.zip and name it input.zip
  2. Validate the GTFS data and output the results to the directory located at relative/output/path. Validation results are exported to JSON by default. Please note that since downloading will take time, we recommend validating repeatedly on a local file.

via GitHub Actions - Run the validator on any gtfs archive available on a public url

  1. Fork this repository
  2. Open a PR on master within it
  3. Edit the file .github/workflows/end_to_end.yml following instructions on lines 5, 43-45 and push on your PR branch (see detailed instructions here)
  4. Name your branch from the agency/authority/publisher of the feed you are testing

You should now see the workflow End to end / run-on-data start automatically in your PR checks, running the validator on the dataset you just added. The validation report is collected as a run artifact in the Actions tab of your fork repository on GitHub.

If the workflow run crashes or something doesn't look right in the validation report json file, please see the guide to reproduce section.