Skip to main content

gtfs_parser

LICENSE

MIT License

Installation

pip install gtfs-parser

API

import gtfs_parser

# construct GTFS object
gtfs = gtfs_parser.GTFSFactory(zip_path)

# parse as GeoJSON
stops = gtfs_parser.parse.read_stops(gtfs)
routes = gtfs_parser.parse.read_routes(gtfs)

# aggregate frequency
aggregator = gtfs_parser.aggregate.Aggregator(gtfs, yyyymmdd=yyyymmdd)
interpolated_stops = aggregator.read_interpolated_stops()
route_freq = aggregator.read_route_frequency()

CLI

usage: gtfs-parser [-h] [--parse_ignoreshapes] [--parse_ignorenoroute]
                   [--aggregate_yyyymmdd AGGREGATE_YYYYMMDD]
                   [--aggregate_nounifystops]
                   [--aggregate_delimiter AGGREGATE_DELIMITER]
                   [--aggregate_begintime AGGREGATE_BEGINTIME]
                   [--aggregate_endtime AGGREGATE_ENDTIME]
                   mode src dst

positional arguments:
  mode
  src
  dst

optional arguments:
  -h, --help            show this help message and exit
  --parse_ignoreshapes
  --parse_ignorenoroute
  --aggregate_yyyymmdd AGGREGATE_YYYYMMDD
  --aggregate_nounifystops
  --aggregate_delimiter AGGREGATE_DELIMITER
  --aggregate_begintime AGGREGATE_BEGINTIME
  --aggregate_endtime AGGREGATE_ENDTIME

Example

gtfs-parser parse gtfs.zip output
gtfs-parser parse gtfs_dir output --parse_ignoreshapes
gtfs-parser aggregate gtfs.zip output
gtfs-parser aggregate gtfs_dir output --aggregate_nounifystops

Development

uv sync
uv run pytest
uv run ruff check
uv run ruff format

Authors

Release files for gtfs-parser 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gtfs-parser 0.3.0
File Size Uploaded
gtfs_parser-0.3.0.tar.gz 9.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gtfs-parser 0.3.0
File Interpreter ABI Platform
gtfs_parser-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.5 kB

Release files / gtfs_parser-0.3.0.tar.gz

Download URL gtfs_parser-0.3.0.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
db4008678a39bb7cb70ed190e8e1255fcab1398fd9154cae01e68e24ed13d196
BLAKE2b-256 checksum
How to use checksums
cd36fe6572f80f50c8bde05144a54097fdd279f2fb1b41bc12cbfbd24a838e84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / gtfs_parser-0.3.0-py3-none-any.whl

Download URL gtfs_parser-0.3.0-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d61ddefb24ff4d05100ff37eb6999817d3473dbb7c82f79963888a74420134b
BLAKE2b-256 checksum
How to use checksums
ea91b1d505d7d6871f80edeb54cce5ced976789c4602a5d39f286f1e547df081
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page