Skip to main content

Official Python SDK for the Stadar esports API (stadar.net)

Project description

stadar — Python SDK for the Stadar esports API

Official Python client. Pip-installable. Type-hinted. Generated from the public OpenAPI 3.1 spec — see stadar.net/docs/api for the full reference and clients/README.md in the monorepo for the codegen posture.

pip install stadar

Quick start

from stadar import Client

# Reads $STADAR_API_KEY from env, with $STADAR_API_URL override.
client = Client.from_env()

# Or pass explicitly:
client = Client(api_key="esp_live_...", base_url="https://api.stadar.net")

matches = client.matches.list(game="cs2", status="live")
for m in matches.data:
    print(m.id, m.team_a.slug, "vs", m.team_b.slug)

Sandbox

# `esp_test_`-prefixed keys auto-route to the sandbox fixture set.
# `meta.sandbox: true` flags every response from the sandbox.
client = Client(api_key="esp_test_...")

Webhooks

from stadar.webhooks import verify_signature

@app.post("/stadar-webhook")
def handle(request):
    body = request.body  # raw bytes
    signature = request.headers["X-Stadar-Signature"]
    if not verify_signature(body, signature, secret="your-webhook-secret"):
        return 401
    event = parse_event(body)
    # ... handle event

See stadar.net/docs/webhooks for the signature verification recipe.

License

MIT. Source of truth is the OpenAPI spec; regeneration is part of every spec change.

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

stadar-0.1.5.tar.gz (54.2 kB view details)

Uploaded Source

Built Distribution

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

stadar-0.1.5-py3-none-any.whl (157.5 kB view details)

Uploaded Python 3

File details

Details for the file stadar-0.1.5.tar.gz.

File metadata

  • Download URL: stadar-0.1.5.tar.gz
  • Upload date:
  • Size: 54.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for stadar-0.1.5.tar.gz
Algorithm Hash digest
SHA256 4cd0cc5d89b2373c8d0fa514f9d47232ed8f540f35cf850a4006f3a3a63983ac
MD5 64c1056bfce205c11a4597fbf6b340b7
BLAKE2b-256 e0a0ca5133d7f2fdd5e45f7f407bb5a177c2d03ec419ad4ebd618bcd873d5e56

See more details on using hashes here.

File details

Details for the file stadar-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: stadar-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 157.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for stadar-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 bf9c6913dbdb17aefc67cfbe529c6197cf815398c56ab823e2c8e9e4e9d34a69
MD5 10bbd5d9622047d056d4b0a62fc9c586
BLAKE2b-256 6b82ac28d73e126fa73adce4e774741f1b1e84752e064c298478e395fd4d2e5a

See more details on using hashes here.

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