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.1.0.tar.gz (16.1 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.1.0-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for weplaytestgames-0.1.0.tar.gz
Algorithm Hash digest
SHA256 473b6687ba292b83d982e9d3a94e0ff117c2bcf1dd848819f2fef1a5284d346e
MD5 3eb255236f88a2eb678d1c1c2cdd8c61
BLAKE2b-256 507c8734c9a193639ba3c53601218679a809eee0808b88745df1b2e706d2a3f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for weplaytestgames-0.1.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.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for weplaytestgames-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5473fb4ced44414ef8e2e0e347af84a288b031938ef522d3efb5aefbe14e773f
MD5 ca4ad3c13437fc48e1e81617423b5889
BLAKE2b-256 76b4a532197cc52feb6afdb4cccac48e8f17cdfbd79cbd4a174c267c8cd10e75

See more details on using hashes here.

Provenance

The following attestation bundles were made for weplaytestgames-0.1.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