kalshieye
Python client for Kalshi Eye flat files. Kalshi: daily Parquet for the order book (book_l2), 1-second top-10 book snapshots (book_snap_1s), top of book (bbo), one-minute bars (bbo_1m), trades, crypto spot (spot), and the reference tables (markets, settlements, series, incidents). Polymarket: polymarket_l2, polymarket_trades, polymarket_fills, polymarket_markets. Limitless: limitless_l2, limitless_markets. Chainlink prices: chainlink. replay_book rebuilds Kalshi books from book_l2.
pip install "kalshieye[pandas]" # or kalshieye[polars], or plain kalshieye
export KALSHIEYE_API_KEY=clab_... # create one under API keys
from kalshieye import Client, replay_book
kx = Client()
kx.datasets() # schemas, coverage, required plan
kx.estimate(["bbo_1m", "trades"], "2026-10-12", "2026-10-18", series=["KXBTC*"])
kx.download(["bbo_1m", "trades"], "2026-10-12", "2026-10-18",
series=["KXBTC*"], dest="data", progress=True)
df = kx.load("bbo_1m", "2026-10-12", "2026-10-18", series="KXBTC15M")
fills = kx.load("trades", "2026-10-12", "2026-10-12", tickers=["KXBTC15M-26OCT121545-45"])
# Rebuild the book from book_l2 rows
book = kx.load("book_l2", "2026-10-12", "2026-10-12", tickers=["KXBTC15M-26OCT121545-45"])
for ts, ticker, bids, asks in replay_book(book):
...
# One event in one zip: book, snapshots, trades, spot, metadata.json, settlement.json
kx.bundle("KXBTC15M-26OCT121545")
# CSV.gz copy of a single file
f = next(kx.files("trades", "2026-10-12", "2026-10-12", series="KXBTC15M"))
kx.csv(f["key"])
# S3 access (paid plans): a read-only key for aws s3 sync, rclone, DuckDB, boto3
key = kx.create_s3_key("laptop")
print(key["snippets"]["aws_cli"])
- Files land under
destin the lake layout (bbo_1m/date=2026-10-12/series=KXBTC15M/...parquet), so DuckDB, Polars, and Spark can read the folder as a hive-partitioned dataset.spotis partitioned byasset=instead ofseries=. - Every file is checked against its sha256. Files already on disk are skipped and do not count toward your monthly download allowance.
seriesaccepts wildcards (KXBTC*).categoriesfilters by archive category (crypto,politics, ...).tickerspicks the series files holding those markets, andloadkeeps only their rows.bundle,csv, andreplayare built on the server the first time; the client waits for them.- Errors raise
kalshieye.ApiError. Useerr.codeto tell plan limits (plan_required,history_limited,download_quota) apart.
Without an account
replay_book works on any book_l2 rows, including the free one-day sample on Hugging Face (KalshiEye/kalshi-order-book-sample), which DuckDB reads in place:
# pip install "kalshieye[pandas]" duckdb
import duckdb
from kalshieye import replay_book
# Bills vs Rams, YES if Buffalo wins: every book change up to 11 PM Eastern
book = duckdb.sql("""
SELECT * FROM 'hf://datasets/KalshiEye/kalshi-order-book-sample/kalshieye-data/book_l2/*/series=KXNFLGAME/*.parquet'
WHERE ticker = 'KXNFLGAME-26OCT12BUFLAR-BUF'
AND ts_recv::TIMESTAMPTZ <= '2026-10-13 03:00:00+00'::TIMESTAMPTZ
ORDER BY ts_recv, seq
""").df()
*_, (ts, ticker, bids, asks) = replay_book(book, levels=3)
print(bids) # [(0.51, 155253.51), (0.5, 405328.0), (0.49, 15126.0)]
print(asks) # [(0.52, 960851.07), (0.53, 862817.41), (0.54, 113351.03)]
More runnable examples (a backtest, spreads and depth, calibration) are in KalshiEye/kalshieye-examples. Every column is described in the data dictionary.
Metadata
Release files for kalshieye 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| kalshieye-0.2.2.tar.gz | 12.4 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kalshieye-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.1 kB
Release files / kalshieye-0.2.2.tar.gz
| Download URL | kalshieye-0.2.2.tar.gz |
|---|---|
| Size | 12.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
98f7d2e7d7b2914c0d976357767e0ec3190b255bd67c4456338c9ec65bea99af
|
|
BLAKE2b-256 checksum How to use checksums |
413077fa0c6a357062f1f84b715556518599699541d0b64c4657c7079a614d01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logRelease files / kalshieye-0.2.2-py3-none-any.whl
| Download URL | kalshieye-0.2.2-py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aba03597d1422538269f2b3085cfe70873eca07c93b3dcea49c37c67cb276071
|
|
BLAKE2b-256 checksum How to use checksums |
5e9f99ea501b9bf1c61bf1a7b1a2d01e7de36bf498a917f2c03b7e06cb7fb670
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logSecurity for kalshieye 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for kalshieye-0.2.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.