Git Product home page Git Product logo

gtfs-fares-v2-validator's Introduction

gtfs-fares-v2-validator

This is a tool to validate fares-v2 GTFS datasets.

Validates ONLY fares-v2 specific files and dependent files, and does NOT validate GTFS schedule data.

Provides validation towards two versions of the fares-v2 specifications:

  1. [Default] fares-v2 files in the official GTFS specification
  2. [Through -e flag] the official specification above, as well as additional fields ("experimental" fields) defined in the GTFS fares-v2 draft document, with some exceptions. Also includes some fields used internally at Transit, and which are either current or upcoming proposals to the official specification.

Running the tool with the -e flag provides validation for experimental features, and notices pertaining to experimental features are clearly marked as such.

Requirements

python 3

Validate a fares dataset

python3 validate.py PATH-TO-FOLDER-CONTAINING-FARES-V2-DATASET [-o, --output-file FILE-TO-EXPORT-VALIDATION-REPORT-TO] [-e, --experimental]

For example:

python3 validate.py ~/data/my-fares-v2-dataset -o report.txt

Run tests

python3 -m pip install pytest
pytest

Unsupported experimental fields and files (subject to change)

  • fare_capping.txt: unsupported file. All fare_capping references in other files are also unsupported.
  • fare_products.txt: service_id, all timeframe fields
  • fare_transfer_rules.txt: transfer_id, transfer_sequence

Discontinued experimental fields

  • fare_leg_rules.txt: contains_area_id, all amount fields, currency
  • fare_transfer_rules.txt: all amount fields, currency,

Amount and currency on these two files have been replaced by the usage of fare products to specify cost.

Additional experimental fields

  • fare_leg_rules.txt
    • transfer_only: specifies that a fare leg rule may only be used at the back-end of a transfer
  • fare_transfer_rules.txt
    • filter_fare_product_id: a fare product necessary to have in order for a transfer to be valid. Does not encode the cost of a transfer, as fare_product_id does.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.