orchestrator
¶
Runs instrument master ingestion across every broker.
Each broker is downloaded in its own try/except, so one broker's endpoint being down, or its token having expired, never costs the others their snapshot for the day. That matters more here than it would elsewhere: nine of the ten brokers publish only today's file, and Kotak's URL is stamped with today's date, so a snapshot missed is a snapshot that can never be fetched later.
Functions:
| Name | Description |
|---|---|
ingest_one |
Ingest one broker's instrument master, catching any failure rather than raising. |
ingest_all |
Ingest every named broker in turn, isolating each one's failure from the rest. |
ingest_one
¶
Ingest one broker's instrument master, catching any failure rather than raising.
broker_nameis the name of the broker to ingest.download_dateis the snapshot date to record, defaulting to today.bootstrapreplaces that date's stored rows rather than skipping when already ingested.
Returns a (rows, deviation, error) triple, where deviation is the row count canary's
verdict and error is None on success.
Source code in stock_brokers/instruments/orchestrator.py
ingest_all
¶
Ingest every named broker in turn, isolating each one's failure from the rest.
brokersis the list of broker names to ingest.download_dateis the snapshot date to record, defaulting to today.bootstrapreplaces that date's stored rows rather than skipping when already ingested.