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.0.tar.gz (19.5 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.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file heisenberg_ai-0.1.0.tar.gz.

File metadata

  • Download URL: heisenberg_ai-0.1.0.tar.gz
  • Upload date:
  • Size: 19.5 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.0.tar.gz
Algorithm Hash digest
SHA256 c1e45eb8f374db8118e9ef91c2f2d218d9d6e5bd57f46b49ae2445a96d59a52a
MD5 f62954dc8958afc9d190aa582f8013ad
BLAKE2b-256 77ad5ee7faff91c68c81f48d97ba65008907e497aa63dd75cbb8d9e97176ed63

See more details on using hashes here.

Provenance

The following attestation bundles were made for heisenberg_ai-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: heisenberg_ai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.2 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a2ac7c8a1e92759dec8878966d1c26563aa119a954f9d511e8d35b096c924c79
MD5 fbbb1e4e1453dc790c0ed3e314201ee1
BLAKE2b-256 bea4e70d4029c9465a13b556c58e0f4afc7d50fe8204b971332ac422921df8c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for heisenberg_ai-0.1.0-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