Currently, someone writing a custom Transiter feed parser is expected to know a bit about how Transiter works internally because they are responsible for persisting entities in the feed to the DB. This is unnecessary. Someone writing a custom feed parser should just be responsible for converting the feed content into the Transiter entities represented in the feed. The business logic for how these should be persisted should be handled exclusively by Transiter.
New feed parser API
A feed parser is a Python function that accepts two arguments:
A transiter.models.FeedUpdate object containing information on the current feed update event,
The current content of the feed in binary,
and returns
An iterator of updatable Transiter objects.
An updatable Transiter object is one of the following objects:
Stop
Route
ScheduledService
ScheduledTrip (with ScheduledTripStopTime objects contained in the stop_times field)
Trip (with TripStopTime objects contained in the stop_times field)
Alert
After the parser returns these objects, Transiter will sync them to the DB automatically.
Currently, someone writing a custom Transiter feed parser is expected to know a bit about how Transiter works internally because they are responsible for persisting entities in the feed to the DB. This is unnecessary. Someone writing a custom feed parser should just be responsible for converting the feed content into the Transiter entities represented in the feed. The business logic for how these should be persisted should be handled exclusively by Transiter.
New feed parser API
A feed parser is a Python function that accepts two arguments:
transiter.models.FeedUpdate
object containing information on the current feed update event,and returns
An updatable Transiter object is one of the following objects:
stop_times
field)stop_times
field)After the parser returns these objects, Transiter will sync them to the DB automatically.