Merging FeedEntity messages with Python

78 views
Skip to first unread message

jill.card

unread,
Jun 7, 2023, 9:07:13 PM6/7/23
to GTFS-realtime
Hi all,

I'm writing a Python program to stream GTFS-realtime data and perform some calculations on it. The data I'm receiving is a Protobuf file with a bunch of trip updates, vehicles, and alerts. Ideally, I want to be able to parse this file and group trip updates and vehicles with the same trip id. I'm currently able to parse and access `FeedEntity`s with the same trip id by generating pairwise combinations of 2 elements from the parsed feed and comparing their trip ids, but I cannot concatenate them. Is there a way to do so?

I tried using mergeFrom(), but I get an attribute error that `FeedEntity` has no mergeFrom attribute. I thought it would work since google.protobuf.message has this function.
Reply all
Reply to author
Forward
0 new messages