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 40472003
{
  "schema": "brisk-nautilus-parquet-v2",
  "sha256": "08e95f88f7660a28b9637b691bfd21c609368198c44bb7084037090cbd25843b",
  "bytes": 40471946,
  "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": 965408677
  }
}