Originally its own app, the librarian
registers real-time and static data feeds in a database, with metadata that describes where to fetch them from, how often to fetch them, and the last time they were fetched and archived. It communicates with the scribe
to do the actual fetching and archiving.
Manually add feed info in the data_feeds
table in the database. There is currently no interactive UI for this project. But, you can visit /data_feeds
to see a simple table with some of the key information for each DataFeed.
Supported Feed Types:
- GTFS
- GTFS_RT
- MDS_TRIPS
- MDS_STATUS_CHANGES
- GBFS (free-bike-status)
- GBFS_GEOFENCING_ZONE_INFORMATION
- ACTIVE_BLOCKS
- ARRIVAL_DEPARTURES
- NFORCE_PARKINGRIGHTS
An example DataFeed may look like this when initially set up:
{
"id" : 3,
"feed_type" : "GTFS_RT",
"slug" : "cfrta-gtfs-rt-vehiclepositions",
"url" : "http://cfrta.omnimodal.io:8080/api/v1/key/d9b9b402/agency/1/command/gtfs-rt/vehiclePositions",
"ping_rate" : 10000,
"check_last_modified" : false,
"archive" : true,
"name" : "LYNX GTFS Realtime Vehicle Positions Feed",
"country_code" : "US",
"location" : "Orlando, FL",
"provider_name" : "Omnimodal",
"provider_id" : "omnimodal",
"provider_url" : "https://omnimodal.io",
"auth_type" : null,
"auth_info" : null,
"version" : null,
"meta" : null,
"last_modified" : null,
"created_at" : "2019-06-27 16:42:43.96906",
"updated_at" : "2019-07-02 18:12:00.513381",
}
When the app is run, a clock process will ping all registered feeds according to their configuration attributes, and when the time is right, librarian
will ask scribe
to fetch and archive the feed, by POSTing with the appropriate info. If successful, scribe
will respond with 201 Created and various metadata. The response is saved back into the database in the meta
field, and the last_modified
field is updated if that value is available in the response.meta.
Librarian and Scribe use HTTP Basic authentication (username/password) to authenticate requests. Make sure the ENV variables for username and password are the same on each side in the given environment.
Librarian uses HTTP Basic authentication with a different username/password to access the UI (also configured in .env
).