Skip to main content

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

import chess_variant

# 1. Get all supported chess variants
variants = chess_variant.get_variants()
print("Supported Variants:", list(variants['variants'].keys())[:5])

# 2. Create a new game room
game_info = chess_variant.create_game(variant="3check", white="Alice", tc="3+2")
room_id = game_info['roomId']
print(f"Created game! Game URL: {game_info['gameUrl']}")

# 3. Get the state of the game
state = chess_variant.view_game(room_id)
print("Current FEN:", state['fen'])

# 4. Generate PGN
pgn = chess_variant.get_pgn(room_id)
print(pgn)

# 5. Check all active rooms
active_rooms = chess_variant.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.1.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

chess_variant-1.0.1-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file chess_variant-1.0.1.tar.gz.

File metadata

  • Download URL: chess_variant-1.0.1.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for chess_variant-1.0.1.tar.gz
Algorithm Hash digest
SHA256 3eee95e8c4e01819db8d6f036a511fdbe0494d7c7f7aee0536e30e5d11f34a91
MD5 219cd6a1c9336f49b85abc324d98e59c
BLAKE2b-256 e48896cfd9e2ca910a0582151581278bfe72ba26a72fb20ca1d9aaf1c446a098

See more details on using hashes here.

File details

Details for the file chess_variant-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: chess_variant-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for chess_variant-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2bd174e26fce274de52b50f40e655e39173b87822a92e2e1784eff8a57561be1
MD5 d6a3521291cd7ada9eb0e90ccd0583d4
BLAKE2b-256 30d2ae9d889ef8975d5c08b7df8cc6319634d2f2005991dafcc49d65a018144e

See more details on using hashes here.

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