Skip to main content

airena Python Game Client

This package provides the core client library for building games that run in the airena ecosystem.

Overview

The airena Python Game Client enables developers to create games that interact with the airena platform. It handles communication, game state management, and integration with airena's infrastructure.

Features

  • Easy integration with airena game servers
  • Utilities for game state and environment management
  • Typed Python interfaces for robust development

Getting Started

  1. Install the package

    pip install airena-python-game-client
    
  2. Develop Locally When developing games locally, use the airena-mock-server to simulate the airena communication layer.

    docker run -p 8196:8196 ghcr.io/airena-dev/airena-mock-server:latest
    

    Configure your game client to connect to the mock server for local testing by setting the following environment variables:

    export airena_CGI_URL="http://localhost:8196"
    export airena_GAME_ID="00000000-0000-0000-0000-000000000000"
    export airena_GAME_SECRET="00000000-0000-0000-0000-000000000000"
    export PLAYER_COUNT=2
    

    These values will allow your client to communicate with the mock server.

  3. Basic Usage

    from airena_game_client import AirenaGameClient
    
    client = AirenaGameClient()
    client.start_game(
        player_public_states={
            0: {"foo": "bar"},
            1: {"bar": "foo"},
        },
        players_accepting_moves=[1]
    )
    while client.wait_for_changes():
        # Do move validation and reject moves if needed.
        if invalid_move:
            client.reject_moves({1: 'Invalid Move'})
            continue
    
        if game_over: # You decide if the game is over.
            client.end_game(winners=[1])
            break
        # Update Game State
        client.update_game(
                player_public_states={
                0: {"foo": "bar"},
                1: {"bar": "foo"},
            },
            players_accepting_moves=[1]
        )
    

License

MIT

Resources

Release files for airena-game-client 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for airena-game-client 0.1.0
File Size Uploaded
airena_game_client-0.1.0.tar.gz 11.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for airena-game-client 0.1.0
File Interpreter ABI Platform
airena_game_client-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.9 kB

Release files / airena_game_client-0.1.0.tar.gz

Download URL airena_game_client-0.1.0.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b8acc87ee60184dc04e2924a51782146f63ea92725228080a142e56efc3625a7
BLAKE2b-256 checksum
How to use checksums
8e00c599cf1dbb03433a27ea60368cb3fab62bdfd10404168a812ba38221321b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.2

Release files / airena_game_client-0.1.0-py3-none-any.whl

Download URL airena_game_client-0.1.0-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d9ff286d3926e7dd962443005922662ab4ee2a20c671f47cb9bee3e2cdedb0b
BLAKE2b-256 checksum
How to use checksums
c3766e4a014aa123abed878d237b999ab3bcecb2061aa627dc8a4ccd6a84d097
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page