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

Metadata

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 Provenance Actions
gtfs_parser-0.3.0.tar.gz 9.2 kB Without provenance Details for gtfs_parser-0.3.0.tar.gz

Built distribution (wheel)

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

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

Security for gtfs-parser 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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