https://github.com/mierune/gtfs-parser
parse and aggregate GTFS
https://github.com/mierune/gtfs-parser
geojson geospatial gtfs python traffic
Last synced: 5 months ago
JSON representation
parse and aggregate GTFS
- Host: GitHub
- URL: https://github.com/mierune/gtfs-parser
- Owner: MIERUNE
- License: mit
- Created: 2023-07-02T20:48:18.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-13T09:22:12.000Z (5 months ago)
- Last Synced: 2024-11-13T10:27:28.563Z (5 months ago)
- Topics: geojson, geospatial, gtfs, python, traffic
- Language: Python
- Homepage: https://pypi.org/project/gtfs-parser/
- Size: 935 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gtfs_parser
## LICENSE
MIT License
## Installation
```sh
pip install gtfs-parser
```## API
```python
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 dstpositional arguments:
mode
src
dstoptional 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
```sh
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
```## Authors
- Kanahiro Iguchi ([@Kanahiro](https://github.com/Kanahiro)) - original author
- Kohei Ota ([@takohei](https://github.com/takohei))