quantlab.dataset.massive.raw.read_rest_records#

quantlab.dataset.massive.raw.read_rest_records(vendor_root, endpoint, key='id')[source]#

Return one REST endpoint’s records, each record’s newest copy once.

Pages are read oldest pull first, so a record re-read by a later pull (a row past the watermark, a vendor revision) replaces the earlier copy. Records keep the vendor’s field names and values verbatim.

Parameters:
vendor_rootstr or Path

<download-dir>/massive.

endpointstr

The endpoint’s name (quantlab.acquisition.massive.rest.ENDPOINTS).

keystr or None, default “id”

The field identifying a record; None identifies a record by all its fields, for an endpoint whose records have no id (RestEndpoint.key).

Raises:
ValueError

If a record lacks key.

Examples

Needs a raw tier on disk:

splits = read_rest_records("/data/quantlab/downloads/massive", "splits")
splits[0]["execution_date"], splits[0]["split_from"], splits[0]["split_to"]