Python SDK for the Heisenberg prediction-market intelligence API.
Project description
Heisenberg Python SDK
Python client for the Heisenberg prediction-market intelligence API — generated from the same spec snapshot as the TypeScript SDK, with the same resource model, venue abstraction, gating semantics, and streaming.
Read-only. The REST client uses only the Python standard library (no required deps).
Install
pip install heisenberg_ai # REST
pip install "heisenberg_ai[stream]" # + real-time streaming (websocket-client)
Quickstart
from heisenberg import Heisenberg
hb = Heisenberg(token="…") # or set HEISENBERG_TOKEN
# Free tier — no subscription needed.
markets = hb.polymarket.markets({"min_volume": 1000, "closed": False, "limit": 5}).page()
profile = hb.wallets.profile("0xabc…", {"window_days": 15}).page()
# Iterate a Query to auto-paginate every row.
for trade in hb.polymarket.trades({"condition_id": "0x…"}):
...
# Real-time trades.
for trade in hb.stream.trades({"condition_id": "0x…"}):
print(trade.get("price"), trade.get("side"))
Two axes
- Venues —
hb.polymarket,hb.kalshi,hb.hyperliquid; each exposes the capabilities the spec says it supports (hb.polymarket.supports("orderbook")). - Intelligence —
hb.wallets,hb.smart_money,hb.leaderboards,hb.markets,hb.sports,hb.audience,hb.social.
Escape hatch for anything not wrapped: hb.query(agent_id, params).
Gated endpoints
Sport/audience endpoints require a subscription and raise a typed PlanError
(preserving the API message, plus .required_plan / .endpoint). Check ahead with
hb.requires(agent_id) or hb.catalog().
Develop
python -m unittest discover -s tests
Generated code lives in heisenberg/_generated/ (produced by ../scripts/generate.mjs
from ../spec/source). Never edit it by hand.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file heisenberg_ai-0.1.1.tar.gz.
File metadata
- Download URL: heisenberg_ai-0.1.1.tar.gz
- Upload date:
- Size: 19.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8fc5f531cb3556750a8792b90af6e78fbf8a194ccb8e53d9339c58754a9200ef
|
|
| MD5 |
47bd4d60bf8748134b48c91155bfc7eb
|
|
| BLAKE2b-256 |
dde298a95ddad6bc5c64b34b9dd8412ea320dfb4160f12bb3338c05a15222843
|
Provenance
The following attestation bundles were made for heisenberg_ai-0.1.1.tar.gz:
Publisher:
release.yml on SeshatLabs/heisenberg-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
heisenberg_ai-0.1.1.tar.gz -
Subject digest:
8fc5f531cb3556750a8792b90af6e78fbf8a194ccb8e53d9339c58754a9200ef - Sigstore transparency entry: 2139167579
- Sigstore integration time:
-
Permalink:
SeshatLabs/heisenberg-sdk@8d2650a5f070eab6119e856e556237a365c0283b -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/SeshatLabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8d2650a5f070eab6119e856e556237a365c0283b -
Trigger Event:
push
-
Statement type:
File details
Details for the file heisenberg_ai-0.1.1-py3-none-any.whl.
File metadata
- Download URL: heisenberg_ai-0.1.1-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4b040fba1cbfda2c68c636880ce80729a7e00a47113294efc432410191a4d4d
|
|
| MD5 |
75a8b2c619d3cedbdf9f43821ab66512
|
|
| BLAKE2b-256 |
f8cf7257bee41aa78c3173fb1b53f3197c94e45664f86ddb019f7a5fd738e7ca
|
Provenance
The following attestation bundles were made for heisenberg_ai-0.1.1-py3-none-any.whl:
Publisher:
release.yml on SeshatLabs/heisenberg-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
heisenberg_ai-0.1.1-py3-none-any.whl -
Subject digest:
f4b040fba1cbfda2c68c636880ce80729a7e00a47113294efc432410191a4d4d - Sigstore transparency entry: 2139167607
- Sigstore integration time:
-
Permalink:
SeshatLabs/heisenberg-sdk@8d2650a5f070eab6119e856e556237a365c0283b -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/SeshatLabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8d2650a5f070eab6119e856e556237a365c0283b -
Trigger Event:
push
-
Statement type: