Skip to main content

High-performance chess library with arbitrary board sizes

Project description

spooky_chess 🎃👻

Rust and Python library for the game of Chess.

Features

Performance

Measured with a Threadripper 9980x, and 6400 MT/s CL36 DDR5. Python 3.14.

> cd tests/comparison && cargo run --release && cd -
50000 random game playouts
  spooky_chess (Rust Bindings):
    moves:   4936906
    time:    2.14s
    moves/s: 2311096.73
> uv run python -m pytest -k test_compare_random_game_playout -s --run-slow
50000 random game playouts
  spooky_chess (Python Bindings):
    moves:   4936141
    time:    6.66s
    moves/s: 740666.24
  python-chess:
    moves:   4935315
    time:    113.33s
    moves/s: 43548.00
  Speedup: 17.01x

Validity

Fuzz-tested against python-chess, with 5 million random playouts.

Install

Rust

cargo add spooky_chess

Python

uv add spooky-chess

Includes type hints.

Examples

These examples load a PGN, and ask Stockfish for the best move at every playable position.

Rust:

cargo run --example analyse_pgn

Python:

uv run python examples/analyse_pgn.py

Develop

Tests

  • fish run_tests.fish
    • fish run_python_tests.fish
    • fish run_rust_tests.fish

Lints

  • fish run_lints.fish

Performance

  • fish run_benchmark.fish
  • fish run_profile.fish

See Also

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

spooky_chess-0.9.0.tar.gz (87.8 kB view details)

Uploaded Source

Built Distributions

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

spooky_chess-0.9.0-cp314-cp314-manylinux_2_28_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

spooky_chess-0.9.0-cp314-cp314-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

spooky_chess-0.9.0-cp313-cp313-manylinux_2_28_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

spooky_chess-0.9.0-cp313-cp313-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

spooky_chess-0.9.0-cp312-cp312-manylinux_2_28_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

spooky_chess-0.9.0-cp312-cp312-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

spooky_chess-0.9.0-cp311-cp311-manylinux_2_28_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

spooky_chess-0.9.0-cp311-cp311-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file spooky_chess-0.9.0.tar.gz.

File metadata

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

File hashes

Hashes for spooky_chess-0.9.0.tar.gz
Algorithm Hash digest
SHA256 c896c77a6a2068b2ebfd5228e9461f26a7e153bc416aeb6a4ca9c231381a08ed
MD5 b513d90fe45d0bf3af027f4be71d3b8d
BLAKE2b-256 b24afc1dc1c47bc284e1ba0978e8588c42b9491d9779ea1517b8150aa3441b91

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.9.0.tar.gz:

Publisher: publish.yml on snowdrop4/spooky-chess

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spooky_chess-0.9.0-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for spooky_chess-0.9.0-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 539c7e40bc63332c4740bccc1658da3744600ba913f0fcdb7310e119e100f831
MD5 63f780032bb63148169b23627ea49127
BLAKE2b-256 c1a06967eab4413d61e882d09168b7a6ef32136039e87174e4cb19ba2da41d1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.9.0-cp314-cp314-manylinux_2_28_x86_64.whl:

Publisher: publish.yml on snowdrop4/spooky-chess

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spooky_chess-0.9.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spooky_chess-0.9.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6c47860228e14afe777d76255572fac7a45b67e0d1ba34f580a24747bca16f42
MD5 fb049e5af12cf315e879b80431dfc087
BLAKE2b-256 cda790acbf0af998a37659e0dfb4995d7024a41b1a44ea823e6bc564355c47a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.9.0-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: publish.yml on snowdrop4/spooky-chess

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spooky_chess-0.9.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for spooky_chess-0.9.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 06d29cccef396bb0e231f8041cb761c38169266b4b549b190441ce366bc36eae
MD5 fd1b3f017b2884c123fe94bb5761aeaa
BLAKE2b-256 4824e0a08fe43342d2f10d418eef5a7dfe7de2237856874b5bfbad7114e2f9db

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.9.0-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: publish.yml on snowdrop4/spooky-chess

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spooky_chess-0.9.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spooky_chess-0.9.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e3a193bf8be3e808e51bf80f1b36e54847ea04556b26f07e151d192f5976d2d8
MD5 5d09b29b6b535bbb3f78ba1a19b1182f
BLAKE2b-256 7fd0d0ac6e73590ccba79fe1a420098c1fd733e994d88158d3fb9bd2901f6563

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.9.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: publish.yml on snowdrop4/spooky-chess

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spooky_chess-0.9.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for spooky_chess-0.9.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8c07b5fd6c5411b8eb0ac603de9688177f031ad847a8b2fb01fcc15381cbbdeb
MD5 0b796c1715d2b12a2c15cccc0ba20c58
BLAKE2b-256 e14a91fcf5f71e678dc11a90c8fafd92f9f45e4c5854da2acbef162bc29e4a59

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.9.0-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: publish.yml on snowdrop4/spooky-chess

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spooky_chess-0.9.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spooky_chess-0.9.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 830dba294a174a22bd77820e66aa1f6a4f0078d95adaba5b6659981b361ec6c8
MD5 e350f5c209da3d510b12028771bc78e2
BLAKE2b-256 00c401a540bc467c30ab9cb5101ffcafc08885d5f98a6612a82758ec1ee11f5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.9.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: publish.yml on snowdrop4/spooky-chess

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spooky_chess-0.9.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for spooky_chess-0.9.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a9855004fc22467f9eb950327dc50de20b005a14198a5abd2aa406a51bd1e0e5
MD5 623eaa92ae36827409cf5e56d219c10d
BLAKE2b-256 552c4b55ab5a7cca7488ece1891e996f8bb4ad913f222fa00e22de389c290199

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.9.0-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: publish.yml on snowdrop4/spooky-chess

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spooky_chess-0.9.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spooky_chess-0.9.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 735b8f64d1417926f122501a6824571f23cca3416c782b9d7f68966661348eeb
MD5 b24ffef18b1eed032f772c6af62c681c
BLAKE2b-256 706cb785a8e379d685c279d883ebb3f62b398b32296f7eea1b973df83741cf93

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.9.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: publish.yml on snowdrop4/spooky-chess

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