Skip to content

Python SDK

The official Python SDK provides typed methods for all API endpoints.

View source on GitHub

Terminal window
pip install weplaytestgames
from weplaytestgames import WPGClient
client = WPGClient(api_key="wpg_sk_...")
# List your games
games = client.games.list()
# Create a playtest
playtest = client.playtests.create(
game_id="game_abc123",
visibility="private",
quantity=3,
instructions="Focus on the tutorial",
)
# Check credit balance
balance = client.billing.get_balance()
print(f"Balance: ${balance.balance_cents / 100}")
import os
from weplaytestgames import WPGClient
client = WPGClient(
api_key=os.environ["WPG_API_KEY"],
# Optional: custom base URL
base_url="https://app.weplaytestgames.com/api/v1",
)
from weplaytestgames import WPGClient, WPGError
try:
client.playtests.create("game_abc", visibility="private", quantity=1)
except WPGError as e:
print(e.code) # "PAYMENT_REQUIRED"
print(e.message) # "Insufficient credit"
print(e.status) # 402
# Iterate all pages
for game in client.games.list():
print(game.name)
# Get a single page
page = client.games.list(limit=10)
print(page.data)
print(page.meta.has_more)
from weplaytestgames import AsyncWPGClient
client = AsyncWPGClient(api_key="wpg_sk_...")
games = await client.games.list()
NamespaceMethods
client.authme(), update_profile(), categories(), devices(), platforms()
client.gameslist(), create(), get(), update()
client.playtestscreate(), list(), get(), update(), slots()
client.slotsget(), accept(), reject(), download_url(), transcript()
client.playtesterprofile(), update_profile(), stats(), open_playtests(), my_playtests()
client.billingget_balance(), payments(), purchase_credit()
client.payoutslist(), quote(), request(), cancel()
client.chatcontacts(), conversation(), send_message(), unread_count()
client.webhookslist(), create(), update(), delete(), deliveries(), test()