ProtoBuf and TransLink

54 views Asked by At

I've found this GTFS data that I want to use, but IDK how to set up protobuf (preferably in Python) to read the data. Any help would be greatly appreciated. Thanks.

https://gtfsrt.api.translink.com.au/

1

There are 1 answers

0
Ahmad On

First, you need to download the protocol compiler from here. According to Protobuf guide on GitHub:

In the downloads section of each release, you can find pre-built binaries in zip packages: protoc-$VERSION-$PLATFORM.zip

Second, compile gtfs-realtime.proto using following command:

protoc -I=. --python_out=. ./gtfs-realtime.proto

This will look for gtfs-realtime.proto in the current directory and generates a .py file which you can import in your project. For more information, check out this tutorial. That's for the Protobuf part.

I don't have experience with GTFS, but I guess this sample may help you.