GTFS Kit Polars is a Python 3.12+ library for analyzing General Transit Feed Specification (GTFS) data. It uses Polars and Polars ST LazyFrames to do the heavy lifting.
The functions/methods of GTFS Kit Polars 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 Polars.
GTFS Kit Polars is an experimental port of the GTFS Kit library from Pandas to Polars. It can process large feeds much faster than the Pandas version, and if it proves useful enough, then i’ll incorporate it into GTFS Kit as a new release.
The one thing i don’t like about this Polars version is its dependence on Polars ST, a promising new geospatial library but one that is not yet as user-friendly as GeoPandas.
Installation
Install it from PyPI with UV, say, via uv add gtfs_kit_polars.
Examples
In the Jupyter notebook notebooks/examples.ipynb, which is a Github-displayable export of the Marimo notebook notebooks/examples.py.
Notes
This project’s development status is Alpha. I use GTFS Kit Polars at my job and change it breakingly to suit my needs.
This project uses semantic versioning.
I aim for GTFS Kit Polars 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.
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
Metadata
Release files for gtfs-kit-polars 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gtfs_kit_polars-1.0.0.tar.gz | 1.0 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gtfs_kit_polars-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.1 MB
Release files / gtfs_kit_polars-1.0.0.tar.gz
| Download URL | gtfs_kit_polars-1.0.0.tar.gz |
|---|---|
| Size | 1.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b3f95c7bd724745c60ac5f9a685697d7a8a5be992c3d85b6a9980296acd11c30
|
|
BLAKE2b-256 checksum How to use checksums |
8048e707bd3a137c1a4d860958b98997a9ecba14c0e238ce8436b0feb086e48b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.13
|
Release files / gtfs_kit_polars-1.0.0-py3-none-any.whl
| Download URL | gtfs_kit_polars-1.0.0-py3-none-any.whl |
|---|---|
| Size | 60.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85753d75f00c23f36ad250c475ae37d3e9a523a31720ab6af93823951bdc09ea
|
|
BLAKE2b-256 checksum How to use checksums |
4acb03adb5f48153037b8cbfe89cddc48c19cd272093b1434004ba1ce8000b2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.13
|