Skip to content

TransitApp/GTFS-flex-to-GOFS

Repository files navigation

GTFS-flex-to-GOFS

Build Status License: MIT Python 3.8+

A Python tool to convert GTFS-Flex (General Transit Feed Specification - Flexible services) data to the GOFS (General On-demand Feed Specification) format.

This tool processes on-demand and flexible transit services data from GTFS-Flex feeds and outputs standardized GOFS files for consumption by trip planning applications and mobility platforms.

Installation

Install from PyPI:

pip install GTFS-flex-to-GOFS

Or install from source:

git clone https://github.com/TransitApp/GTFS-flex-to-GOFS.git
cd GTFS-flex-to-GOFS
uv sync --extra dev

Usage

gtfs-flex-to-gofs --gtfs-dir <input_dir> --gofs-dir <output_dir> --url <base_url>

Command Line Options

optional arguments:
  -h, --help           show this help message and exit
  --gtfs-dir Dir       input gtfs directory
  --gofs-dir Dir       output gofs directory
  --url URL            auto-discovery url. Base URL indicate for where each files will be uploaded (and downloadable)
  --ttl TTL            time to live of the generated gofs files in seconds (default: 86400)
  --no-warning         Silence warnings

Development

Running Tests

uv run python -m pytest .
# or for verbose output:
uv run python -m pytest tests/ -v

Regenerating Test Fixtures

./createTests.sh

Features

  • Converts GTFS-Flex pure microtransit services to GOFS format
  • Supports zone-based on-demand transit operations
  • Generates all required GOFS files (zones, calendars, fares, booking rules, etc.)
  • Optional split-by-route output for multi-service feeds
  • Automated CI/CD with GitHub Actions

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Related Projects

About

Converts GTFS-Flex data to the GOFS-lite format

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 7