diff --git a/mtaproto/feedresponse.py b/mtaproto/feedresponse.py index 3316b5f..f3b472d 100644 --- a/mtaproto/feedresponse.py +++ b/mtaproto/feedresponse.py @@ -1,6 +1,7 @@ -from mtaproto import nyct_subway_pb2 -from pytz import timezone import datetime +from pytz import timezone + +from . import nyct_subway_pb2 TZ = timezone('US/Eastern') diff --git a/mtaproto/gtfs-realtime.proto b/mtaproto/gtfs-realtime.proto index 76057b9..f9b2b83 100644 --- a/mtaproto/gtfs-realtime.proto +++ b/mtaproto/gtfs-realtime.proto @@ -23,9 +23,11 @@ // https://github.com/google/transit/tree/master/gtfs-realtime syntax = "proto2"; -option java_package = "com.google.transit.realtime"; + package transit_realtime; +option java_package = "com.google.transit.realtime"; + // The contents of a feed message. // A feed is a continuous stream of feed messages. Each message in the stream is // obtained as a response to an appropriate HTTP GET request. @@ -362,7 +364,6 @@ message VehiclePosition { // The vehicle is not accepting additional passengers. NOT_ACCEPTING_PASSENGERS = 6; - } optional OccupancyStatus occupancy_status = 9; @@ -385,10 +386,10 @@ message Alert { // Cause of this alert. enum Cause { UNKNOWN_CAUSE = 1; - OTHER_CAUSE = 2; // Not machine-representable. + OTHER_CAUSE = 2; // Not machine-representable. TECHNICAL_PROBLEM = 3; - STRIKE = 4; // Public transit agency employees stopped working. - DEMONSTRATION = 5; // People are blocking the streets. + STRIKE = 4; // Public transit agency employees stopped working. + DEMONSTRATION = 5; // People are blocking the streets. ACCIDENT = 6; HOLIDAY = 7; WEATHER = 8; @@ -511,7 +512,7 @@ message TripDescriptor { // The initially scheduled start time of this trip instance. // When the trip_id corresponds to a non-frequency-based trip, this field // should either be omitted or be equal to the value in the GTFS feed. When - // the trip_id correponds to a frequency-based trip, the start_time must be + // the trip_id corresponds to a frequency-based trip, the start_time must be // specified for trip updates and vehicle positions. If the trip corresponds // to exact_times=1 GTFS record, then start_time must be some multiple // (including zero) of headway_secs later than frequencies.txt start_time for diff --git a/mtaproto/gtfs_realtime_pb2.py b/mtaproto/gtfs_realtime_pb2.py index 3e6b7fc..47901ad 100644 --- a/mtaproto/gtfs_realtime_pb2.py +++ b/mtaproto/gtfs_realtime_pb2.py @@ -1,12 +1,10 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: gtfs-realtime.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection +from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -15,1275 +13,58 @@ -DESCRIPTOR = _descriptor.FileDescriptor( - name='gtfs-realtime.proto', - package='transit_realtime', - syntax='proto2', - serialized_options=_b('\n\033com.google.transit.realtime'), - serialized_pb=_b('\n\x13gtfs-realtime.proto\x12\x10transit_realtime\"q\n\x0b\x46\x65\x65\x64Message\x12,\n\x06header\x18\x01 \x02(\x0b\x32\x1c.transit_realtime.FeedHeader\x12,\n\x06\x65ntity\x18\x02 \x03(\x0b\x32\x1c.transit_realtime.FeedEntity*\x06\x08\xe8\x07\x10\xd0\x0f\"\xcf\x01\n\nFeedHeader\x12\x1d\n\x15gtfs_realtime_version\x18\x01 \x02(\t\x12Q\n\x0eincrementality\x18\x02 \x01(\x0e\x32+.transit_realtime.FeedHeader.Incrementality:\x0c\x46ULL_DATASET\x12\x11\n\ttimestamp\x18\x03 \x01(\x04\"4\n\x0eIncrementality\x12\x10\n\x0c\x46ULL_DATASET\x10\x00\x12\x10\n\x0c\x44IFFERENTIAL\x10\x01*\x06\x08\xe8\x07\x10\xd0\x0f\"\xca\x01\n\nFeedEntity\x12\n\n\x02id\x18\x01 \x02(\t\x12\x19\n\nis_deleted\x18\x02 \x01(\x08:\x05\x66\x61lse\x12\x31\n\x0btrip_update\x18\x03 \x01(\x0b\x32\x1c.transit_realtime.TripUpdate\x12\x32\n\x07vehicle\x18\x04 \x01(\x0b\x32!.transit_realtime.VehiclePosition\x12&\n\x05\x61lert\x18\x05 \x01(\x0b\x32\x17.transit_realtime.Alert*\x06\x08\xe8\x07\x10\xd0\x0f\"\x9a\x05\n\nTripUpdate\x12.\n\x04trip\x18\x01 \x02(\x0b\x32 .transit_realtime.TripDescriptor\x12\x34\n\x07vehicle\x18\x03 \x01(\x0b\x32#.transit_realtime.VehicleDescriptor\x12\x45\n\x10stop_time_update\x18\x02 \x03(\x0b\x32+.transit_realtime.TripUpdate.StopTimeUpdate\x12\x11\n\ttimestamp\x18\x04 \x01(\x04\x12\r\n\x05\x64\x65lay\x18\x05 \x01(\x05\x1aI\n\rStopTimeEvent\x12\r\n\x05\x64\x65lay\x18\x01 \x01(\x05\x12\x0c\n\x04time\x18\x02 \x01(\x03\x12\x13\n\x0buncertainty\x18\x03 \x01(\x05*\x06\x08\xe8\x07\x10\xd0\x0f\x1a\xe9\x02\n\x0eStopTimeUpdate\x12\x15\n\rstop_sequence\x18\x01 \x01(\r\x12\x0f\n\x07stop_id\x18\x04 \x01(\t\x12;\n\x07\x61rrival\x18\x02 \x01(\x0b\x32*.transit_realtime.TripUpdate.StopTimeEvent\x12=\n\tdeparture\x18\x03 \x01(\x0b\x32*.transit_realtime.TripUpdate.StopTimeEvent\x12j\n\x15schedule_relationship\x18\x05 \x01(\x0e\x32@.transit_realtime.TripUpdate.StopTimeUpdate.ScheduleRelationship:\tSCHEDULED\"?\n\x14ScheduleRelationship\x12\r\n\tSCHEDULED\x10\x00\x12\x0b\n\x07SKIPPED\x10\x01\x12\x0b\n\x07NO_DATA\x10\x02*\x06\x08\xe8\x07\x10\xd0\x0f*\x06\x08\xe8\x07\x10\xd0\x0f\"\xe0\x06\n\x0fVehiclePosition\x12.\n\x04trip\x18\x01 \x01(\x0b\x32 .transit_realtime.TripDescriptor\x12\x34\n\x07vehicle\x18\x08 \x01(\x0b\x32#.transit_realtime.VehicleDescriptor\x12,\n\x08position\x18\x02 \x01(\x0b\x32\x1a.transit_realtime.Position\x12\x1d\n\x15\x63urrent_stop_sequence\x18\x03 \x01(\r\x12\x0f\n\x07stop_id\x18\x07 \x01(\t\x12Z\n\x0e\x63urrent_status\x18\x04 \x01(\x0e\x32\x33.transit_realtime.VehiclePosition.VehicleStopStatus:\rIN_TRANSIT_TO\x12\x11\n\ttimestamp\x18\x05 \x01(\x04\x12K\n\x10\x63ongestion_level\x18\x06 \x01(\x0e\x32\x31.transit_realtime.VehiclePosition.CongestionLevel\x12K\n\x10occupancy_status\x18\t \x01(\x0e\x32\x31.transit_realtime.VehiclePosition.OccupancyStatus\"G\n\x11VehicleStopStatus\x12\x0f\n\x0bINCOMING_AT\x10\x00\x12\x0e\n\nSTOPPED_AT\x10\x01\x12\x11\n\rIN_TRANSIT_TO\x10\x02\"}\n\x0f\x43ongestionLevel\x12\x1c\n\x18UNKNOWN_CONGESTION_LEVEL\x10\x00\x12\x14\n\x10RUNNING_SMOOTHLY\x10\x01\x12\x0f\n\x0bSTOP_AND_GO\x10\x02\x12\x0e\n\nCONGESTION\x10\x03\x12\x15\n\x11SEVERE_CONGESTION\x10\x04\"\xaf\x01\n\x0fOccupancyStatus\x12\t\n\x05\x45MPTY\x10\x00\x12\x18\n\x14MANY_SEATS_AVAILABLE\x10\x01\x12\x17\n\x13\x46\x45W_SEATS_AVAILABLE\x10\x02\x12\x16\n\x12STANDING_ROOM_ONLY\x10\x03\x12\x1e\n\x1a\x43RUSHED_STANDING_ROOM_ONLY\x10\x04\x12\x08\n\x04\x46ULL\x10\x05\x12\x1c\n\x18NOT_ACCEPTING_PASSENGERS\x10\x06*\x06\x08\xe8\x07\x10\xd0\x0f\"\xb6\x06\n\x05\x41lert\x12\x32\n\ractive_period\x18\x01 \x03(\x0b\x32\x1b.transit_realtime.TimeRange\x12\x39\n\x0finformed_entity\x18\x05 \x03(\x0b\x32 .transit_realtime.EntitySelector\x12;\n\x05\x63\x61use\x18\x06 \x01(\x0e\x32\x1d.transit_realtime.Alert.Cause:\rUNKNOWN_CAUSE\x12>\n\x06\x65\x66\x66\x65\x63t\x18\x07 \x01(\x0e\x32\x1e.transit_realtime.Alert.Effect:\x0eUNKNOWN_EFFECT\x12/\n\x03url\x18\x08 \x01(\x0b\x32\".transit_realtime.TranslatedString\x12\x37\n\x0bheader_text\x18\n \x01(\x0b\x32\".transit_realtime.TranslatedString\x12<\n\x10\x64\x65scription_text\x18\x0b \x01(\x0b\x32\".transit_realtime.TranslatedString\"\xd8\x01\n\x05\x43\x61use\x12\x11\n\rUNKNOWN_CAUSE\x10\x01\x12\x0f\n\x0bOTHER_CAUSE\x10\x02\x12\x15\n\x11TECHNICAL_PROBLEM\x10\x03\x12\n\n\x06STRIKE\x10\x04\x12\x11\n\rDEMONSTRATION\x10\x05\x12\x0c\n\x08\x41\x43\x43IDENT\x10\x06\x12\x0b\n\x07HOLIDAY\x10\x07\x12\x0b\n\x07WEATHER\x10\x08\x12\x0f\n\x0bMAINTENANCE\x10\t\x12\x10\n\x0c\x43ONSTRUCTION\x10\n\x12\x13\n\x0fPOLICE_ACTIVITY\x10\x0b\x12\x15\n\x11MEDICAL_EMERGENCY\x10\x0c\"\xb5\x01\n\x06\x45\x66\x66\x65\x63t\x12\x0e\n\nNO_SERVICE\x10\x01\x12\x13\n\x0fREDUCED_SERVICE\x10\x02\x12\x16\n\x12SIGNIFICANT_DELAYS\x10\x03\x12\n\n\x06\x44\x45TOUR\x10\x04\x12\x16\n\x12\x41\x44\x44ITIONAL_SERVICE\x10\x05\x12\x14\n\x10MODIFIED_SERVICE\x10\x06\x12\x10\n\x0cOTHER_EFFECT\x10\x07\x12\x12\n\x0eUNKNOWN_EFFECT\x10\x08\x12\x0e\n\nSTOP_MOVED\x10\t*\x06\x08\xe8\x07\x10\xd0\x0f\"/\n\tTimeRange\x12\r\n\x05start\x18\x01 \x01(\x04\x12\x0b\n\x03\x65nd\x18\x02 \x01(\x04*\x06\x08\xe8\x07\x10\xd0\x0f\"i\n\x08Position\x12\x10\n\x08latitude\x18\x01 \x02(\x02\x12\x11\n\tlongitude\x18\x02 \x02(\x02\x12\x0f\n\x07\x62\x65\x61ring\x18\x03 \x01(\x02\x12\x10\n\x08odometer\x18\x04 \x01(\x01\x12\r\n\x05speed\x18\x05 \x01(\x02*\x06\x08\xe8\x07\x10\xd0\x0f\"\xa0\x02\n\x0eTripDescriptor\x12\x0f\n\x07trip_id\x18\x01 \x01(\t\x12\x10\n\x08route_id\x18\x05 \x01(\t\x12\x14\n\x0c\x64irection_id\x18\x06 \x01(\r\x12\x12\n\nstart_time\x18\x02 \x01(\t\x12\x12\n\nstart_date\x18\x03 \x01(\t\x12T\n\x15schedule_relationship\x18\x04 \x01(\x0e\x32\x35.transit_realtime.TripDescriptor.ScheduleRelationship\"O\n\x14ScheduleRelationship\x12\r\n\tSCHEDULED\x10\x00\x12\t\n\x05\x41\x44\x44\x45\x44\x10\x01\x12\x0f\n\x0bUNSCHEDULED\x10\x02\x12\x0c\n\x08\x43\x41NCELED\x10\x03*\x06\x08\xe8\x07\x10\xd0\x0f\"M\n\x11VehicleDescriptor\x12\n\n\x02id\x18\x01 \x01(\t\x12\r\n\x05label\x18\x02 \x01(\t\x12\x15\n\rlicense_plate\x18\x03 \x01(\t*\x06\x08\xe8\x07\x10\xd0\x0f\"\x92\x01\n\x0e\x45ntitySelector\x12\x11\n\tagency_id\x18\x01 \x01(\t\x12\x10\n\x08route_id\x18\x02 \x01(\t\x12\x12\n\nroute_type\x18\x03 \x01(\x05\x12.\n\x04trip\x18\x04 \x01(\x0b\x32 .transit_realtime.TripDescriptor\x12\x0f\n\x07stop_id\x18\x05 \x01(\t*\x06\x08\xe8\x07\x10\xd0\x0f\"\x96\x01\n\x10TranslatedString\x12\x43\n\x0btranslation\x18\x01 \x03(\x0b\x32..transit_realtime.TranslatedString.Translation\x1a\x35\n\x0bTranslation\x12\x0c\n\x04text\x18\x01 \x02(\t\x12\x10\n\x08language\x18\x02 \x01(\t*\x06\x08\xe8\x07\x10\xd0\x0f*\x06\x08\xe8\x07\x10\xd0\x0f\x42\x1d\n\x1b\x63om.google.transit.realtime') -) - - - -_FEEDHEADER_INCREMENTALITY = _descriptor.EnumDescriptor( - name='Incrementality', - full_name='transit_realtime.FeedHeader.Incrementality', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='FULL_DATASET', index=0, number=0, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='DIFFERENTIAL', index=1, number=1, - serialized_options=None, - type=None), - ], - containing_type=None, - serialized_options=None, - serialized_start=304, - serialized_end=356, -) -_sym_db.RegisterEnumDescriptor(_FEEDHEADER_INCREMENTALITY) - -_TRIPUPDATE_STOPTIMEUPDATE_SCHEDULERELATIONSHIP = _descriptor.EnumDescriptor( - name='ScheduleRelationship', - full_name='transit_realtime.TripUpdate.StopTimeUpdate.ScheduleRelationship', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='SCHEDULED', index=0, number=0, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SKIPPED', index=1, number=1, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='NO_DATA', index=2, number=2, - serialized_options=None, - type=None), - ], - containing_type=None, - serialized_options=None, - serialized_start=1159, - serialized_end=1222, -) -_sym_db.RegisterEnumDescriptor(_TRIPUPDATE_STOPTIMEUPDATE_SCHEDULERELATIONSHIP) - -_VEHICLEPOSITION_VEHICLESTOPSTATUS = _descriptor.EnumDescriptor( - name='VehicleStopStatus', - full_name='transit_realtime.VehiclePosition.VehicleStopStatus', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='INCOMING_AT', index=0, number=0, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='STOPPED_AT', index=1, number=1, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='IN_TRANSIT_TO', index=2, number=2, - serialized_options=None, - type=None), - ], - containing_type=None, - serialized_options=None, - serialized_start=1721, - serialized_end=1792, -) -_sym_db.RegisterEnumDescriptor(_VEHICLEPOSITION_VEHICLESTOPSTATUS) - -_VEHICLEPOSITION_CONGESTIONLEVEL = _descriptor.EnumDescriptor( - name='CongestionLevel', - full_name='transit_realtime.VehiclePosition.CongestionLevel', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='UNKNOWN_CONGESTION_LEVEL', index=0, number=0, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='RUNNING_SMOOTHLY', index=1, number=1, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='STOP_AND_GO', index=2, number=2, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='CONGESTION', index=3, number=3, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SEVERE_CONGESTION', index=4, number=4, - serialized_options=None, - type=None), - ], - containing_type=None, - serialized_options=None, - serialized_start=1794, - serialized_end=1919, -) -_sym_db.RegisterEnumDescriptor(_VEHICLEPOSITION_CONGESTIONLEVEL) - -_VEHICLEPOSITION_OCCUPANCYSTATUS = _descriptor.EnumDescriptor( - name='OccupancyStatus', - full_name='transit_realtime.VehiclePosition.OccupancyStatus', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='EMPTY', index=0, number=0, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='MANY_SEATS_AVAILABLE', index=1, number=1, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='FEW_SEATS_AVAILABLE', index=2, number=2, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='STANDING_ROOM_ONLY', index=3, number=3, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='CRUSHED_STANDING_ROOM_ONLY', index=4, number=4, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='FULL', index=5, number=5, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='NOT_ACCEPTING_PASSENGERS', index=6, number=6, - serialized_options=None, - type=None), - ], - containing_type=None, - serialized_options=None, - serialized_start=1922, - serialized_end=2097, -) -_sym_db.RegisterEnumDescriptor(_VEHICLEPOSITION_OCCUPANCYSTATUS) - -_ALERT_CAUSE = _descriptor.EnumDescriptor( - name='Cause', - full_name='transit_realtime.Alert.Cause', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='UNKNOWN_CAUSE', index=0, number=1, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='OTHER_CAUSE', index=1, number=2, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='TECHNICAL_PROBLEM', index=2, number=3, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='STRIKE', index=3, number=4, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='DEMONSTRATION', index=4, number=5, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='ACCIDENT', index=5, number=6, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='HOLIDAY', index=6, number=7, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='WEATHER', index=7, number=8, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='MAINTENANCE', index=8, number=9, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='CONSTRUCTION', index=9, number=10, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='POLICE_ACTIVITY', index=10, number=11, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='MEDICAL_EMERGENCY', index=11, number=12, - serialized_options=None, - type=None), - ], - containing_type=None, - serialized_options=None, - serialized_start=2522, - serialized_end=2738, -) -_sym_db.RegisterEnumDescriptor(_ALERT_CAUSE) - -_ALERT_EFFECT = _descriptor.EnumDescriptor( - name='Effect', - full_name='transit_realtime.Alert.Effect', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='NO_SERVICE', index=0, number=1, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='REDUCED_SERVICE', index=1, number=2, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SIGNIFICANT_DELAYS', index=2, number=3, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='DETOUR', index=3, number=4, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='ADDITIONAL_SERVICE', index=4, number=5, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='MODIFIED_SERVICE', index=5, number=6, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='OTHER_EFFECT', index=6, number=7, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='UNKNOWN_EFFECT', index=7, number=8, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='STOP_MOVED', index=8, number=9, - serialized_options=None, - type=None), - ], - containing_type=None, - serialized_options=None, - serialized_start=2741, - serialized_end=2922, -) -_sym_db.RegisterEnumDescriptor(_ALERT_EFFECT) - -_TRIPDESCRIPTOR_SCHEDULERELATIONSHIP = _descriptor.EnumDescriptor( - name='ScheduleRelationship', - full_name='transit_realtime.TripDescriptor.ScheduleRelationship', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='SCHEDULED', index=0, number=0, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='ADDED', index=1, number=1, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='UNSCHEDULED', index=2, number=2, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='CANCELED', index=3, number=3, - serialized_options=None, - type=None), - ], - containing_type=None, - serialized_options=None, - serialized_start=3290, - serialized_end=3369, -) -_sym_db.RegisterEnumDescriptor(_TRIPDESCRIPTOR_SCHEDULERELATIONSHIP) - - -_FEEDMESSAGE = _descriptor.Descriptor( - name='FeedMessage', - full_name='transit_realtime.FeedMessage', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='header', full_name='transit_realtime.FeedMessage.header', index=0, - number=1, type=11, cpp_type=10, label=2, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='entity', full_name='transit_realtime.FeedMessage.entity', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=True, - syntax='proto2', - extension_ranges=[(1000, 2000), ], - oneofs=[ - ], - serialized_start=41, - serialized_end=154, -) - - -_FEEDHEADER = _descriptor.Descriptor( - name='FeedHeader', - full_name='transit_realtime.FeedHeader', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='gtfs_realtime_version', full_name='transit_realtime.FeedHeader.gtfs_realtime_version', index=0, - number=1, type=9, cpp_type=9, label=2, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='incrementality', full_name='transit_realtime.FeedHeader.incrementality', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=True, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='timestamp', full_name='transit_realtime.FeedHeader.timestamp', index=2, - number=3, type=4, cpp_type=4, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _FEEDHEADER_INCREMENTALITY, - ], - serialized_options=None, - is_extendable=True, - syntax='proto2', - extension_ranges=[(1000, 2000), ], - oneofs=[ - ], - serialized_start=157, - serialized_end=364, -) - - -_FEEDENTITY = _descriptor.Descriptor( - name='FeedEntity', - full_name='transit_realtime.FeedEntity', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='id', full_name='transit_realtime.FeedEntity.id', index=0, - number=1, type=9, cpp_type=9, label=2, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='is_deleted', full_name='transit_realtime.FeedEntity.is_deleted', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=True, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='trip_update', full_name='transit_realtime.FeedEntity.trip_update', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='vehicle', full_name='transit_realtime.FeedEntity.vehicle', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='alert', full_name='transit_realtime.FeedEntity.alert', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=True, - syntax='proto2', - extension_ranges=[(1000, 2000), ], - oneofs=[ - ], - serialized_start=367, - serialized_end=569, -) - - -_TRIPUPDATE_STOPTIMEEVENT = _descriptor.Descriptor( - name='StopTimeEvent', - full_name='transit_realtime.TripUpdate.StopTimeEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='delay', full_name='transit_realtime.TripUpdate.StopTimeEvent.delay', index=0, - number=1, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='time', full_name='transit_realtime.TripUpdate.StopTimeEvent.time', index=1, - number=2, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='uncertainty', full_name='transit_realtime.TripUpdate.StopTimeEvent.uncertainty', index=2, - number=3, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=True, - syntax='proto2', - extension_ranges=[(1000, 2000), ], - oneofs=[ - ], - serialized_start=793, - serialized_end=866, -) - -_TRIPUPDATE_STOPTIMEUPDATE = _descriptor.Descriptor( - name='StopTimeUpdate', - full_name='transit_realtime.TripUpdate.StopTimeUpdate', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='stop_sequence', full_name='transit_realtime.TripUpdate.StopTimeUpdate.stop_sequence', index=0, - number=1, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='stop_id', full_name='transit_realtime.TripUpdate.StopTimeUpdate.stop_id', index=1, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='arrival', full_name='transit_realtime.TripUpdate.StopTimeUpdate.arrival', index=2, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='departure', full_name='transit_realtime.TripUpdate.StopTimeUpdate.departure', index=3, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='schedule_relationship', full_name='transit_realtime.TripUpdate.StopTimeUpdate.schedule_relationship', index=4, - number=5, type=14, cpp_type=8, label=1, - has_default_value=True, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _TRIPUPDATE_STOPTIMEUPDATE_SCHEDULERELATIONSHIP, - ], - serialized_options=None, - is_extendable=True, - syntax='proto2', - extension_ranges=[(1000, 2000), ], - oneofs=[ - ], - serialized_start=869, - serialized_end=1230, -) - -_TRIPUPDATE = _descriptor.Descriptor( - name='TripUpdate', - full_name='transit_realtime.TripUpdate', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='trip', full_name='transit_realtime.TripUpdate.trip', index=0, - number=1, type=11, cpp_type=10, label=2, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='vehicle', full_name='transit_realtime.TripUpdate.vehicle', index=1, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='stop_time_update', full_name='transit_realtime.TripUpdate.stop_time_update', index=2, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='timestamp', full_name='transit_realtime.TripUpdate.timestamp', index=3, - number=4, type=4, cpp_type=4, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='delay', full_name='transit_realtime.TripUpdate.delay', index=4, - number=5, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[_TRIPUPDATE_STOPTIMEEVENT, _TRIPUPDATE_STOPTIMEUPDATE, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=True, - syntax='proto2', - extension_ranges=[(1000, 2000), ], - oneofs=[ - ], - serialized_start=572, - serialized_end=1238, -) - - -_VEHICLEPOSITION = _descriptor.Descriptor( - name='VehiclePosition', - full_name='transit_realtime.VehiclePosition', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='trip', full_name='transit_realtime.VehiclePosition.trip', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='vehicle', full_name='transit_realtime.VehiclePosition.vehicle', index=1, - number=8, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='position', full_name='transit_realtime.VehiclePosition.position', index=2, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='current_stop_sequence', full_name='transit_realtime.VehiclePosition.current_stop_sequence', index=3, - number=3, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='stop_id', full_name='transit_realtime.VehiclePosition.stop_id', index=4, - number=7, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='current_status', full_name='transit_realtime.VehiclePosition.current_status', index=5, - number=4, type=14, cpp_type=8, label=1, - has_default_value=True, default_value=2, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='timestamp', full_name='transit_realtime.VehiclePosition.timestamp', index=6, - number=5, type=4, cpp_type=4, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='congestion_level', full_name='transit_realtime.VehiclePosition.congestion_level', index=7, - number=6, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='occupancy_status', full_name='transit_realtime.VehiclePosition.occupancy_status', index=8, - number=9, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _VEHICLEPOSITION_VEHICLESTOPSTATUS, - _VEHICLEPOSITION_CONGESTIONLEVEL, - _VEHICLEPOSITION_OCCUPANCYSTATUS, - ], - serialized_options=None, - is_extendable=True, - syntax='proto2', - extension_ranges=[(1000, 2000), ], - oneofs=[ - ], - serialized_start=1241, - serialized_end=2105, -) - - -_ALERT = _descriptor.Descriptor( - name='Alert', - full_name='transit_realtime.Alert', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='active_period', full_name='transit_realtime.Alert.active_period', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='informed_entity', full_name='transit_realtime.Alert.informed_entity', index=1, - number=5, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='cause', full_name='transit_realtime.Alert.cause', index=2, - number=6, type=14, cpp_type=8, label=1, - has_default_value=True, default_value=1, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='effect', full_name='transit_realtime.Alert.effect', index=3, - number=7, type=14, cpp_type=8, label=1, - has_default_value=True, default_value=8, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='url', full_name='transit_realtime.Alert.url', index=4, - number=8, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='header_text', full_name='transit_realtime.Alert.header_text', index=5, - number=10, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='description_text', full_name='transit_realtime.Alert.description_text', index=6, - number=11, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _ALERT_CAUSE, - _ALERT_EFFECT, - ], - serialized_options=None, - is_extendable=True, - syntax='proto2', - extension_ranges=[(1000, 2000), ], - oneofs=[ - ], - serialized_start=2108, - serialized_end=2930, -) - - -_TIMERANGE = _descriptor.Descriptor( - name='TimeRange', - full_name='transit_realtime.TimeRange', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='start', full_name='transit_realtime.TimeRange.start', index=0, - number=1, type=4, cpp_type=4, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='end', full_name='transit_realtime.TimeRange.end', index=1, - number=2, type=4, cpp_type=4, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=True, - syntax='proto2', - extension_ranges=[(1000, 2000), ], - oneofs=[ - ], - serialized_start=2932, - serialized_end=2979, -) - - -_POSITION = _descriptor.Descriptor( - name='Position', - full_name='transit_realtime.Position', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='latitude', full_name='transit_realtime.Position.latitude', index=0, - number=1, type=2, cpp_type=6, label=2, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='longitude', full_name='transit_realtime.Position.longitude', index=1, - number=2, type=2, cpp_type=6, label=2, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='bearing', full_name='transit_realtime.Position.bearing', index=2, - number=3, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='odometer', full_name='transit_realtime.Position.odometer', index=3, - number=4, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='speed', full_name='transit_realtime.Position.speed', index=4, - number=5, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=True, - syntax='proto2', - extension_ranges=[(1000, 2000), ], - oneofs=[ - ], - serialized_start=2981, - serialized_end=3086, -) - - -_TRIPDESCRIPTOR = _descriptor.Descriptor( - name='TripDescriptor', - full_name='transit_realtime.TripDescriptor', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='trip_id', full_name='transit_realtime.TripDescriptor.trip_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='route_id', full_name='transit_realtime.TripDescriptor.route_id', index=1, - number=5, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='direction_id', full_name='transit_realtime.TripDescriptor.direction_id', index=2, - number=6, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='start_time', full_name='transit_realtime.TripDescriptor.start_time', index=3, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='start_date', full_name='transit_realtime.TripDescriptor.start_date', index=4, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='schedule_relationship', full_name='transit_realtime.TripDescriptor.schedule_relationship', index=5, - number=4, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _TRIPDESCRIPTOR_SCHEDULERELATIONSHIP, - ], - serialized_options=None, - is_extendable=True, - syntax='proto2', - extension_ranges=[(1000, 2000), ], - oneofs=[ - ], - serialized_start=3089, - serialized_end=3377, -) - - -_VEHICLEDESCRIPTOR = _descriptor.Descriptor( - name='VehicleDescriptor', - full_name='transit_realtime.VehicleDescriptor', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='id', full_name='transit_realtime.VehicleDescriptor.id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='label', full_name='transit_realtime.VehicleDescriptor.label', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='license_plate', full_name='transit_realtime.VehicleDescriptor.license_plate', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=True, - syntax='proto2', - extension_ranges=[(1000, 2000), ], - oneofs=[ - ], - serialized_start=3379, - serialized_end=3456, -) - - -_ENTITYSELECTOR = _descriptor.Descriptor( - name='EntitySelector', - full_name='transit_realtime.EntitySelector', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='agency_id', full_name='transit_realtime.EntitySelector.agency_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='route_id', full_name='transit_realtime.EntitySelector.route_id', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='route_type', full_name='transit_realtime.EntitySelector.route_type', index=2, - number=3, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='trip', full_name='transit_realtime.EntitySelector.trip', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='stop_id', full_name='transit_realtime.EntitySelector.stop_id', index=4, - number=5, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=True, - syntax='proto2', - extension_ranges=[(1000, 2000), ], - oneofs=[ - ], - serialized_start=3459, - serialized_end=3605, -) - - -_TRANSLATEDSTRING_TRANSLATION = _descriptor.Descriptor( - name='Translation', - full_name='transit_realtime.TranslatedString.Translation', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='text', full_name='transit_realtime.TranslatedString.Translation.text', index=0, - number=1, type=9, cpp_type=9, label=2, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='language', full_name='transit_realtime.TranslatedString.Translation.language', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=True, - syntax='proto2', - extension_ranges=[(1000, 2000), ], - oneofs=[ - ], - serialized_start=3697, - serialized_end=3750, -) - -_TRANSLATEDSTRING = _descriptor.Descriptor( - name='TranslatedString', - full_name='transit_realtime.TranslatedString', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='translation', full_name='transit_realtime.TranslatedString.translation', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[_TRANSLATEDSTRING_TRANSLATION, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=True, - syntax='proto2', - extension_ranges=[(1000, 2000), ], - oneofs=[ - ], - serialized_start=3608, - serialized_end=3758, -) - -_FEEDMESSAGE.fields_by_name['header'].message_type = _FEEDHEADER -_FEEDMESSAGE.fields_by_name['entity'].message_type = _FEEDENTITY -_FEEDHEADER.fields_by_name['incrementality'].enum_type = _FEEDHEADER_INCREMENTALITY -_FEEDHEADER_INCREMENTALITY.containing_type = _FEEDHEADER -_FEEDENTITY.fields_by_name['trip_update'].message_type = _TRIPUPDATE -_FEEDENTITY.fields_by_name['vehicle'].message_type = _VEHICLEPOSITION -_FEEDENTITY.fields_by_name['alert'].message_type = _ALERT -_TRIPUPDATE_STOPTIMEEVENT.containing_type = _TRIPUPDATE -_TRIPUPDATE_STOPTIMEUPDATE.fields_by_name['arrival'].message_type = _TRIPUPDATE_STOPTIMEEVENT -_TRIPUPDATE_STOPTIMEUPDATE.fields_by_name['departure'].message_type = _TRIPUPDATE_STOPTIMEEVENT -_TRIPUPDATE_STOPTIMEUPDATE.fields_by_name['schedule_relationship'].enum_type = _TRIPUPDATE_STOPTIMEUPDATE_SCHEDULERELATIONSHIP -_TRIPUPDATE_STOPTIMEUPDATE.containing_type = _TRIPUPDATE -_TRIPUPDATE_STOPTIMEUPDATE_SCHEDULERELATIONSHIP.containing_type = _TRIPUPDATE_STOPTIMEUPDATE -_TRIPUPDATE.fields_by_name['trip'].message_type = _TRIPDESCRIPTOR -_TRIPUPDATE.fields_by_name['vehicle'].message_type = _VEHICLEDESCRIPTOR -_TRIPUPDATE.fields_by_name['stop_time_update'].message_type = _TRIPUPDATE_STOPTIMEUPDATE -_VEHICLEPOSITION.fields_by_name['trip'].message_type = _TRIPDESCRIPTOR -_VEHICLEPOSITION.fields_by_name['vehicle'].message_type = _VEHICLEDESCRIPTOR -_VEHICLEPOSITION.fields_by_name['position'].message_type = _POSITION -_VEHICLEPOSITION.fields_by_name['current_status'].enum_type = _VEHICLEPOSITION_VEHICLESTOPSTATUS -_VEHICLEPOSITION.fields_by_name['congestion_level'].enum_type = _VEHICLEPOSITION_CONGESTIONLEVEL -_VEHICLEPOSITION.fields_by_name['occupancy_status'].enum_type = _VEHICLEPOSITION_OCCUPANCYSTATUS -_VEHICLEPOSITION_VEHICLESTOPSTATUS.containing_type = _VEHICLEPOSITION -_VEHICLEPOSITION_CONGESTIONLEVEL.containing_type = _VEHICLEPOSITION -_VEHICLEPOSITION_OCCUPANCYSTATUS.containing_type = _VEHICLEPOSITION -_ALERT.fields_by_name['active_period'].message_type = _TIMERANGE -_ALERT.fields_by_name['informed_entity'].message_type = _ENTITYSELECTOR -_ALERT.fields_by_name['cause'].enum_type = _ALERT_CAUSE -_ALERT.fields_by_name['effect'].enum_type = _ALERT_EFFECT -_ALERT.fields_by_name['url'].message_type = _TRANSLATEDSTRING -_ALERT.fields_by_name['header_text'].message_type = _TRANSLATEDSTRING -_ALERT.fields_by_name['description_text'].message_type = _TRANSLATEDSTRING -_ALERT_CAUSE.containing_type = _ALERT -_ALERT_EFFECT.containing_type = _ALERT -_TRIPDESCRIPTOR.fields_by_name['schedule_relationship'].enum_type = _TRIPDESCRIPTOR_SCHEDULERELATIONSHIP -_TRIPDESCRIPTOR_SCHEDULERELATIONSHIP.containing_type = _TRIPDESCRIPTOR -_ENTITYSELECTOR.fields_by_name['trip'].message_type = _TRIPDESCRIPTOR -_TRANSLATEDSTRING_TRANSLATION.containing_type = _TRANSLATEDSTRING -_TRANSLATEDSTRING.fields_by_name['translation'].message_type = _TRANSLATEDSTRING_TRANSLATION -DESCRIPTOR.message_types_by_name['FeedMessage'] = _FEEDMESSAGE -DESCRIPTOR.message_types_by_name['FeedHeader'] = _FEEDHEADER -DESCRIPTOR.message_types_by_name['FeedEntity'] = _FEEDENTITY -DESCRIPTOR.message_types_by_name['TripUpdate'] = _TRIPUPDATE -DESCRIPTOR.message_types_by_name['VehiclePosition'] = _VEHICLEPOSITION -DESCRIPTOR.message_types_by_name['Alert'] = _ALERT -DESCRIPTOR.message_types_by_name['TimeRange'] = _TIMERANGE -DESCRIPTOR.message_types_by_name['Position'] = _POSITION -DESCRIPTOR.message_types_by_name['TripDescriptor'] = _TRIPDESCRIPTOR -DESCRIPTOR.message_types_by_name['VehicleDescriptor'] = _VEHICLEDESCRIPTOR -DESCRIPTOR.message_types_by_name['EntitySelector'] = _ENTITYSELECTOR -DESCRIPTOR.message_types_by_name['TranslatedString'] = _TRANSLATEDSTRING -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -FeedMessage = _reflection.GeneratedProtocolMessageType('FeedMessage', (_message.Message,), { - 'DESCRIPTOR' : _FEEDMESSAGE, - '__module__' : 'gtfs_realtime_pb2' - # @@protoc_insertion_point(class_scope:transit_realtime.FeedMessage) - }) -_sym_db.RegisterMessage(FeedMessage) - -FeedHeader = _reflection.GeneratedProtocolMessageType('FeedHeader', (_message.Message,), { - 'DESCRIPTOR' : _FEEDHEADER, - '__module__' : 'gtfs_realtime_pb2' - # @@protoc_insertion_point(class_scope:transit_realtime.FeedHeader) - }) -_sym_db.RegisterMessage(FeedHeader) - -FeedEntity = _reflection.GeneratedProtocolMessageType('FeedEntity', (_message.Message,), { - 'DESCRIPTOR' : _FEEDENTITY, - '__module__' : 'gtfs_realtime_pb2' - # @@protoc_insertion_point(class_scope:transit_realtime.FeedEntity) - }) -_sym_db.RegisterMessage(FeedEntity) - -TripUpdate = _reflection.GeneratedProtocolMessageType('TripUpdate', (_message.Message,), { - - 'StopTimeEvent' : _reflection.GeneratedProtocolMessageType('StopTimeEvent', (_message.Message,), { - 'DESCRIPTOR' : _TRIPUPDATE_STOPTIMEEVENT, - '__module__' : 'gtfs_realtime_pb2' - # @@protoc_insertion_point(class_scope:transit_realtime.TripUpdate.StopTimeEvent) - }) - , - - 'StopTimeUpdate' : _reflection.GeneratedProtocolMessageType('StopTimeUpdate', (_message.Message,), { - 'DESCRIPTOR' : _TRIPUPDATE_STOPTIMEUPDATE, - '__module__' : 'gtfs_realtime_pb2' - # @@protoc_insertion_point(class_scope:transit_realtime.TripUpdate.StopTimeUpdate) - }) - , - 'DESCRIPTOR' : _TRIPUPDATE, - '__module__' : 'gtfs_realtime_pb2' - # @@protoc_insertion_point(class_scope:transit_realtime.TripUpdate) - }) -_sym_db.RegisterMessage(TripUpdate) -_sym_db.RegisterMessage(TripUpdate.StopTimeEvent) -_sym_db.RegisterMessage(TripUpdate.StopTimeUpdate) - -VehiclePosition = _reflection.GeneratedProtocolMessageType('VehiclePosition', (_message.Message,), { - 'DESCRIPTOR' : _VEHICLEPOSITION, - '__module__' : 'gtfs_realtime_pb2' - # @@protoc_insertion_point(class_scope:transit_realtime.VehiclePosition) - }) -_sym_db.RegisterMessage(VehiclePosition) - -Alert = _reflection.GeneratedProtocolMessageType('Alert', (_message.Message,), { - 'DESCRIPTOR' : _ALERT, - '__module__' : 'gtfs_realtime_pb2' - # @@protoc_insertion_point(class_scope:transit_realtime.Alert) - }) -_sym_db.RegisterMessage(Alert) - -TimeRange = _reflection.GeneratedProtocolMessageType('TimeRange', (_message.Message,), { - 'DESCRIPTOR' : _TIMERANGE, - '__module__' : 'gtfs_realtime_pb2' - # @@protoc_insertion_point(class_scope:transit_realtime.TimeRange) - }) -_sym_db.RegisterMessage(TimeRange) - -Position = _reflection.GeneratedProtocolMessageType('Position', (_message.Message,), { - 'DESCRIPTOR' : _POSITION, - '__module__' : 'gtfs_realtime_pb2' - # @@protoc_insertion_point(class_scope:transit_realtime.Position) - }) -_sym_db.RegisterMessage(Position) - -TripDescriptor = _reflection.GeneratedProtocolMessageType('TripDescriptor', (_message.Message,), { - 'DESCRIPTOR' : _TRIPDESCRIPTOR, - '__module__' : 'gtfs_realtime_pb2' - # @@protoc_insertion_point(class_scope:transit_realtime.TripDescriptor) - }) -_sym_db.RegisterMessage(TripDescriptor) - -VehicleDescriptor = _reflection.GeneratedProtocolMessageType('VehicleDescriptor', (_message.Message,), { - 'DESCRIPTOR' : _VEHICLEDESCRIPTOR, - '__module__' : 'gtfs_realtime_pb2' - # @@protoc_insertion_point(class_scope:transit_realtime.VehicleDescriptor) - }) -_sym_db.RegisterMessage(VehicleDescriptor) - -EntitySelector = _reflection.GeneratedProtocolMessageType('EntitySelector', (_message.Message,), { - 'DESCRIPTOR' : _ENTITYSELECTOR, - '__module__' : 'gtfs_realtime_pb2' - # @@protoc_insertion_point(class_scope:transit_realtime.EntitySelector) - }) -_sym_db.RegisterMessage(EntitySelector) - -TranslatedString = _reflection.GeneratedProtocolMessageType('TranslatedString', (_message.Message,), { - - 'Translation' : _reflection.GeneratedProtocolMessageType('Translation', (_message.Message,), { - 'DESCRIPTOR' : _TRANSLATEDSTRING_TRANSLATION, - '__module__' : 'gtfs_realtime_pb2' - # @@protoc_insertion_point(class_scope:transit_realtime.TranslatedString.Translation) - }) - , - 'DESCRIPTOR' : _TRANSLATEDSTRING, - '__module__' : 'gtfs_realtime_pb2' - # @@protoc_insertion_point(class_scope:transit_realtime.TranslatedString) - }) -_sym_db.RegisterMessage(TranslatedString) -_sym_db.RegisterMessage(TranslatedString.Translation) - - -DESCRIPTOR._options = None +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13gtfs-realtime.proto\x12\x10transit_realtime\"q\n\x0b\x46\x65\x65\x64Message\x12,\n\x06header\x18\x01 \x02(\x0b\x32\x1c.transit_realtime.FeedHeader\x12,\n\x06\x65ntity\x18\x02 \x03(\x0b\x32\x1c.transit_realtime.FeedEntity*\x06\x08\xe8\x07\x10\xd0\x0f\"\xcf\x01\n\nFeedHeader\x12\x1d\n\x15gtfs_realtime_version\x18\x01 \x02(\t\x12Q\n\x0eincrementality\x18\x02 \x01(\x0e\x32+.transit_realtime.FeedHeader.Incrementality:\x0c\x46ULL_DATASET\x12\x11\n\ttimestamp\x18\x03 \x01(\x04\"4\n\x0eIncrementality\x12\x10\n\x0c\x46ULL_DATASET\x10\x00\x12\x10\n\x0c\x44IFFERENTIAL\x10\x01*\x06\x08\xe8\x07\x10\xd0\x0f\"\xca\x01\n\nFeedEntity\x12\n\n\x02id\x18\x01 \x02(\t\x12\x19\n\nis_deleted\x18\x02 \x01(\x08:\x05\x66\x61lse\x12\x31\n\x0btrip_update\x18\x03 \x01(\x0b\x32\x1c.transit_realtime.TripUpdate\x12\x32\n\x07vehicle\x18\x04 \x01(\x0b\x32!.transit_realtime.VehiclePosition\x12&\n\x05\x61lert\x18\x05 \x01(\x0b\x32\x17.transit_realtime.Alert*\x06\x08\xe8\x07\x10\xd0\x0f\"\x9a\x05\n\nTripUpdate\x12.\n\x04trip\x18\x01 \x02(\x0b\x32 .transit_realtime.TripDescriptor\x12\x34\n\x07vehicle\x18\x03 \x01(\x0b\x32#.transit_realtime.VehicleDescriptor\x12\x45\n\x10stop_time_update\x18\x02 \x03(\x0b\x32+.transit_realtime.TripUpdate.StopTimeUpdate\x12\x11\n\ttimestamp\x18\x04 \x01(\x04\x12\r\n\x05\x64\x65lay\x18\x05 \x01(\x05\x1aI\n\rStopTimeEvent\x12\r\n\x05\x64\x65lay\x18\x01 \x01(\x05\x12\x0c\n\x04time\x18\x02 \x01(\x03\x12\x13\n\x0buncertainty\x18\x03 \x01(\x05*\x06\x08\xe8\x07\x10\xd0\x0f\x1a\xe9\x02\n\x0eStopTimeUpdate\x12\x15\n\rstop_sequence\x18\x01 \x01(\r\x12\x0f\n\x07stop_id\x18\x04 \x01(\t\x12;\n\x07\x61rrival\x18\x02 \x01(\x0b\x32*.transit_realtime.TripUpdate.StopTimeEvent\x12=\n\tdeparture\x18\x03 \x01(\x0b\x32*.transit_realtime.TripUpdate.StopTimeEvent\x12j\n\x15schedule_relationship\x18\x05 \x01(\x0e\x32@.transit_realtime.TripUpdate.StopTimeUpdate.ScheduleRelationship:\tSCHEDULED\"?\n\x14ScheduleRelationship\x12\r\n\tSCHEDULED\x10\x00\x12\x0b\n\x07SKIPPED\x10\x01\x12\x0b\n\x07NO_DATA\x10\x02*\x06\x08\xe8\x07\x10\xd0\x0f*\x06\x08\xe8\x07\x10\xd0\x0f\"\xe0\x06\n\x0fVehiclePosition\x12.\n\x04trip\x18\x01 \x01(\x0b\x32 .transit_realtime.TripDescriptor\x12\x34\n\x07vehicle\x18\x08 \x01(\x0b\x32#.transit_realtime.VehicleDescriptor\x12,\n\x08position\x18\x02 \x01(\x0b\x32\x1a.transit_realtime.Position\x12\x1d\n\x15\x63urrent_stop_sequence\x18\x03 \x01(\r\x12\x0f\n\x07stop_id\x18\x07 \x01(\t\x12Z\n\x0e\x63urrent_status\x18\x04 \x01(\x0e\x32\x33.transit_realtime.VehiclePosition.VehicleStopStatus:\rIN_TRANSIT_TO\x12\x11\n\ttimestamp\x18\x05 \x01(\x04\x12K\n\x10\x63ongestion_level\x18\x06 \x01(\x0e\x32\x31.transit_realtime.VehiclePosition.CongestionLevel\x12K\n\x10occupancy_status\x18\t \x01(\x0e\x32\x31.transit_realtime.VehiclePosition.OccupancyStatus\"G\n\x11VehicleStopStatus\x12\x0f\n\x0bINCOMING_AT\x10\x00\x12\x0e\n\nSTOPPED_AT\x10\x01\x12\x11\n\rIN_TRANSIT_TO\x10\x02\"}\n\x0f\x43ongestionLevel\x12\x1c\n\x18UNKNOWN_CONGESTION_LEVEL\x10\x00\x12\x14\n\x10RUNNING_SMOOTHLY\x10\x01\x12\x0f\n\x0bSTOP_AND_GO\x10\x02\x12\x0e\n\nCONGESTION\x10\x03\x12\x15\n\x11SEVERE_CONGESTION\x10\x04\"\xaf\x01\n\x0fOccupancyStatus\x12\t\n\x05\x45MPTY\x10\x00\x12\x18\n\x14MANY_SEATS_AVAILABLE\x10\x01\x12\x17\n\x13\x46\x45W_SEATS_AVAILABLE\x10\x02\x12\x16\n\x12STANDING_ROOM_ONLY\x10\x03\x12\x1e\n\x1a\x43RUSHED_STANDING_ROOM_ONLY\x10\x04\x12\x08\n\x04\x46ULL\x10\x05\x12\x1c\n\x18NOT_ACCEPTING_PASSENGERS\x10\x06*\x06\x08\xe8\x07\x10\xd0\x0f\"\xb6\x06\n\x05\x41lert\x12\x32\n\ractive_period\x18\x01 \x03(\x0b\x32\x1b.transit_realtime.TimeRange\x12\x39\n\x0finformed_entity\x18\x05 \x03(\x0b\x32 .transit_realtime.EntitySelector\x12;\n\x05\x63\x61use\x18\x06 \x01(\x0e\x32\x1d.transit_realtime.Alert.Cause:\rUNKNOWN_CAUSE\x12>\n\x06\x65\x66\x66\x65\x63t\x18\x07 \x01(\x0e\x32\x1e.transit_realtime.Alert.Effect:\x0eUNKNOWN_EFFECT\x12/\n\x03url\x18\x08 \x01(\x0b\x32\".transit_realtime.TranslatedString\x12\x37\n\x0bheader_text\x18\n \x01(\x0b\x32\".transit_realtime.TranslatedString\x12<\n\x10\x64\x65scription_text\x18\x0b \x01(\x0b\x32\".transit_realtime.TranslatedString\"\xd8\x01\n\x05\x43\x61use\x12\x11\n\rUNKNOWN_CAUSE\x10\x01\x12\x0f\n\x0bOTHER_CAUSE\x10\x02\x12\x15\n\x11TECHNICAL_PROBLEM\x10\x03\x12\n\n\x06STRIKE\x10\x04\x12\x11\n\rDEMONSTRATION\x10\x05\x12\x0c\n\x08\x41\x43\x43IDENT\x10\x06\x12\x0b\n\x07HOLIDAY\x10\x07\x12\x0b\n\x07WEATHER\x10\x08\x12\x0f\n\x0bMAINTENANCE\x10\t\x12\x10\n\x0c\x43ONSTRUCTION\x10\n\x12\x13\n\x0fPOLICE_ACTIVITY\x10\x0b\x12\x15\n\x11MEDICAL_EMERGENCY\x10\x0c\"\xb5\x01\n\x06\x45\x66\x66\x65\x63t\x12\x0e\n\nNO_SERVICE\x10\x01\x12\x13\n\x0fREDUCED_SERVICE\x10\x02\x12\x16\n\x12SIGNIFICANT_DELAYS\x10\x03\x12\n\n\x06\x44\x45TOUR\x10\x04\x12\x16\n\x12\x41\x44\x44ITIONAL_SERVICE\x10\x05\x12\x14\n\x10MODIFIED_SERVICE\x10\x06\x12\x10\n\x0cOTHER_EFFECT\x10\x07\x12\x12\n\x0eUNKNOWN_EFFECT\x10\x08\x12\x0e\n\nSTOP_MOVED\x10\t*\x06\x08\xe8\x07\x10\xd0\x0f\"/\n\tTimeRange\x12\r\n\x05start\x18\x01 \x01(\x04\x12\x0b\n\x03\x65nd\x18\x02 \x01(\x04*\x06\x08\xe8\x07\x10\xd0\x0f\"i\n\x08Position\x12\x10\n\x08latitude\x18\x01 \x02(\x02\x12\x11\n\tlongitude\x18\x02 \x02(\x02\x12\x0f\n\x07\x62\x65\x61ring\x18\x03 \x01(\x02\x12\x10\n\x08odometer\x18\x04 \x01(\x01\x12\r\n\x05speed\x18\x05 \x01(\x02*\x06\x08\xe8\x07\x10\xd0\x0f\"\xa0\x02\n\x0eTripDescriptor\x12\x0f\n\x07trip_id\x18\x01 \x01(\t\x12\x10\n\x08route_id\x18\x05 \x01(\t\x12\x14\n\x0c\x64irection_id\x18\x06 \x01(\r\x12\x12\n\nstart_time\x18\x02 \x01(\t\x12\x12\n\nstart_date\x18\x03 \x01(\t\x12T\n\x15schedule_relationship\x18\x04 \x01(\x0e\x32\x35.transit_realtime.TripDescriptor.ScheduleRelationship\"O\n\x14ScheduleRelationship\x12\r\n\tSCHEDULED\x10\x00\x12\t\n\x05\x41\x44\x44\x45\x44\x10\x01\x12\x0f\n\x0bUNSCHEDULED\x10\x02\x12\x0c\n\x08\x43\x41NCELED\x10\x03*\x06\x08\xe8\x07\x10\xd0\x0f\"M\n\x11VehicleDescriptor\x12\n\n\x02id\x18\x01 \x01(\t\x12\r\n\x05label\x18\x02 \x01(\t\x12\x15\n\rlicense_plate\x18\x03 \x01(\t*\x06\x08\xe8\x07\x10\xd0\x0f\"\x92\x01\n\x0e\x45ntitySelector\x12\x11\n\tagency_id\x18\x01 \x01(\t\x12\x10\n\x08route_id\x18\x02 \x01(\t\x12\x12\n\nroute_type\x18\x03 \x01(\x05\x12.\n\x04trip\x18\x04 \x01(\x0b\x32 .transit_realtime.TripDescriptor\x12\x0f\n\x07stop_id\x18\x05 \x01(\t*\x06\x08\xe8\x07\x10\xd0\x0f\"\x96\x01\n\x10TranslatedString\x12\x43\n\x0btranslation\x18\x01 \x03(\x0b\x32..transit_realtime.TranslatedString.Translation\x1a\x35\n\x0bTranslation\x12\x0c\n\x04text\x18\x01 \x02(\t\x12\x10\n\x08language\x18\x02 \x01(\t*\x06\x08\xe8\x07\x10\xd0\x0f*\x06\x08\xe8\x07\x10\xd0\x0f\x42\x1d\n\x1b\x63om.google.transit.realtime') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'gtfs_realtime_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\033com.google.transit.realtime' + _FEEDMESSAGE._serialized_start=41 + _FEEDMESSAGE._serialized_end=154 + _FEEDHEADER._serialized_start=157 + _FEEDHEADER._serialized_end=364 + _FEEDHEADER_INCREMENTALITY._serialized_start=304 + _FEEDHEADER_INCREMENTALITY._serialized_end=356 + _FEEDENTITY._serialized_start=367 + _FEEDENTITY._serialized_end=569 + _TRIPUPDATE._serialized_start=572 + _TRIPUPDATE._serialized_end=1238 + _TRIPUPDATE_STOPTIMEEVENT._serialized_start=793 + _TRIPUPDATE_STOPTIMEEVENT._serialized_end=866 + _TRIPUPDATE_STOPTIMEUPDATE._serialized_start=869 + _TRIPUPDATE_STOPTIMEUPDATE._serialized_end=1230 + _TRIPUPDATE_STOPTIMEUPDATE_SCHEDULERELATIONSHIP._serialized_start=1159 + _TRIPUPDATE_STOPTIMEUPDATE_SCHEDULERELATIONSHIP._serialized_end=1222 + _VEHICLEPOSITION._serialized_start=1241 + _VEHICLEPOSITION._serialized_end=2105 + _VEHICLEPOSITION_VEHICLESTOPSTATUS._serialized_start=1721 + _VEHICLEPOSITION_VEHICLESTOPSTATUS._serialized_end=1792 + _VEHICLEPOSITION_CONGESTIONLEVEL._serialized_start=1794 + _VEHICLEPOSITION_CONGESTIONLEVEL._serialized_end=1919 + _VEHICLEPOSITION_OCCUPANCYSTATUS._serialized_start=1922 + _VEHICLEPOSITION_OCCUPANCYSTATUS._serialized_end=2097 + _ALERT._serialized_start=2108 + _ALERT._serialized_end=2930 + _ALERT_CAUSE._serialized_start=2522 + _ALERT_CAUSE._serialized_end=2738 + _ALERT_EFFECT._serialized_start=2741 + _ALERT_EFFECT._serialized_end=2922 + _TIMERANGE._serialized_start=2932 + _TIMERANGE._serialized_end=2979 + _POSITION._serialized_start=2981 + _POSITION._serialized_end=3086 + _TRIPDESCRIPTOR._serialized_start=3089 + _TRIPDESCRIPTOR._serialized_end=3377 + _TRIPDESCRIPTOR_SCHEDULERELATIONSHIP._serialized_start=3290 + _TRIPDESCRIPTOR_SCHEDULERELATIONSHIP._serialized_end=3369 + _VEHICLEDESCRIPTOR._serialized_start=3379 + _VEHICLEDESCRIPTOR._serialized_end=3456 + _ENTITYSELECTOR._serialized_start=3459 + _ENTITYSELECTOR._serialized_end=3605 + _TRANSLATEDSTRING._serialized_start=3608 + _TRANSLATEDSTRING._serialized_end=3758 + _TRANSLATEDSTRING_TRANSLATION._serialized_start=3697 + _TRANSLATEDSTRING_TRANSLATION._serialized_end=3750 # @@protoc_insertion_point(module_scope) diff --git a/mtaproto/gtfs_realtime_pb2.pyi b/mtaproto/gtfs_realtime_pb2.pyi new file mode 100644 index 0000000..3f68086 --- /dev/null +++ b/mtaproto/gtfs_realtime_pb2.pyi @@ -0,0 +1,1036 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Protocol definition file for GTFS Realtime. + +GTFS Realtime lets transit agencies provide consumers with realtime +information about disruptions to their service (stations closed, lines not +operating, important delays etc), location of their vehicles and expected +arrival times. + +This protocol is published at: +https://github.com/google/transit/tree/master/gtfs-realtime +""" +import builtins +import collections.abc +import google.protobuf.descriptor +import google.protobuf.internal.containers +import google.protobuf.internal.enum_type_wrapper +import google.protobuf.message +import sys +import typing + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +@typing_extensions.final +class FeedMessage(google.protobuf.message.Message): + """The contents of a feed message. + A feed is a continuous stream of feed messages. Each message in the stream is + obtained as a response to an appropriate HTTP GET request. + A realtime feed is always defined with relation to an existing GTFS feed. + All the entity ids are resolved with respect to the GTFS feed. + Note that "required" and "optional" as stated in this file refer to Protocol + Buffer cardinality, not semantic cardinality. See reference.md at + https://github.com/google/transit/tree/master/gtfs-realtime for field + semantic cardinality. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + HEADER_FIELD_NUMBER: builtins.int + ENTITY_FIELD_NUMBER: builtins.int + @property + def header(self) -> global___FeedHeader: + """Metadata about this feed and feed message.""" + @property + def entity(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___FeedEntity]: + """Contents of the feed.""" + def __init__( + self, + *, + header: global___FeedHeader | None = ..., + entity: collections.abc.Iterable[global___FeedEntity] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["header", b"header"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["entity", b"entity", "header", b"header"]) -> None: ... + +global___FeedMessage = FeedMessage + +@typing_extensions.final +class FeedHeader(google.protobuf.message.Message): + """Metadata about a feed, included in feed messages.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + class _Incrementality: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + + class _IncrementalityEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FeedHeader._Incrementality.ValueType], builtins.type): # noqa: F821 + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + FULL_DATASET: FeedHeader._Incrementality.ValueType # 0 + DIFFERENTIAL: FeedHeader._Incrementality.ValueType # 1 + + class Incrementality(_Incrementality, metaclass=_IncrementalityEnumTypeWrapper): + """Determines whether the current fetch is incremental. Currently, + DIFFERENTIAL mode is unsupported and behavior is unspecified for feeds + that use this mode. There are discussions on the GTFS Realtime mailing + list around fully specifying the behavior of DIFFERENTIAL mode and the + documentation will be updated when those discussions are finalized. + """ + + FULL_DATASET: FeedHeader.Incrementality.ValueType # 0 + DIFFERENTIAL: FeedHeader.Incrementality.ValueType # 1 + + GTFS_REALTIME_VERSION_FIELD_NUMBER: builtins.int + INCREMENTALITY_FIELD_NUMBER: builtins.int + TIMESTAMP_FIELD_NUMBER: builtins.int + gtfs_realtime_version: builtins.str + """Version of the feed specification. + The current version is 2.0. + """ + incrementality: global___FeedHeader.Incrementality.ValueType + timestamp: builtins.int + """This timestamp identifies the moment when the content of this feed has been + created (in server time). In POSIX time (i.e., number of seconds since + January 1st 1970 00:00:00 UTC). + """ + def __init__( + self, + *, + gtfs_realtime_version: builtins.str | None = ..., + incrementality: global___FeedHeader.Incrementality.ValueType | None = ..., + timestamp: builtins.int | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["gtfs_realtime_version", b"gtfs_realtime_version", "incrementality", b"incrementality", "timestamp", b"timestamp"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["gtfs_realtime_version", b"gtfs_realtime_version", "incrementality", b"incrementality", "timestamp", b"timestamp"]) -> None: ... + +global___FeedHeader = FeedHeader + +@typing_extensions.final +class FeedEntity(google.protobuf.message.Message): + """A definition (or update) of an entity in the transit feed.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ID_FIELD_NUMBER: builtins.int + IS_DELETED_FIELD_NUMBER: builtins.int + TRIP_UPDATE_FIELD_NUMBER: builtins.int + VEHICLE_FIELD_NUMBER: builtins.int + ALERT_FIELD_NUMBER: builtins.int + id: builtins.str + """The ids are used only to provide incrementality support. The id should be + unique within a FeedMessage. Consequent FeedMessages may contain + FeedEntities with the same id. In case of a DIFFERENTIAL update the new + FeedEntity with some id will replace the old FeedEntity with the same id + (or delete it - see is_deleted below). + The actual GTFS entities (e.g. stations, routes, trips) referenced by the + feed must be specified by explicit selectors (see EntitySelector below for + more info). + """ + is_deleted: builtins.bool + """Whether this entity is to be deleted. Relevant only for incremental + fetches. + """ + @property + def trip_update(self) -> global___TripUpdate: + """Data about the entity itself. Exactly one of the following fields must be + present (unless the entity is being deleted). + """ + @property + def vehicle(self) -> global___VehiclePosition: ... + @property + def alert(self) -> global___Alert: ... + def __init__( + self, + *, + id: builtins.str | None = ..., + is_deleted: builtins.bool | None = ..., + trip_update: global___TripUpdate | None = ..., + vehicle: global___VehiclePosition | None = ..., + alert: global___Alert | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["alert", b"alert", "id", b"id", "is_deleted", b"is_deleted", "trip_update", b"trip_update", "vehicle", b"vehicle"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["alert", b"alert", "id", b"id", "is_deleted", b"is_deleted", "trip_update", b"trip_update", "vehicle", b"vehicle"]) -> None: ... + +global___FeedEntity = FeedEntity + +@typing_extensions.final +class TripUpdate(google.protobuf.message.Message): + """ + Entities used in the feed. + + Realtime update of the progress of a vehicle along a trip. + Depending on the value of ScheduleRelationship, a TripUpdate can specify: + - A trip that proceeds along the schedule. + - A trip that proceeds along a route but has no fixed schedule. + - A trip that have been added or removed with regard to schedule. + + The updates can be for future, predicted arrival/departure events, or for + past events that already occurred. + Normally, updates should get more precise and more certain (see + uncertainty below) as the events gets closer to current time. + Even if that is not possible, the information for past events should be + precise and certain. In particular, if an update points to time in the past + but its update's uncertainty is not 0, the client should conclude that the + update is a (wrong) prediction and that the trip has not completed yet. + + Note that the update can describe a trip that is already completed. + To this end, it is enough to provide an update for the last stop of the trip. + If the time of that is in the past, the client will conclude from that that + the whole trip is in the past (it is possible, although inconsequential, to + also provide updates for preceding stops). + This option is most relevant for a trip that has completed ahead of schedule, + but according to the schedule, the trip is still proceeding at the current + time. Removing the updates for this trip could make the client assume + that the trip is still proceeding. + Note that the feed provider is allowed, but not required, to purge past + updates - this is one case where this would be practically useful. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + @typing_extensions.final + class StopTimeEvent(google.protobuf.message.Message): + """Timing information for a single predicted event (either arrival or + departure). + Timing consists of delay and/or estimated time, and uncertainty. + - delay should be used when the prediction is given relative to some + existing schedule in GTFS. + - time should be given whether there is a predicted schedule or not. If + both time and delay are specified, time will take precedence + (although normally, time, if given for a scheduled trip, should be + equal to scheduled time in GTFS + delay). + + Uncertainty applies equally to both time and delay. + The uncertainty roughly specifies the expected error in true delay (but + note, we don't yet define its precise statistical meaning). It's possible + for the uncertainty to be 0, for example for trains that are driven under + computer timing control. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + DELAY_FIELD_NUMBER: builtins.int + TIME_FIELD_NUMBER: builtins.int + UNCERTAINTY_FIELD_NUMBER: builtins.int + delay: builtins.int + """Delay (in seconds) can be positive (meaning that the vehicle is late) or + negative (meaning that the vehicle is ahead of schedule). Delay of 0 + means that the vehicle is exactly on time. + """ + time: builtins.int + """Event as absolute time. + In Unix time (i.e., number of seconds since January 1st 1970 00:00:00 + UTC). + """ + uncertainty: builtins.int + """If uncertainty is omitted, it is interpreted as unknown. + If the prediction is unknown or too uncertain, the delay (or time) field + should be empty. In such case, the uncertainty field is ignored. + To specify a completely certain prediction, set its uncertainty to 0. + """ + def __init__( + self, + *, + delay: builtins.int | None = ..., + time: builtins.int | None = ..., + uncertainty: builtins.int | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["delay", b"delay", "time", b"time", "uncertainty", b"uncertainty"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["delay", b"delay", "time", b"time", "uncertainty", b"uncertainty"]) -> None: ... + + @typing_extensions.final + class StopTimeUpdate(google.protobuf.message.Message): + """Realtime update for arrival and/or departure events for a given stop on a + trip. Updates can be supplied for both past and future events. + The producer is allowed, although not required, to drop past events. + The update is linked to a specific stop either through stop_sequence or + stop_id, so one of the fields below must necessarily be set. + See the documentation in TripDescriptor for more information. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + class _ScheduleRelationship: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + + class _ScheduleRelationshipEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[TripUpdate.StopTimeUpdate._ScheduleRelationship.ValueType], builtins.type): # noqa: F821 + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + SCHEDULED: TripUpdate.StopTimeUpdate._ScheduleRelationship.ValueType # 0 + """The vehicle is proceeding in accordance with its static schedule of + stops, although not necessarily according to the times of the schedule. + At least one of arrival and departure must be provided. If the schedule + for this stop contains both arrival and departure times then so must + this update. + """ + SKIPPED: TripUpdate.StopTimeUpdate._ScheduleRelationship.ValueType # 1 + """The stop is skipped, i.e., the vehicle will not stop at this stop. + Arrival and departure are optional. + """ + NO_DATA: TripUpdate.StopTimeUpdate._ScheduleRelationship.ValueType # 2 + """No data is given for this stop. The main intention for this value is to + give the predictions only for part of a trip, i.e., if the last update + for a trip has a NO_DATA specifier, then StopTimes for the rest of the + stops in the trip are considered to be unspecified as well. + Neither arrival nor departure should be supplied. + """ + + class ScheduleRelationship(_ScheduleRelationship, metaclass=_ScheduleRelationshipEnumTypeWrapper): + """The relation between this StopTime and the static schedule.""" + + SCHEDULED: TripUpdate.StopTimeUpdate.ScheduleRelationship.ValueType # 0 + """The vehicle is proceeding in accordance with its static schedule of + stops, although not necessarily according to the times of the schedule. + At least one of arrival and departure must be provided. If the schedule + for this stop contains both arrival and departure times then so must + this update. + """ + SKIPPED: TripUpdate.StopTimeUpdate.ScheduleRelationship.ValueType # 1 + """The stop is skipped, i.e., the vehicle will not stop at this stop. + Arrival and departure are optional. + """ + NO_DATA: TripUpdate.StopTimeUpdate.ScheduleRelationship.ValueType # 2 + """No data is given for this stop. The main intention for this value is to + give the predictions only for part of a trip, i.e., if the last update + for a trip has a NO_DATA specifier, then StopTimes for the rest of the + stops in the trip are considered to be unspecified as well. + Neither arrival nor departure should be supplied. + """ + + STOP_SEQUENCE_FIELD_NUMBER: builtins.int + STOP_ID_FIELD_NUMBER: builtins.int + ARRIVAL_FIELD_NUMBER: builtins.int + DEPARTURE_FIELD_NUMBER: builtins.int + SCHEDULE_RELATIONSHIP_FIELD_NUMBER: builtins.int + stop_sequence: builtins.int + """Must be the same as in stop_times.txt in the corresponding GTFS feed.""" + stop_id: builtins.str + """Must be the same as in stops.txt in the corresponding GTFS feed.""" + @property + def arrival(self) -> global___TripUpdate.StopTimeEvent: ... + @property + def departure(self) -> global___TripUpdate.StopTimeEvent: ... + schedule_relationship: global___TripUpdate.StopTimeUpdate.ScheduleRelationship.ValueType + def __init__( + self, + *, + stop_sequence: builtins.int | None = ..., + stop_id: builtins.str | None = ..., + arrival: global___TripUpdate.StopTimeEvent | None = ..., + departure: global___TripUpdate.StopTimeEvent | None = ..., + schedule_relationship: global___TripUpdate.StopTimeUpdate.ScheduleRelationship.ValueType | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["arrival", b"arrival", "departure", b"departure", "schedule_relationship", b"schedule_relationship", "stop_id", b"stop_id", "stop_sequence", b"stop_sequence"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["arrival", b"arrival", "departure", b"departure", "schedule_relationship", b"schedule_relationship", "stop_id", b"stop_id", "stop_sequence", b"stop_sequence"]) -> None: ... + + TRIP_FIELD_NUMBER: builtins.int + VEHICLE_FIELD_NUMBER: builtins.int + STOP_TIME_UPDATE_FIELD_NUMBER: builtins.int + TIMESTAMP_FIELD_NUMBER: builtins.int + DELAY_FIELD_NUMBER: builtins.int + @property + def trip(self) -> global___TripDescriptor: + """The Trip that this message applies to. There can be at most one + TripUpdate entity for each actual trip instance. + If there is none, that means there is no prediction information available. + It does *not* mean that the trip is progressing according to schedule. + """ + @property + def vehicle(self) -> global___VehicleDescriptor: + """Additional information on the vehicle that is serving this trip.""" + @property + def stop_time_update(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___TripUpdate.StopTimeUpdate]: + """Updates to StopTimes for the trip (both future, i.e., predictions, and in + some cases, past ones, i.e., those that already happened). + The updates must be sorted by stop_sequence, and apply for all the + following stops of the trip up to the next specified one. + + Example 1: + For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure + delay of 0 for stop_sequence of the current stop means that the trip is + exactly on time. + + Example 2: + For the same trip instance, 3 StopTimeUpdates are provided: + - delay of 5 min for stop_sequence 3 + - delay of 1 min for stop_sequence 8 + - delay of unspecified duration for stop_sequence 10 + This will be interpreted as: + - stop_sequences 3,4,5,6,7 have delay of 5 min. + - stop_sequences 8,9 have delay of 1 min. + - stop_sequences 10,... have unknown delay. + """ + timestamp: builtins.int + """Moment at which the vehicle's real-time progress was measured. In POSIX + time (i.e., the number of seconds since January 1st 1970 00:00:00 UTC). + """ + delay: builtins.int + """The current schedule deviation for the trip. Delay should only be + specified when the prediction is given relative to some existing schedule + in GTFS. + + Delay (in seconds) can be positive (meaning that the vehicle is late) or + negative (meaning that the vehicle is ahead of schedule). Delay of 0 + means that the vehicle is exactly on time. + + Delay information in StopTimeUpdates take precedent of trip-level delay + information, such that trip-level delay is only propagated until the next + stop along the trip with a StopTimeUpdate delay value specified. + + Feed providers are strongly encouraged to provide a TripUpdate.timestamp + value indicating when the delay value was last updated, in order to + evaluate the freshness of the data. + + NOTE: This field is still experimental, and subject to change. It may be + formally adopted in the future. + """ + def __init__( + self, + *, + trip: global___TripDescriptor | None = ..., + vehicle: global___VehicleDescriptor | None = ..., + stop_time_update: collections.abc.Iterable[global___TripUpdate.StopTimeUpdate] | None = ..., + timestamp: builtins.int | None = ..., + delay: builtins.int | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["delay", b"delay", "timestamp", b"timestamp", "trip", b"trip", "vehicle", b"vehicle"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["delay", b"delay", "stop_time_update", b"stop_time_update", "timestamp", b"timestamp", "trip", b"trip", "vehicle", b"vehicle"]) -> None: ... + +global___TripUpdate = TripUpdate + +@typing_extensions.final +class VehiclePosition(google.protobuf.message.Message): + """Realtime positioning information for a given vehicle.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + class _VehicleStopStatus: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + + class _VehicleStopStatusEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[VehiclePosition._VehicleStopStatus.ValueType], builtins.type): # noqa: F821 + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + INCOMING_AT: VehiclePosition._VehicleStopStatus.ValueType # 0 + """The vehicle is just about to arrive at the stop (on a stop + display, the vehicle symbol typically flashes). + """ + STOPPED_AT: VehiclePosition._VehicleStopStatus.ValueType # 1 + """The vehicle is standing at the stop.""" + IN_TRANSIT_TO: VehiclePosition._VehicleStopStatus.ValueType # 2 + """The vehicle has departed and is in transit to the next stop.""" + + class VehicleStopStatus(_VehicleStopStatus, metaclass=_VehicleStopStatusEnumTypeWrapper): ... + INCOMING_AT: VehiclePosition.VehicleStopStatus.ValueType # 0 + """The vehicle is just about to arrive at the stop (on a stop + display, the vehicle symbol typically flashes). + """ + STOPPED_AT: VehiclePosition.VehicleStopStatus.ValueType # 1 + """The vehicle is standing at the stop.""" + IN_TRANSIT_TO: VehiclePosition.VehicleStopStatus.ValueType # 2 + """The vehicle has departed and is in transit to the next stop.""" + + class _CongestionLevel: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + + class _CongestionLevelEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[VehiclePosition._CongestionLevel.ValueType], builtins.type): # noqa: F821 + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + UNKNOWN_CONGESTION_LEVEL: VehiclePosition._CongestionLevel.ValueType # 0 + RUNNING_SMOOTHLY: VehiclePosition._CongestionLevel.ValueType # 1 + STOP_AND_GO: VehiclePosition._CongestionLevel.ValueType # 2 + CONGESTION: VehiclePosition._CongestionLevel.ValueType # 3 + SEVERE_CONGESTION: VehiclePosition._CongestionLevel.ValueType # 4 + """People leaving their cars.""" + + class CongestionLevel(_CongestionLevel, metaclass=_CongestionLevelEnumTypeWrapper): + """Congestion level that is affecting this vehicle.""" + + UNKNOWN_CONGESTION_LEVEL: VehiclePosition.CongestionLevel.ValueType # 0 + RUNNING_SMOOTHLY: VehiclePosition.CongestionLevel.ValueType # 1 + STOP_AND_GO: VehiclePosition.CongestionLevel.ValueType # 2 + CONGESTION: VehiclePosition.CongestionLevel.ValueType # 3 + SEVERE_CONGESTION: VehiclePosition.CongestionLevel.ValueType # 4 + """People leaving their cars.""" + + class _OccupancyStatus: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + + class _OccupancyStatusEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[VehiclePosition._OccupancyStatus.ValueType], builtins.type): # noqa: F821 + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + EMPTY: VehiclePosition._OccupancyStatus.ValueType # 0 + """The vehicle is considered empty by most measures, and has few or no + passengers onboard, but is still accepting passengers. + """ + MANY_SEATS_AVAILABLE: VehiclePosition._OccupancyStatus.ValueType # 1 + """The vehicle has a relatively large percentage of seats available. + What percentage of free seats out of the total seats available is to be + considered large enough to fall into this category is determined at the + discretion of the producer. + """ + FEW_SEATS_AVAILABLE: VehiclePosition._OccupancyStatus.ValueType # 2 + """The vehicle has a relatively small percentage of seats available. + What percentage of free seats out of the total seats available is to be + considered small enough to fall into this category is determined at the + discretion of the feed producer. + """ + STANDING_ROOM_ONLY: VehiclePosition._OccupancyStatus.ValueType # 3 + """The vehicle can currently accommodate only standing passengers.""" + CRUSHED_STANDING_ROOM_ONLY: VehiclePosition._OccupancyStatus.ValueType # 4 + """The vehicle can currently accommodate only standing passengers + and has limited space for them. + """ + FULL: VehiclePosition._OccupancyStatus.ValueType # 5 + """The vehicle is considered full by most measures, but may still be + allowing passengers to board. + """ + NOT_ACCEPTING_PASSENGERS: VehiclePosition._OccupancyStatus.ValueType # 6 + """The vehicle is not accepting additional passengers.""" + + class OccupancyStatus(_OccupancyStatus, metaclass=_OccupancyStatusEnumTypeWrapper): + """The degree of passenger occupancy of the vehicle. This field is still + experimental, and subject to change. It may be formally adopted in the + future. + """ + + EMPTY: VehiclePosition.OccupancyStatus.ValueType # 0 + """The vehicle is considered empty by most measures, and has few or no + passengers onboard, but is still accepting passengers. + """ + MANY_SEATS_AVAILABLE: VehiclePosition.OccupancyStatus.ValueType # 1 + """The vehicle has a relatively large percentage of seats available. + What percentage of free seats out of the total seats available is to be + considered large enough to fall into this category is determined at the + discretion of the producer. + """ + FEW_SEATS_AVAILABLE: VehiclePosition.OccupancyStatus.ValueType # 2 + """The vehicle has a relatively small percentage of seats available. + What percentage of free seats out of the total seats available is to be + considered small enough to fall into this category is determined at the + discretion of the feed producer. + """ + STANDING_ROOM_ONLY: VehiclePosition.OccupancyStatus.ValueType # 3 + """The vehicle can currently accommodate only standing passengers.""" + CRUSHED_STANDING_ROOM_ONLY: VehiclePosition.OccupancyStatus.ValueType # 4 + """The vehicle can currently accommodate only standing passengers + and has limited space for them. + """ + FULL: VehiclePosition.OccupancyStatus.ValueType # 5 + """The vehicle is considered full by most measures, but may still be + allowing passengers to board. + """ + NOT_ACCEPTING_PASSENGERS: VehiclePosition.OccupancyStatus.ValueType # 6 + """The vehicle is not accepting additional passengers.""" + + TRIP_FIELD_NUMBER: builtins.int + VEHICLE_FIELD_NUMBER: builtins.int + POSITION_FIELD_NUMBER: builtins.int + CURRENT_STOP_SEQUENCE_FIELD_NUMBER: builtins.int + STOP_ID_FIELD_NUMBER: builtins.int + CURRENT_STATUS_FIELD_NUMBER: builtins.int + TIMESTAMP_FIELD_NUMBER: builtins.int + CONGESTION_LEVEL_FIELD_NUMBER: builtins.int + OCCUPANCY_STATUS_FIELD_NUMBER: builtins.int + @property + def trip(self) -> global___TripDescriptor: + """The Trip that this vehicle is serving. + Can be empty or partial if the vehicle can not be identified with a given + trip instance. + """ + @property + def vehicle(self) -> global___VehicleDescriptor: + """Additional information on the vehicle that is serving this trip.""" + @property + def position(self) -> global___Position: + """Current position of this vehicle.""" + current_stop_sequence: builtins.int + """The stop sequence index of the current stop. The meaning of + current_stop_sequence (i.e., the stop that it refers to) is determined by + current_status. + If current_status is missing IN_TRANSIT_TO is assumed. + """ + stop_id: builtins.str + """Identifies the current stop. The value must be the same as in stops.txt in + the corresponding GTFS feed. + """ + current_status: global___VehiclePosition.VehicleStopStatus.ValueType + """The exact status of the vehicle with respect to the current stop. + Ignored if current_stop_sequence is missing. + """ + timestamp: builtins.int + """Moment at which the vehicle's position was measured. In POSIX time + (i.e., number of seconds since January 1st 1970 00:00:00 UTC). + """ + congestion_level: global___VehiclePosition.CongestionLevel.ValueType + occupancy_status: global___VehiclePosition.OccupancyStatus.ValueType + def __init__( + self, + *, + trip: global___TripDescriptor | None = ..., + vehicle: global___VehicleDescriptor | None = ..., + position: global___Position | None = ..., + current_stop_sequence: builtins.int | None = ..., + stop_id: builtins.str | None = ..., + current_status: global___VehiclePosition.VehicleStopStatus.ValueType | None = ..., + timestamp: builtins.int | None = ..., + congestion_level: global___VehiclePosition.CongestionLevel.ValueType | None = ..., + occupancy_status: global___VehiclePosition.OccupancyStatus.ValueType | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["congestion_level", b"congestion_level", "current_status", b"current_status", "current_stop_sequence", b"current_stop_sequence", "occupancy_status", b"occupancy_status", "position", b"position", "stop_id", b"stop_id", "timestamp", b"timestamp", "trip", b"trip", "vehicle", b"vehicle"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["congestion_level", b"congestion_level", "current_status", b"current_status", "current_stop_sequence", b"current_stop_sequence", "occupancy_status", b"occupancy_status", "position", b"position", "stop_id", b"stop_id", "timestamp", b"timestamp", "trip", b"trip", "vehicle", b"vehicle"]) -> None: ... + +global___VehiclePosition = VehiclePosition + +@typing_extensions.final +class Alert(google.protobuf.message.Message): + """An alert, indicating some sort of incident in the public transit network.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + class _Cause: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + + class _CauseEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Alert._Cause.ValueType], builtins.type): # noqa: F821 + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + UNKNOWN_CAUSE: Alert._Cause.ValueType # 1 + OTHER_CAUSE: Alert._Cause.ValueType # 2 + """Not machine-representable.""" + TECHNICAL_PROBLEM: Alert._Cause.ValueType # 3 + STRIKE: Alert._Cause.ValueType # 4 + """Public transit agency employees stopped working.""" + DEMONSTRATION: Alert._Cause.ValueType # 5 + """People are blocking the streets.""" + ACCIDENT: Alert._Cause.ValueType # 6 + HOLIDAY: Alert._Cause.ValueType # 7 + WEATHER: Alert._Cause.ValueType # 8 + MAINTENANCE: Alert._Cause.ValueType # 9 + CONSTRUCTION: Alert._Cause.ValueType # 10 + POLICE_ACTIVITY: Alert._Cause.ValueType # 11 + MEDICAL_EMERGENCY: Alert._Cause.ValueType # 12 + + class Cause(_Cause, metaclass=_CauseEnumTypeWrapper): + """Cause of this alert.""" + + UNKNOWN_CAUSE: Alert.Cause.ValueType # 1 + OTHER_CAUSE: Alert.Cause.ValueType # 2 + """Not machine-representable.""" + TECHNICAL_PROBLEM: Alert.Cause.ValueType # 3 + STRIKE: Alert.Cause.ValueType # 4 + """Public transit agency employees stopped working.""" + DEMONSTRATION: Alert.Cause.ValueType # 5 + """People are blocking the streets.""" + ACCIDENT: Alert.Cause.ValueType # 6 + HOLIDAY: Alert.Cause.ValueType # 7 + WEATHER: Alert.Cause.ValueType # 8 + MAINTENANCE: Alert.Cause.ValueType # 9 + CONSTRUCTION: Alert.Cause.ValueType # 10 + POLICE_ACTIVITY: Alert.Cause.ValueType # 11 + MEDICAL_EMERGENCY: Alert.Cause.ValueType # 12 + + class _Effect: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + + class _EffectEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Alert._Effect.ValueType], builtins.type): # noqa: F821 + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + NO_SERVICE: Alert._Effect.ValueType # 1 + REDUCED_SERVICE: Alert._Effect.ValueType # 2 + SIGNIFICANT_DELAYS: Alert._Effect.ValueType # 3 + """We don't care about INsignificant delays: they are hard to detect, have + little impact on the user, and would clutter the results as they are too + frequent. + """ + DETOUR: Alert._Effect.ValueType # 4 + ADDITIONAL_SERVICE: Alert._Effect.ValueType # 5 + MODIFIED_SERVICE: Alert._Effect.ValueType # 6 + OTHER_EFFECT: Alert._Effect.ValueType # 7 + UNKNOWN_EFFECT: Alert._Effect.ValueType # 8 + STOP_MOVED: Alert._Effect.ValueType # 9 + + class Effect(_Effect, metaclass=_EffectEnumTypeWrapper): + """What is the effect of this problem on the affected entity.""" + + NO_SERVICE: Alert.Effect.ValueType # 1 + REDUCED_SERVICE: Alert.Effect.ValueType # 2 + SIGNIFICANT_DELAYS: Alert.Effect.ValueType # 3 + """We don't care about INsignificant delays: they are hard to detect, have + little impact on the user, and would clutter the results as they are too + frequent. + """ + DETOUR: Alert.Effect.ValueType # 4 + ADDITIONAL_SERVICE: Alert.Effect.ValueType # 5 + MODIFIED_SERVICE: Alert.Effect.ValueType # 6 + OTHER_EFFECT: Alert.Effect.ValueType # 7 + UNKNOWN_EFFECT: Alert.Effect.ValueType # 8 + STOP_MOVED: Alert.Effect.ValueType # 9 + + ACTIVE_PERIOD_FIELD_NUMBER: builtins.int + INFORMED_ENTITY_FIELD_NUMBER: builtins.int + CAUSE_FIELD_NUMBER: builtins.int + EFFECT_FIELD_NUMBER: builtins.int + URL_FIELD_NUMBER: builtins.int + HEADER_TEXT_FIELD_NUMBER: builtins.int + DESCRIPTION_TEXT_FIELD_NUMBER: builtins.int + @property + def active_period(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___TimeRange]: + """Time when the alert should be shown to the user. If missing, the + alert will be shown as long as it appears in the feed. + If multiple ranges are given, the alert will be shown during all of them. + """ + @property + def informed_entity(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EntitySelector]: + """Entities whose users we should notify of this alert.""" + cause: global___Alert.Cause.ValueType + effect: global___Alert.Effect.ValueType + @property + def url(self) -> global___TranslatedString: + """The URL which provides additional information about the alert.""" + @property + def header_text(self) -> global___TranslatedString: + """Alert header. Contains a short summary of the alert text as plain-text.""" + @property + def description_text(self) -> global___TranslatedString: + """Full description for the alert as plain-text. The information in the + description should add to the information of the header. + """ + def __init__( + self, + *, + active_period: collections.abc.Iterable[global___TimeRange] | None = ..., + informed_entity: collections.abc.Iterable[global___EntitySelector] | None = ..., + cause: global___Alert.Cause.ValueType | None = ..., + effect: global___Alert.Effect.ValueType | None = ..., + url: global___TranslatedString | None = ..., + header_text: global___TranslatedString | None = ..., + description_text: global___TranslatedString | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["cause", b"cause", "description_text", b"description_text", "effect", b"effect", "header_text", b"header_text", "url", b"url"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["active_period", b"active_period", "cause", b"cause", "description_text", b"description_text", "effect", b"effect", "header_text", b"header_text", "informed_entity", b"informed_entity", "url", b"url"]) -> None: ... + +global___Alert = Alert + +@typing_extensions.final +class TimeRange(google.protobuf.message.Message): + """ + Low level data structures used above. + + A time interval. The interval is considered active at time 't' if 't' is + greater than or equal to the start time and less than the end time. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + START_FIELD_NUMBER: builtins.int + END_FIELD_NUMBER: builtins.int + start: builtins.int + """Start time, in POSIX time (i.e., number of seconds since January 1st 1970 + 00:00:00 UTC). + If missing, the interval starts at minus infinity. + """ + end: builtins.int + """End time, in POSIX time (i.e., number of seconds since January 1st 1970 + 00:00:00 UTC). + If missing, the interval ends at plus infinity. + """ + def __init__( + self, + *, + start: builtins.int | None = ..., + end: builtins.int | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["end", b"end", "start", b"start"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["end", b"end", "start", b"start"]) -> None: ... + +global___TimeRange = TimeRange + +@typing_extensions.final +class Position(google.protobuf.message.Message): + """A position.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + LATITUDE_FIELD_NUMBER: builtins.int + LONGITUDE_FIELD_NUMBER: builtins.int + BEARING_FIELD_NUMBER: builtins.int + ODOMETER_FIELD_NUMBER: builtins.int + SPEED_FIELD_NUMBER: builtins.int + latitude: builtins.float + """Degrees North, in the WGS-84 coordinate system.""" + longitude: builtins.float + """Degrees East, in the WGS-84 coordinate system.""" + bearing: builtins.float + """Bearing, in degrees, clockwise from North, i.e., 0 is North and 90 is East. + This can be the compass bearing, or the direction towards the next stop + or intermediate location. + This should not be direction deduced from the sequence of previous + positions, which can be computed from previous data. + """ + odometer: builtins.float + """Odometer value, in meters.""" + speed: builtins.float + """Momentary speed measured by the vehicle, in meters per second.""" + def __init__( + self, + *, + latitude: builtins.float | None = ..., + longitude: builtins.float | None = ..., + bearing: builtins.float | None = ..., + odometer: builtins.float | None = ..., + speed: builtins.float | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["bearing", b"bearing", "latitude", b"latitude", "longitude", b"longitude", "odometer", b"odometer", "speed", b"speed"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["bearing", b"bearing", "latitude", b"latitude", "longitude", b"longitude", "odometer", b"odometer", "speed", b"speed"]) -> None: ... + +global___Position = Position + +@typing_extensions.final +class TripDescriptor(google.protobuf.message.Message): + """A descriptor that identifies an instance of a GTFS trip, or all instances of + a trip along a route. + - To specify a single trip instance, the trip_id (and if necessary, + start_time) is set. If route_id is also set, then it should be same as one + that the given trip corresponds to. + - To specify all the trips along a given route, only the route_id should be + set. Note that if the trip_id is not known, then stop sequence ids in + TripUpdate are not sufficient, and stop_ids must be provided as well. In + addition, absolute arrival/departure times must be provided. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + class _ScheduleRelationship: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + + class _ScheduleRelationshipEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[TripDescriptor._ScheduleRelationship.ValueType], builtins.type): # noqa: F821 + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + SCHEDULED: TripDescriptor._ScheduleRelationship.ValueType # 0 + """Trip that is running in accordance with its GTFS schedule, or is close + enough to the scheduled trip to be associated with it. + """ + ADDED: TripDescriptor._ScheduleRelationship.ValueType # 1 + """An extra trip that was added in addition to a running schedule, for + example, to replace a broken vehicle or to respond to sudden passenger + load. + """ + UNSCHEDULED: TripDescriptor._ScheduleRelationship.ValueType # 2 + """A trip that is running with no schedule associated to it, for example, if + there is no schedule at all. + """ + CANCELED: TripDescriptor._ScheduleRelationship.ValueType # 3 + """A trip that existed in the schedule but was removed.""" + + class ScheduleRelationship(_ScheduleRelationship, metaclass=_ScheduleRelationshipEnumTypeWrapper): + """The relation between this trip and the static schedule. If a trip is done + in accordance with temporary schedule, not reflected in GTFS, then it + shouldn't be marked as SCHEDULED, but likely as ADDED. + """ + + SCHEDULED: TripDescriptor.ScheduleRelationship.ValueType # 0 + """Trip that is running in accordance with its GTFS schedule, or is close + enough to the scheduled trip to be associated with it. + """ + ADDED: TripDescriptor.ScheduleRelationship.ValueType # 1 + """An extra trip that was added in addition to a running schedule, for + example, to replace a broken vehicle or to respond to sudden passenger + load. + """ + UNSCHEDULED: TripDescriptor.ScheduleRelationship.ValueType # 2 + """A trip that is running with no schedule associated to it, for example, if + there is no schedule at all. + """ + CANCELED: TripDescriptor.ScheduleRelationship.ValueType # 3 + """A trip that existed in the schedule but was removed.""" + + TRIP_ID_FIELD_NUMBER: builtins.int + ROUTE_ID_FIELD_NUMBER: builtins.int + DIRECTION_ID_FIELD_NUMBER: builtins.int + START_TIME_FIELD_NUMBER: builtins.int + START_DATE_FIELD_NUMBER: builtins.int + SCHEDULE_RELATIONSHIP_FIELD_NUMBER: builtins.int + trip_id: builtins.str + """The trip_id from the GTFS feed that this selector refers to. + For non frequency-based trips, this field is enough to uniquely identify + the trip. For frequency-based trip, start_time and start_date might also be + necessary. + """ + route_id: builtins.str + """The route_id from the GTFS that this selector refers to.""" + direction_id: builtins.int + """The direction_id from the GTFS feed trips.txt file, indicating the + direction of travel for trips this selector refers to. This field is + still experimental, and subject to change. It may be formally adopted in + the future. + """ + start_time: builtins.str + """The initially scheduled start time of this trip instance. + When the trip_id corresponds to a non-frequency-based trip, this field + should either be omitted or be equal to the value in the GTFS feed. When + the trip_id corresponds to a frequency-based trip, the start_time must be + specified for trip updates and vehicle positions. If the trip corresponds + to exact_times=1 GTFS record, then start_time must be some multiple + (including zero) of headway_secs later than frequencies.txt start_time for + the corresponding time period. If the trip corresponds to exact_times=0, + then its start_time may be arbitrary, and is initially expected to be the + first departure of the trip. Once established, the start_time of this + frequency-based trip should be considered immutable, even if the first + departure time changes -- that time change may instead be reflected in a + StopTimeUpdate. + Format and semantics of the field is same as that of + GTFS/frequencies.txt/start_time, e.g., 11:15:35 or 25:15:35. + """ + start_date: builtins.str + """The scheduled start date of this trip instance. + Must be provided to disambiguate trips that are so late as to collide with + a scheduled trip on a next day. For example, for a train that departs 8:00 + and 20:00 every day, and is 12 hours late, there would be two distinct + trips on the same time. + This field can be provided but is not mandatory for schedules in which such + collisions are impossible - for example, a service running on hourly + schedule where a vehicle that is one hour late is not considered to be + related to schedule anymore. + In YYYYMMDD format. + """ + schedule_relationship: global___TripDescriptor.ScheduleRelationship.ValueType + def __init__( + self, + *, + trip_id: builtins.str | None = ..., + route_id: builtins.str | None = ..., + direction_id: builtins.int | None = ..., + start_time: builtins.str | None = ..., + start_date: builtins.str | None = ..., + schedule_relationship: global___TripDescriptor.ScheduleRelationship.ValueType | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["direction_id", b"direction_id", "route_id", b"route_id", "schedule_relationship", b"schedule_relationship", "start_date", b"start_date", "start_time", b"start_time", "trip_id", b"trip_id"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["direction_id", b"direction_id", "route_id", b"route_id", "schedule_relationship", b"schedule_relationship", "start_date", b"start_date", "start_time", b"start_time", "trip_id", b"trip_id"]) -> None: ... + +global___TripDescriptor = TripDescriptor + +@typing_extensions.final +class VehicleDescriptor(google.protobuf.message.Message): + """Identification information for the vehicle performing the trip.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ID_FIELD_NUMBER: builtins.int + LABEL_FIELD_NUMBER: builtins.int + LICENSE_PLATE_FIELD_NUMBER: builtins.int + id: builtins.str + """Internal system identification of the vehicle. Should be unique per + vehicle, and can be used for tracking the vehicle as it proceeds through + the system. + """ + label: builtins.str + """User visible label, i.e., something that must be shown to the passenger to + help identify the correct vehicle. + """ + license_plate: builtins.str + """The license plate of the vehicle.""" + def __init__( + self, + *, + id: builtins.str | None = ..., + label: builtins.str | None = ..., + license_plate: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["id", b"id", "label", b"label", "license_plate", b"license_plate"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["id", b"id", "label", b"label", "license_plate", b"license_plate"]) -> None: ... + +global___VehicleDescriptor = VehicleDescriptor + +@typing_extensions.final +class EntitySelector(google.protobuf.message.Message): + """A selector for an entity in a GTFS feed.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + AGENCY_ID_FIELD_NUMBER: builtins.int + ROUTE_ID_FIELD_NUMBER: builtins.int + ROUTE_TYPE_FIELD_NUMBER: builtins.int + TRIP_FIELD_NUMBER: builtins.int + STOP_ID_FIELD_NUMBER: builtins.int + agency_id: builtins.str + """The values of the fields should correspond to the appropriate fields in the + GTFS feed. + At least one specifier must be given. If several are given, then the + matching has to apply to all the given specifiers. + """ + route_id: builtins.str + route_type: builtins.int + """corresponds to route_type in GTFS.""" + @property + def trip(self) -> global___TripDescriptor: ... + stop_id: builtins.str + def __init__( + self, + *, + agency_id: builtins.str | None = ..., + route_id: builtins.str | None = ..., + route_type: builtins.int | None = ..., + trip: global___TripDescriptor | None = ..., + stop_id: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["agency_id", b"agency_id", "route_id", b"route_id", "route_type", b"route_type", "stop_id", b"stop_id", "trip", b"trip"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["agency_id", b"agency_id", "route_id", b"route_id", "route_type", b"route_type", "stop_id", b"stop_id", "trip", b"trip"]) -> None: ... + +global___EntitySelector = EntitySelector + +@typing_extensions.final +class TranslatedString(google.protobuf.message.Message): + """An internationalized message containing per-language versions of a snippet of + text or a URL. + One of the strings from a message will be picked up. The resolution proceeds + as follows: + 1. If the UI language matches the language code of a translation, + the first matching translation is picked. + 2. If a default UI language (e.g., English) matches the language code of a + translation, the first matching translation is picked. + 3. If some translation has an unspecified language code, that translation is + picked. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + @typing_extensions.final + class Translation(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + TEXT_FIELD_NUMBER: builtins.int + LANGUAGE_FIELD_NUMBER: builtins.int + text: builtins.str + """A UTF-8 string containing the message.""" + language: builtins.str + """BCP-47 language code. Can be omitted if the language is unknown or if + no i18n is done at all for the feed. At most one translation is + allowed to have an unspecified language tag. + """ + def __init__( + self, + *, + text: builtins.str | None = ..., + language: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["language", b"language", "text", b"text"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["language", b"language", "text", b"text"]) -> None: ... + + TRANSLATION_FIELD_NUMBER: builtins.int + @property + def translation(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___TranslatedString.Translation]: + """At least one translation must be provided.""" + def __init__( + self, + *, + translation: collections.abc.Iterable[global___TranslatedString.Translation] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["translation", b"translation"]) -> None: ... + +global___TranslatedString = TranslatedString diff --git a/mtaproto/nyct-subway.proto b/mtaproto/nyct-subway.proto index 2e848da..7f66d8b 100644 --- a/mtaproto/nyct-subway.proto +++ b/mtaproto/nyct-subway.proto @@ -4,7 +4,7 @@ option java_package = "com.google.transit.realtime"; import "gtfs-realtime.proto"; - + message TripReplacementPeriod { // The replacement period is for this route optional string route_id = 1; diff --git a/mtaproto/nyct_subway_pb2.py b/mtaproto/nyct_subway_pb2.py index 4fc684f..d7e7082 100644 --- a/mtaproto/nyct_subway_pb2.py +++ b/mtaproto/nyct_subway_pb2.py @@ -1,293 +1,38 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: nyct-subway.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection +from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() -import mtaproto.gtfs_realtime_pb2 as gtfs__realtime__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='nyct-subway.proto', - package='', - syntax='proto2', - serialized_options=_b('\n\033com.google.transit.realtime'), - serialized_pb=_b('\n\x11nyct-subway.proto\x1a\x13gtfs-realtime.proto\"b\n\x15TripReplacementPeriod\x12\x10\n\x08route_id\x18\x01 \x01(\t\x12\x37\n\x12replacement_period\x18\x02 \x01(\x0b\x32\x1b.transit_realtime.TimeRange\"f\n\x0eNyctFeedHeader\x12\x1b\n\x13nyct_subway_version\x18\x01 \x02(\t\x12\x37\n\x17trip_replacement_period\x18\x02 \x03(\x0b\x32\x16.TripReplacementPeriod\"\xa4\x01\n\x12NyctTripDescriptor\x12\x10\n\x08train_id\x18\x01 \x01(\t\x12\x13\n\x0bis_assigned\x18\x02 \x01(\x08\x12\x30\n\tdirection\x18\x03 \x01(\x0e\x32\x1d.NyctTripDescriptor.Direction\"5\n\tDirection\x12\t\n\x05NORTH\x10\x01\x12\x08\n\x04\x45\x41ST\x10\x02\x12\t\n\x05SOUTH\x10\x03\x12\x08\n\x04WEST\x10\x04\"C\n\x12NyctStopTimeUpdate\x12\x17\n\x0fscheduled_track\x18\x01 \x01(\t\x12\x14\n\x0c\x61\x63tual_track\x18\x02 \x01(\t:H\n\x10nyct_feed_header\x12\x1c.transit_realtime.FeedHeader\x18\xe9\x07 \x01(\x0b\x32\x0f.NyctFeedHeader:T\n\x14nyct_trip_descriptor\x12 .transit_realtime.TripDescriptor\x18\xe9\x07 \x01(\x0b\x32\x13.NyctTripDescriptor:`\n\x15nyct_stop_time_update\x12+.transit_realtime.TripUpdate.StopTimeUpdate\x18\xe9\x07 \x01(\x0b\x32\x13.NyctStopTimeUpdateB\x1d\n\x1b\x63om.google.transit.realtime') - , - dependencies=[gtfs__realtime__pb2.DESCRIPTOR,]) - - -NYCT_FEED_HEADER_FIELD_NUMBER = 1001 -nyct_feed_header = _descriptor.FieldDescriptor( - name='nyct_feed_header', full_name='nyct_feed_header', index=0, - number=1001, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=True, extension_scope=None, - serialized_options=None, file=DESCRIPTOR) -NYCT_TRIP_DESCRIPTOR_FIELD_NUMBER = 1001 -nyct_trip_descriptor = _descriptor.FieldDescriptor( - name='nyct_trip_descriptor', full_name='nyct_trip_descriptor', index=1, - number=1001, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=True, extension_scope=None, - serialized_options=None, file=DESCRIPTOR) -NYCT_STOP_TIME_UPDATE_FIELD_NUMBER = 1001 -nyct_stop_time_update = _descriptor.FieldDescriptor( - name='nyct_stop_time_update', full_name='nyct_stop_time_update', index=2, - number=1001, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=True, extension_scope=None, - serialized_options=None, file=DESCRIPTOR) - -_NYCTTRIPDESCRIPTOR_DIRECTION = _descriptor.EnumDescriptor( - name='Direction', - full_name='NyctTripDescriptor.Direction', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='NORTH', index=0, number=1, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='EAST', index=1, number=2, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SOUTH', index=2, number=3, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='WEST', index=3, number=4, - serialized_options=None, - type=None), - ], - containing_type=None, - serialized_options=None, - serialized_start=358, - serialized_end=411, -) -_sym_db.RegisterEnumDescriptor(_NYCTTRIPDESCRIPTOR_DIRECTION) - - -_TRIPREPLACEMENTPERIOD = _descriptor.Descriptor( - name='TripReplacementPeriod', - full_name='TripReplacementPeriod', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='route_id', full_name='TripReplacementPeriod.route_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='replacement_period', full_name='TripReplacementPeriod.replacement_period', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto2', - extension_ranges=[], - oneofs=[ - ], - serialized_start=42, - serialized_end=140, -) - - -_NYCTFEEDHEADER = _descriptor.Descriptor( - name='NyctFeedHeader', - full_name='NyctFeedHeader', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='nyct_subway_version', full_name='NyctFeedHeader.nyct_subway_version', index=0, - number=1, type=9, cpp_type=9, label=2, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='trip_replacement_period', full_name='NyctFeedHeader.trip_replacement_period', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto2', - extension_ranges=[], - oneofs=[ - ], - serialized_start=142, - serialized_end=244, -) - - -_NYCTTRIPDESCRIPTOR = _descriptor.Descriptor( - name='NyctTripDescriptor', - full_name='NyctTripDescriptor', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='train_id', full_name='NyctTripDescriptor.train_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='is_assigned', full_name='NyctTripDescriptor.is_assigned', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='direction', full_name='NyctTripDescriptor.direction', index=2, - number=3, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=1, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _NYCTTRIPDESCRIPTOR_DIRECTION, - ], - serialized_options=None, - is_extendable=False, - syntax='proto2', - extension_ranges=[], - oneofs=[ - ], - serialized_start=247, - serialized_end=411, -) - - -_NYCTSTOPTIMEUPDATE = _descriptor.Descriptor( - name='NyctStopTimeUpdate', - full_name='NyctStopTimeUpdate', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='scheduled_track', full_name='NyctStopTimeUpdate.scheduled_track', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='actual_track', full_name='NyctStopTimeUpdate.actual_track', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto2', - extension_ranges=[], - oneofs=[ - ], - serialized_start=413, - serialized_end=480, -) - -_TRIPREPLACEMENTPERIOD.fields_by_name['replacement_period'].message_type = gtfs__realtime__pb2._TIMERANGE -_NYCTFEEDHEADER.fields_by_name['trip_replacement_period'].message_type = _TRIPREPLACEMENTPERIOD -_NYCTTRIPDESCRIPTOR.fields_by_name['direction'].enum_type = _NYCTTRIPDESCRIPTOR_DIRECTION -_NYCTTRIPDESCRIPTOR_DIRECTION.containing_type = _NYCTTRIPDESCRIPTOR -DESCRIPTOR.message_types_by_name['TripReplacementPeriod'] = _TRIPREPLACEMENTPERIOD -DESCRIPTOR.message_types_by_name['NyctFeedHeader'] = _NYCTFEEDHEADER -DESCRIPTOR.message_types_by_name['NyctTripDescriptor'] = _NYCTTRIPDESCRIPTOR -DESCRIPTOR.message_types_by_name['NyctStopTimeUpdate'] = _NYCTSTOPTIMEUPDATE -DESCRIPTOR.extensions_by_name['nyct_feed_header'] = nyct_feed_header -DESCRIPTOR.extensions_by_name['nyct_trip_descriptor'] = nyct_trip_descriptor -DESCRIPTOR.extensions_by_name['nyct_stop_time_update'] = nyct_stop_time_update -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -TripReplacementPeriod = _reflection.GeneratedProtocolMessageType('TripReplacementPeriod', (_message.Message,), { - 'DESCRIPTOR' : _TRIPREPLACEMENTPERIOD, - '__module__' : 'nyct_subway_pb2' - # @@protoc_insertion_point(class_scope:TripReplacementPeriod) - }) -_sym_db.RegisterMessage(TripReplacementPeriod) - -NyctFeedHeader = _reflection.GeneratedProtocolMessageType('NyctFeedHeader', (_message.Message,), { - 'DESCRIPTOR' : _NYCTFEEDHEADER, - '__module__' : 'nyct_subway_pb2' - # @@protoc_insertion_point(class_scope:NyctFeedHeader) - }) -_sym_db.RegisterMessage(NyctFeedHeader) +from . import gtfs_realtime_pb2 as gtfs__realtime__pb2 -NyctTripDescriptor = _reflection.GeneratedProtocolMessageType('NyctTripDescriptor', (_message.Message,), { - 'DESCRIPTOR' : _NYCTTRIPDESCRIPTOR, - '__module__' : 'nyct_subway_pb2' - # @@protoc_insertion_point(class_scope:NyctTripDescriptor) - }) -_sym_db.RegisterMessage(NyctTripDescriptor) -NyctStopTimeUpdate = _reflection.GeneratedProtocolMessageType('NyctStopTimeUpdate', (_message.Message,), { - 'DESCRIPTOR' : _NYCTSTOPTIMEUPDATE, - '__module__' : 'nyct_subway_pb2' - # @@protoc_insertion_point(class_scope:NyctStopTimeUpdate) - }) -_sym_db.RegisterMessage(NyctStopTimeUpdate) +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11nyct-subway.proto\x1a\x13gtfs-realtime.proto\"b\n\x15TripReplacementPeriod\x12\x10\n\x08route_id\x18\x01 \x01(\t\x12\x37\n\x12replacement_period\x18\x02 \x01(\x0b\x32\x1b.transit_realtime.TimeRange\"f\n\x0eNyctFeedHeader\x12\x1b\n\x13nyct_subway_version\x18\x01 \x02(\t\x12\x37\n\x17trip_replacement_period\x18\x02 \x03(\x0b\x32\x16.TripReplacementPeriod\"\xa4\x01\n\x12NyctTripDescriptor\x12\x10\n\x08train_id\x18\x01 \x01(\t\x12\x13\n\x0bis_assigned\x18\x02 \x01(\x08\x12\x30\n\tdirection\x18\x03 \x01(\x0e\x32\x1d.NyctTripDescriptor.Direction\"5\n\tDirection\x12\t\n\x05NORTH\x10\x01\x12\x08\n\x04\x45\x41ST\x10\x02\x12\t\n\x05SOUTH\x10\x03\x12\x08\n\x04WEST\x10\x04\"C\n\x12NyctStopTimeUpdate\x12\x17\n\x0fscheduled_track\x18\x01 \x01(\t\x12\x14\n\x0c\x61\x63tual_track\x18\x02 \x01(\t:H\n\x10nyct_feed_header\x12\x1c.transit_realtime.FeedHeader\x18\xe9\x07 \x01(\x0b\x32\x0f.NyctFeedHeader:T\n\x14nyct_trip_descriptor\x12 .transit_realtime.TripDescriptor\x18\xe9\x07 \x01(\x0b\x32\x13.NyctTripDescriptor:`\n\x15nyct_stop_time_update\x12+.transit_realtime.TripUpdate.StopTimeUpdate\x18\xe9\x07 \x01(\x0b\x32\x13.NyctStopTimeUpdateB\x1d\n\x1b\x63om.google.transit.realtime') -nyct_feed_header.message_type = _NYCTFEEDHEADER -gtfs__realtime__pb2.FeedHeader.RegisterExtension(nyct_feed_header) -nyct_trip_descriptor.message_type = _NYCTTRIPDESCRIPTOR -gtfs__realtime__pb2.TripDescriptor.RegisterExtension(nyct_trip_descriptor) -nyct_stop_time_update.message_type = _NYCTSTOPTIMEUPDATE -gtfs__realtime__pb2.TripUpdate.StopTimeUpdate.RegisterExtension(nyct_stop_time_update) +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'nyct_subway_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + gtfs__realtime__pb2.FeedHeader.RegisterExtension(nyct_feed_header) + gtfs__realtime__pb2.TripDescriptor.RegisterExtension(nyct_trip_descriptor) + gtfs__realtime__pb2.TripUpdate.StopTimeUpdate.RegisterExtension(nyct_stop_time_update) -DESCRIPTOR._options = None + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\033com.google.transit.realtime' + _TRIPREPLACEMENTPERIOD._serialized_start=42 + _TRIPREPLACEMENTPERIOD._serialized_end=140 + _NYCTFEEDHEADER._serialized_start=142 + _NYCTFEEDHEADER._serialized_end=244 + _NYCTTRIPDESCRIPTOR._serialized_start=247 + _NYCTTRIPDESCRIPTOR._serialized_end=411 + _NYCTTRIPDESCRIPTOR_DIRECTION._serialized_start=358 + _NYCTTRIPDESCRIPTOR_DIRECTION._serialized_end=411 + _NYCTSTOPTIMEUPDATE._serialized_start=413 + _NYCTSTOPTIMEUPDATE._serialized_end=480 # @@protoc_insertion_point(module_scope) diff --git a/mtaproto/nyct_subway_pb2.pyi b/mtaproto/nyct_subway_pb2.pyi new file mode 100644 index 0000000..06f1c48 --- /dev/null +++ b/mtaproto/nyct_subway_pb2.pyi @@ -0,0 +1,224 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" +import builtins +import collections.abc +import google.protobuf.descriptor +import google.protobuf.internal.containers +import google.protobuf.internal.enum_type_wrapper +import google.protobuf.internal.extension_dict +import google.protobuf.message +import gtfs_realtime_pb2 +import sys +import typing + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +@typing_extensions.final +class TripReplacementPeriod(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ROUTE_ID_FIELD_NUMBER: builtins.int + REPLACEMENT_PERIOD_FIELD_NUMBER: builtins.int + route_id: builtins.str + """The replacement period is for this route""" + @property + def replacement_period(self) -> gtfs_realtime_pb2.TimeRange: + """The start time is omitted, the end time is currently now + 30 minutes for + all routes of the A division + """ + def __init__( + self, + *, + route_id: builtins.str | None = ..., + replacement_period: gtfs_realtime_pb2.TimeRange | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["replacement_period", b"replacement_period", "route_id", b"route_id"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["replacement_period", b"replacement_period", "route_id", b"route_id"]) -> None: ... + +global___TripReplacementPeriod = TripReplacementPeriod + +@typing_extensions.final +class NyctFeedHeader(google.protobuf.message.Message): + """NYCT Subway extensions for the feed header""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NYCT_SUBWAY_VERSION_FIELD_NUMBER: builtins.int + TRIP_REPLACEMENT_PERIOD_FIELD_NUMBER: builtins.int + nyct_subway_version: builtins.str + """Version of the NYCT Subway extensions + The current version is 1.0 + """ + @property + def trip_replacement_period(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___TripReplacementPeriod]: + """For the NYCT Subway, the GTFS-realtime feed replaces any scheduled + trip within the trip_replacement_period. + This feed is a full dataset, it contains all trips starting + in the trip_replacement_period. If a trip from the static GTFS is not + found in the GTFS-realtime feed, it should be considered as cancelled. + The replacement period can be different for each route, so here is + a list of the routes where the trips in the feed replace all + scheduled trips within the replacement period. + """ + def __init__( + self, + *, + nyct_subway_version: builtins.str | None = ..., + trip_replacement_period: collections.abc.Iterable[global___TripReplacementPeriod] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["nyct_subway_version", b"nyct_subway_version"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["nyct_subway_version", b"nyct_subway_version", "trip_replacement_period", b"trip_replacement_period"]) -> None: ... + +global___NyctFeedHeader = NyctFeedHeader + +@typing_extensions.final +class NyctTripDescriptor(google.protobuf.message.Message): + """NYCT Subway extensions for the trip descriptor""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + class _Direction: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + + class _DirectionEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[NyctTripDescriptor._Direction.ValueType], builtins.type): # noqa: F821 + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + NORTH: NyctTripDescriptor._Direction.ValueType # 1 + EAST: NyctTripDescriptor._Direction.ValueType # 2 + SOUTH: NyctTripDescriptor._Direction.ValueType # 3 + WEST: NyctTripDescriptor._Direction.ValueType # 4 + + class Direction(_Direction, metaclass=_DirectionEnumTypeWrapper): + """The direction the train is moving.""" + + NORTH: NyctTripDescriptor.Direction.ValueType # 1 + EAST: NyctTripDescriptor.Direction.ValueType # 2 + SOUTH: NyctTripDescriptor.Direction.ValueType # 3 + WEST: NyctTripDescriptor.Direction.ValueType # 4 + + TRAIN_ID_FIELD_NUMBER: builtins.int + IS_ASSIGNED_FIELD_NUMBER: builtins.int + DIRECTION_FIELD_NUMBER: builtins.int + train_id: builtins.str + """The nyct_train_id is meant for internal use only. It provides an + easy way to associated GTFS-realtime trip identifiers with NYCT rail + operations identifier + + The ATS office system assigns unique train identification (Train ID) to + each train operating within or ready to enter the mainline of the + monitored territory. An example of this is 06 0123+ PEL/BBR and is decoded + as follows: + + The first character represents the trip type designator. 0 identifies a + scheduled revenue trip. Other revenue trip values that are a result of a + change to the base schedule include; [= reroute], [/ skip stop], [$ turn + train] also known as shortly lined service. + + The second character 6 represents the trip line i.e. number 6 train The + third set of characters identify the decoded origin time. The last + character may be blank "on the whole minute" or + "30 seconds" + + Note: Origin times will not change when there is a trip type change. This + is followed by a three character "Origin Location" / "Destination + Location" + """ + is_assigned: builtins.bool + """This trip has been assigned to a physical train. If true, this trip is + already underway or most likely will depart shortly. + + Train Assignment is a function of the Automatic Train Supervision (ATS) + office system used by NYCT Rail Operations to monitor and track train + movements. ATS provides the ability to "assign" the nyct_train_id + attribute when a physical train is at its origin terminal. These assigned + trips have the is_assigned field set in the TripDescriptor. + + When a train is at a terminal but has not been given a work program it is + declared unassigned and is tagged as such. Unassigned trains can be moved + to a storage location or assigned a nyct_train_id when a determination for + service is made. + """ + direction: global___NyctTripDescriptor.Direction.ValueType + """Uptown and Bronx-bound trains are moving NORTH. + Times Square Shuttle to Grand Central is also northbound. + + Downtown and Brooklyn-bound trains are moving SOUTH. + Times Square Shuttle to Times Square is also southbound. + + EAST and WEST are not used currently. + """ + def __init__( + self, + *, + train_id: builtins.str | None = ..., + is_assigned: builtins.bool | None = ..., + direction: global___NyctTripDescriptor.Direction.ValueType | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["direction", b"direction", "is_assigned", b"is_assigned", "train_id", b"train_id"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["direction", b"direction", "is_assigned", b"is_assigned", "train_id", b"train_id"]) -> None: ... + +global___NyctTripDescriptor = NyctTripDescriptor + +@typing_extensions.final +class NyctStopTimeUpdate(google.protobuf.message.Message): + """NYCT Subway extensions for the stop time update""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + SCHEDULED_TRACK_FIELD_NUMBER: builtins.int + ACTUAL_TRACK_FIELD_NUMBER: builtins.int + scheduled_track: builtins.str + """Provides the planned station arrival track. The following is the Manhattan + track configurations: + 1: southbound local + 2: southbound express + 3: northbound express + 4: northbound local + + In the Bronx (except Dyre Ave line) + M: bi-directional express (in the AM express to Manhattan, in the PM + express away). + + The Dyre Ave line is configured: + 1: southbound + 2: northbound + 3: bi-directional + """ + actual_track: builtins.str + """This is the actual track that the train is operating on and can be used to + determine if a train is operating according to its current schedule + (plan). + + The actual track is known only shortly before the train reaches a station, + typically not before it leaves the previous station. Therefore, the NYCT + feed sets this field only for the first station of the remaining trip. + + Different actual and scheduled track is the result of manually rerouting a + train off it scheduled path. When this occurs, prediction data may become + unreliable since the train is no longer operating in accordance to its + schedule. The rules engine for the 'countdown' clocks will remove this + train from all schedule stations. + """ + def __init__( + self, + *, + scheduled_track: builtins.str | None = ..., + actual_track: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["actual_track", b"actual_track", "scheduled_track", b"scheduled_track"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["actual_track", b"actual_track", "scheduled_track", b"scheduled_track"]) -> None: ... + +global___NyctStopTimeUpdate = NyctStopTimeUpdate + +NYCT_FEED_HEADER_FIELD_NUMBER: builtins.int +NYCT_TRIP_DESCRIPTOR_FIELD_NUMBER: builtins.int +NYCT_STOP_TIME_UPDATE_FIELD_NUMBER: builtins.int +nyct_feed_header: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[gtfs_realtime_pb2.FeedHeader, global___NyctFeedHeader] +nyct_trip_descriptor: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[gtfs_realtime_pb2.TripDescriptor, global___NyctTripDescriptor] +nyct_stop_time_update: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[gtfs_realtime_pb2.TripUpdate.StopTimeUpdate, global___NyctStopTimeUpdate] diff --git a/mtaproto/update.sh b/mtaproto/update.sh new file mode 100755 index 0000000..68dea5a --- /dev/null +++ b/mtaproto/update.sh @@ -0,0 +1,17 @@ +#! /usr/bin/nix-shell +#! nix-shell -i bash -p protobuf curl mypy-protobuf + +set -euo pipefail + +curl https://api.mta.info/nyct-subway.proto.txt -o nyct-subway.proto +curl https://developers.google.com/static/transit/gtfs-realtime/gtfs-realtime.proto -o gtfs-realtime.proto + +protoc -I=. --python_out=. --mypy_out=. nyct-subway.proto gtfs-realtime.proto + +# Fix nyct-subway pythom import to be relative path +sed -i \ + -e 's/^import gtfs_realtime_pb2 as gtfs__realtime__pb2/from . import gtfs_realtime_pb2 as gtfs__realtime__pb2/' \ + nyct_subway_pb2.py +sed -i \ + -e 's/^from . import gtfs_realtime_pb2/from . import gtfs_realtime_pb2/' \ + nyct_subway_pb2.pyi