Skip to main content

A Python library for analyzing GTFS feeds.

Project description

https://github.com/mrcagney/gtfs_kit/actions/workflows/test.yml/badge.svg

GTFS Kit is a Python 3.10+ library for analyzing General Transit Feed Specification (GTFS) data in memory without a database. It uses Pandas and GeoPandas to do the heavy lifting.

The functions/methods of GTFS Kit assume a valid GTFS feed but offer no inbuilt validation, because GTFS validation is complex and already solved by dedicated libraries. So unless you know what you’re doing, use the Canonical GTFS Validator before you analyze a feed with GTFS Kit.

Installation

Install it from PyPI with UV, say, via uv add gtfs_kit.

Examples

In the Jupyter notebook notebooks/examples.ipynb, which is a Github-displayable export of the Marimo notebook notebooks/examples.py.

Authors

  • Alex Raichev (2019-09), maintainer

Documentation

The documentation is built via Sphinx from the source code in the docs directory then published to Github Pages at araichev.github.io/gtfs_kit_docs.

Notes

  • This project’s development status is Alpha. I use GTFS Kit at my job and change it breakingly to suit my needs.

  • This project uses semantic versioning.

  • I aim for GTFS Kit to handle the current GTFS. In particular, i avoid handling GTFS extensions. That is the most reasonable scope boundary i can draw at present, given this project’s tiny budget. If you would like to fund this project to expand its scope, please email me.

  • Thanks to MRCagney for periodically donating to this project.

  • Constructive feedback and contributions are welcome. Please issue pull requests from a feature branch into the develop branch and include tests.

  • GTFS time is measured relative to noon minus 12 hours, which can mess things up when crossing into daylight savings time. I don’t think this issue causes any bugs in GTFS Kit, but you and i have been warned. Thanks to user Github user derhuerst for bringing this to my attention in closed Issue 8.

  • With release 10.0.0, i removed the validation module validators.py to avoid duplicating the work of what is now the canonical feed validator (written in Java).

  • I’ll probably move to Polars + Polars ST for the next big release so the library can handle big feeds faster.

Maintainer Notes

  • Before pushing to master, export the example Marimo notebook to Jupyter via uv run marimo export ipynb notebooks/examples.py -o notebooks/examples.ipynb --include-outputs -f, because the docs refer to that Github-displayable version.

  • After pushing to master, update the published docs via uv run make -C docs publish-docs-github

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gtfs_kit-12.0.2.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gtfs_kit-12.0.2-py3-none-any.whl (57.2 kB view details)

Uploaded Python 3

File details

Details for the file gtfs_kit-12.0.2.tar.gz.

File metadata

  • Download URL: gtfs_kit-12.0.2.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for gtfs_kit-12.0.2.tar.gz
Algorithm Hash digest
SHA256 f52f8bc6cf8d63d7332401c016851e8b9e980e24000efd8ae9da193c78cfba90
MD5 2a88b3a2e2bf7de235f372d775ee4fe5
BLAKE2b-256 2cfaee696de8bd7abc52c4c14ff15c07c947e4fe7f61b25dbc0e4edd55190782

See more details on using hashes here.

File details

Details for the file gtfs_kit-12.0.2-py3-none-any.whl.

File metadata

  • Download URL: gtfs_kit-12.0.2-py3-none-any.whl
  • Upload date:
  • Size: 57.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for gtfs_kit-12.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 762cb7b03b69461f403a184fca831fafb2116b16942079a3f4a06ed4fb894a49
MD5 279e0e685512fddd2d188a3c72947ab6
BLAKE2b-256 b3f0d2e6f6460d39ce9529cf9d244835d666a49294f61ecf83aaa79cd939e56a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page