Skip to main content
The probalytics Python client is a convenience layer over the ClickHouse database. It handles the connection, builds queries for you, and returns results as Polars or pandas dataframes — or as typed Python models.
The client connects to ClickHouse using the same credentials as the SQL Guide. Create ClickHouse credentials in app.probalytics.io → ClickHouse Credentials.

Installation

Requires Python 3.11+. Polars is included by default. For pandas support:

Connecting

Advanced options:

Markets

Query market metadata as typed models or as a dataframe.
Any filter accepts a single value or a list:

Fills

Fetch trade fills. Scope them to a market object, a market ID, or a platform-native ID:
Filter by participant, side, and platform:
Return typed models instead of a dataframe with fills_models:
Interpret financial fields using the linked market’s market_type. normalized_price is not a probability for perpetual products, cash-flow fields are not currently signed by trade direction, and fee = 0 can mean fee data was unavailable.

Orderbook snapshots

Full bid/ask depth per outcome, captured when the book changes. Requires an Orderbook or Custom ClickHouse tier.
Each row is a complete replacement book for one outcome, not a level delta. Snapshot rows also expose indexed_at, hash, state, continuity, and path_index.
  • Order rows within one outcome by timestamp, path_index, then indexed_at.
  • Keep INTERMEDIATE rows to see every retained book state; filter to VERIFIED for orderbooks reconstructed without gaps.
  • A RESET row is a fresh starting point. Do not calculate changes from the preceding row or forward-fill across it.
  • Do not deduplicate different states by timestamp alone.
See Orderbook Snapshots for field semantics and venue-specific reconstruction details.

Choosing Polars or pandas

Methods return Polars by default. Set the backend globally when connecting, or override per call:
Valid values are "polars" and "pandas".

Custom SQL

Run arbitrary parameterized queries and get a dataframe back:
Always pass values via parameters rather than string-formatting them into the query. See the SQL Guide for table schemas and query examples.

Supported filters

Every filter accepts a single value or a list of values.

Resources

Source & README

Package source and usage guide (Apache-2.0)

SQL Guide

Table schemas and query examples