quantlab.utils.progress.ProgressEvent#
- class quantlab.utils.progress.ProgressEvent(kind, vendor, completed=0, total=0, symbols=(), message=None, detail=<factory>)[source]#
Bases:
objectOne thing that happened during an acquisition or a conversion.
The acquisition loop emits
run_started(totalis the number of batches,messagethe bar label),coverage(detailholds counts of symbols already on disk versus still to fetch),batch_completed(completedrises from 1 tototal),quota_exhausted(the rest of the batches are skipped, not fetched),cancelledandrun_finished.batch_failedis reserved for reporting a single failed batch.The conversion loop emits
conversion_started(totalis the number of planned time windows;detailholds the symbol count, the window size and the store path), thenwindow_writtenorwindow_skippedfor each window (skipped means an earlier run already wrote it), and finallyconversion_finished. A cancelled conversion emitscancelledjust beforeconversion_finished.messagenever contains raw vendor error text. Some vendors echo the full request URL, API key included, in their errors, so the loop removes credentials before building the event. The class is frozen so that one reporter cannot change an event another reporter is about to receive.- Attributes:
- kindstr
The event kind, one of
EVENT_KINDS.- vendorstr
The vendor name (for example
"tiingo"). Conversion events use the dataset config’s vendor, or the dataset class name if it has none.- completedint
How many batches or windows have finished so far.
- totalint
How many batches or windows the run will process.
- symbolstuple[str, …]
The symbols the event concerns, when it concerns any.
- messagestr | None
A human-readable description with credentials already removed.
- detaildict
Extra structured data whose keys depend on
kind.
Examples
>>> event = ProgressEvent(kind="batch_completed", vendor="tiingo", ... completed=3, total=10, symbols=("AAPL",)) >>> event.kind, event.completed, event.total ('batch_completed', 3, 10)