Chwiggy / gtfs-general

fixing install issues

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GTFS General

A general to command your GTFS data.

Requirements

  • Python >= 3.8
  • Poetry

Install

# Create a virtual environment
poetry install
python -m gtfs-general --help

CLI

Main

Usage:

$ gtfs-general [OPTIONS] COMMAND [ARGS]...

Options:

  • --logging TEXT: [default: INFO]
  • --cores INTEGER: Set the number of cores to use for processing. [default: 14]
  • --progress / --no-progress: Deactivate the progress bars. [default: progress]
  • -v, --version: Show the application's version and exit.
  • --install-completion: Install completion for the current shell.
  • --show-completion: Show completion for the current shell, to copy it or customize the installation.
  • --help: Show this message and exit.

Commands:

  • docs: Generate documentation
  • extract-bbox
  • extract-date
  • metadata
gtfs-general docs

Generate documentation

Usage:

$ gtfs-general docs [OPTIONS] COMMAND [ARGS]...

Options:

  • --help: Show this message and exit.

Commands:

  • generate: Generate markdown version of usage...
gtfs-general docs generate

Generate markdown version of usage documentation

Usage:

$ gtfs-general docs generate [OPTIONS]

Options:

  • --name TEXT: The name of the CLI program to use in docs.
  • --output FILE: An output file to write docs to, like README.md.
  • --help: Show this message and exit.
gtfs-general extract-bbox

Usage:

$ gtfs-general extract-bbox [OPTIONS]

Options:

  • --input-object TEXT: Directory or zip File from which the GFTS files are read [required]
  • --output-folder TEXT: Directory to which the GFTS files are written [required]
  • --bbox TEXT: The bbox for selecting the GTFS data to keep. Format is WGS84 Coordinates lon/lat (lon min, lat min, lon max, lat max) Example: "8.573179,49.352003,8.79405,49.459693" [required]
  • --help: Show this message and exit.
gtfs-general extract-date

Usage:

$ gtfs-general extract-date [OPTIONS]

Options:

  • --input-object TEXT: Directory or zip File from which the GFTS files are read [required]
  • --output-folder TEXT: Directory to which the GFTS files are written [required]
  • --start-date TEXT: Lower date boundary. Format: YYYYMMDD. e.g. 20221002 for 2nd October 2022 [required]
  • --end-date TEXT: Lower date boundary. Format: YYYYMMDD. e.g. 20221002 for 2nd October 2022 [required]
  • --help: Show this message and exit.
gtfs-general metadata

Usage:

$ gtfs-general metadata [OPTIONS]

Options:

  • --input-object TEXT: Directory or zip File from which the GFTS files are read [required]
  • --help: Show this message and exit.

Examples

Ask for help

python -m gtfs-general --help

Show metadata (for now just service days)

python -m gtfs_general metadata --input-object [zip/folder]

Cut by bounding box

# Bounding box with WGS84 4326 Coordinates lon/lat (lon min, lat min, lon max, lat max):
python -m gtfs-general extract-bbox --input-object [zip/folder] --output-folder output --bbox "8.573179,49.352031,8.794049,49.459693"

Cut by date

# Dates in format "YYYYMMDD"
python -m gtfs_general extract-date --input-object [zip/folder] --output-folder  --start-date "20220601" --end-date "20220701"

Credit

This tool was inspired by https://github.com/gberaudo/gtfs_extractor

About

fixing install issues


Languages

Language:Python 100.0%