Skip to main content

Official Python SDK for the We Playtest Games API

Project description

We Playtest Games - Python SDK

Official Python SDK for the We Playtest Games API.

Installation

pip install weplaytestgames

Quickstart

Synchronous

from weplaytestgames import WPGClient

with WPGClient(api_key="wpg_sk_...") as client:
    # List your games
    page = client.games.list().get_page()
    print(page.data)

    # Create a game
    game = client.games.create(
        name="My Game",
        build_url="https://store.steampowered.com/app/123456",
    )

    # Order playtests
    result = client.playtests.create(
        game_id=game["id"],
        visibility="public",
        quantity=3,
        duration_minutes=60,
    )

Async

from weplaytestgames import AsyncWPGClient

async with AsyncWPGClient(api_key="wpg_sk_...") as client:
    page = await client.games.list().get_page()
    game = await client.games.create(name="My Game", build_url="https://example.com")

Authentication

Get an API key from your dashboard or register programmatically:

result = WPGClient.register_with_api_key(
    email="studio@example.com",
    password="securepassword",
    company_name="My Studio",
)
api_key = result["api_key"]

Features

  • TypedDict responses - All responses use typed dictionaries with snake_case keys
  • Sync and async - WPGClient for synchronous code, AsyncWPGClient for async
  • Pagination - Cursor-based pagination with get_page() and get_all() helpers
  • Retry with backoff - Automatic retries on 429/5xx errors with exponential backoff (configurable via max_retries)
  • Webhook verification - verify_webhook_signature() with replay protection
  • Idempotency - Pass idempotency keys to mutating operations

Configuration

client = WPGClient(
    api_key="wpg_sk_...",
    base_url="https://app.weplaytestgames.com/api/v1",  # default
    timeout=30.0,       # seconds, default 30
    max_retries=2,      # default 2 (3 total attempts), 0 to disable
)

Available Resources

Resource Methods
client.auth me(), profile(), update_profile(), categories(), devices()
client.games list(), get(), create(), update()
client.playtests list(), get(), create(), update()
client.slots get(), accept(), reject(), download_url(), transcript()
client.submissions list(), get()
client.billing get_balance(), payments(), get_payment(), purchase_credit()
client.chat contacts(), conversation(), send_message(), unread_count()
client.webhooks list(), create(), update(), delete(), test(), deliveries()
client.notifications list(), mark_read(), mark_all_read()
client.dashboard stats()

Webhook Verification

from weplaytestgames import verify_webhook_signature

is_valid = verify_webhook_signature(
    payload=raw_body,
    signature=request.headers["X-WPG-Signature"],
    timestamp=request.headers["X-WPG-Timestamp"],
    secret=webhook_secret,
)

Documentation

Full API documentation: weplaytestgames.com/docs

License

MIT

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

weplaytestgames-0.2.0.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

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

weplaytestgames-0.2.0-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file weplaytestgames-0.2.0.tar.gz.

File metadata

  • Download URL: weplaytestgames-0.2.0.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for weplaytestgames-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a83dd1b868b4b2a0abd1be5e6ca5987d133517534f452fd5e6ed3742b01782ec
MD5 b692872e1838f7ff07eca1ea1a19eef6
BLAKE2b-256 cbfcdfd23ed4be42535fa9a9aa277ccf0be979d08064e9988779be4565d7221a

See more details on using hashes here.

Provenance

The following attestation bundles were made for weplaytestgames-0.2.0.tar.gz:

Publisher: publish.yml on WePlaytestGames/sdk-python

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

File details

Details for the file weplaytestgames-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for weplaytestgames-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e1dd96d9e39ce0d16c2f9cff98148056e54f035bd7c8f4264b82a897fb894f0
MD5 ff44d0964683387d84c60633a29241a9
BLAKE2b-256 0fd3987324ebec88b16cfed79806368c1955c7a84237467ea147db97574640aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for weplaytestgames-0.2.0-py3-none-any.whl:

Publisher: publish.yml on WePlaytestGames/sdk-python

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