Skip to main content

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

  • Venueshb.polymarket, hb.kalshi, hb.hyperliquid; each exposes the capabilities the spec says it supports (hb.polymarket.supports("orderbook")).
  • Intelligencehb.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

heisenberg_ai-0.1.1.tar.gz (19.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

heisenberg_ai-0.1.1-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

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

Hashes for heisenberg_ai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8fc5f531cb3556750a8792b90af6e78fbf8a194ccb8e53d9339c58754a9200ef
MD5 47bd4d60bf8748134b48c91155bfc7eb
BLAKE2b-256 dde298a95ddad6bc5c64b34b9dd8412ea320dfb4160f12bb3338c05a15222843

See more details on using hashes here.

Provenance

The following attestation bundles were made for heisenberg_ai-0.1.1.tar.gz:

Publisher: release.yml on SeshatLabs/heisenberg-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for heisenberg_ai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f4b040fba1cbfda2c68c636880ce80729a7e00a47113294efc432410191a4d4d
MD5 75a8b2c619d3cedbdf9f43821ab66512
BLAKE2b-256 f8cf7257bee41aa78c3173fb1b53f3197c94e45664f86ddb019f7a5fd738e7ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for heisenberg_ai-0.1.1-py3-none-any.whl:

Publisher: release.yml on SeshatLabs/heisenberg-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page