Skip to content

briskapi.record

Python · CLI

Record the demo replay into a folder (Parquet tables, see Data format), upload it unless you opt out, and make it the default source. On the command line: brisk record (see Recording).

Parameters

output str | Path required

The folder to write.

cache str | Path | None optional

Replay a copy of the demo's files downloaded before (default: download them).

codes list[str] | None optional

Securities to record (default: the whole market).

speed float optional = 1

1 is the recorded pace, 0 as fast as possible.

limit_frames int | None optional

Stop early (never uploaded).

upload bool | None optional

False keeps it local.

Returns

Recording

The Recording.

API method
briskapi.record(
    output: str | Path,
    cache: str | Path | None = None,
    codes: list[str] | None = None,
    speed: float = 1,
    limit_frames: int | None = None,
    upload: bool | None = None,
) -> Recording
Example usage
1
2
3
4
import briskapi

rec = briskapi.record("recordings/s1", speed=0, upload=False)
print(rec.manifest["summary"]["batches"], rec.manifest["bytes"])
brisk record --speed 0 --no-upload --output recordings/s1
Example responseCaptured from the demo
18002 28898515
{
  "schema": "brisk-nautilus-parquet-v3",
  "sha256": "2ba597ccf9722e6850797039b90f88060fb5be9186fa73ea9c810a6e8d75d721",
  "bytes": 28898515,
  "summary": {
    "source": "historical_mock",
    "trading_date": "20210927",
    "first_source_time_us": 32399999955,
    "last_source_time_us": 32579999896,
    "codes": [
      "1301",
      "1305",
      "1306",
      "1308",
      "1309",
      "… 4126 more"
    ],
    "batches": 18002,
    "quote_updates": 735382,
    "expanded_bytes": 965391154
  }
}