A Python API wrapper for Fairyground Variant Challenge.
Project description
Chess Variant Python API Wrapper
A simple Python wrapper around the Fairyground Variant Challenge API.
Installation
pip install chess-variant
Usage
from chess_variant import ChessVariantAPI
api = ChessVariantAPI()
# 1. Get all supported chess variants
variants = api.get_variants()
print("Supported Variants:", list(variants['variants'].keys())[:5])
# 2. Create a new game room
game_info = api.create_game(variant="crazyhouse", white="Alice", time_control="3+2")
room_id = game_info['roomId']
print(f"Created game! Game URL: {game_info['gameUrl']}")
# 3. Get the state of the game
state = api.get_game(room_id)
print("Current FEN:", state['fen'])
# 4. Generate PGN
pgn = api.get_pgn(room_id)
print(pgn)
# 5. Check all active rooms
active_rooms = api.get_active_rooms()
print(f"Currently {active_rooms['count']} active rooms.")
Available Methods
get_variants()create_game(variant="chess", white="White", time_control="5+5")get_game(room_id)get_game_result(room_id)get_moves(room_id)get_fen(room_id)get_pgn(room_id)get_active_rooms()get_all_rooms()
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
chess_variant-1.0.0.tar.gz
(2.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chess_variant-1.0.0.tar.gz.
File metadata
- Download URL: chess_variant-1.0.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f154f856b771001c70767de936dd712ac4e3a279f38d9caab60b356d914b233
|
|
| MD5 |
e936d7de2b9bdbe8b18da01840fe6ba3
|
|
| BLAKE2b-256 |
f162b0e8f771f9d5b2148ea64785ad9076657b094b79a6c7e5f40604859be0b4
|
File details
Details for the file chess_variant-1.0.0-py3-none-any.whl.
File metadata
- Download URL: chess_variant-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48f6b42aec11dab0424851bdd80832bb8f0609cb137a7d16529858676cf5ca86
|
|
| MD5 |
a913a6f5baf7a40b44f412222ba62849
|
|
| BLAKE2b-256 |
700539a85de56f2b1971c313e173c7290a4f645a74e9850b8e34c0a302921379
|