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.

> cargo run --release
50000 random game playouts
  spooky_chess (Rust Bindings):
    moves:   4936906
    time:    2.27s
    moves/s: 2170269.40
> uv run python -m pytest -k test_compare_random_game_playout -s --run-slow
50000 random game playouts
  spooky_chess (Python Bindings):
    moves:   4936722
    time:    6.84s
    moves/s: 721542.27
  python-chess:
    moves:   4931439
    time:    113.83s
    moves/s: 43323.89
  Speedup: 16.64x

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.7.1.tar.gz (82.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.7.1-cp313-cp313-manylinux_2_28_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

spooky_chess-0.7.1-cp313-cp313-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

spooky_chess-0.7.1-cp312-cp312-manylinux_2_28_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

spooky_chess-0.7.1-cp312-cp312-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

spooky_chess-0.7.1-cp311-cp311-manylinux_2_28_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

spooky_chess-0.7.1-cp311-cp311-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: spooky_chess-0.7.1.tar.gz
  • Upload date:
  • Size: 82.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.7.1.tar.gz
Algorithm Hash digest
SHA256 1088adfe1b438d3aa3078673e56998e2c03179b590b7dc593b24083eaa80a763
MD5 73b1ea7cc2e47d6368c9a54a683dde31
BLAKE2b-256 4f8e4815aa32fb7e824b0261b418e47c798a47de76b49d21a4751e3580cbced7

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.7.1.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.7.1-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for spooky_chess-0.7.1-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f822b88b13eec7cee43538f59e9174371de4e524b57db7e4a8e620a76745c87f
MD5 9a36959434f40a04cdc5b11e493ba3ed
BLAKE2b-256 6c2054c02df28f5a09abc1204c622ad692e9fcf8e9d1f0ae9fbb05588de4642a

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.7.1-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.7.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spooky_chess-0.7.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 223dd77a192ade8984985900a503563e6548c74d53cad8c137ed41438e18a172
MD5 0ffa146b35ae3a51ee1668b5ef319469
BLAKE2b-256 70f00b09d5466332d15f82e151440e70902e50a756fc1c50fe089195f70d6c49

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.7.1-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.7.1-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for spooky_chess-0.7.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 feb63319c3b9cb38f95193596cf71a4f45a96f4e4c8ac5f3d3c59e7223968765
MD5 688a37fa6d019570251c03eb73009fbe
BLAKE2b-256 99dbd81c7dbe345866322230fec12095e4958e28d20f9e3b436896c496361f9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.7.1-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.7.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spooky_chess-0.7.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 96d56c736cdf822e359b92f1b11dfc838f4d446c545b72de114d2d842b70b4a9
MD5 e891e6cb6b9943cf3f94814cdf0ccb0a
BLAKE2b-256 e3d4b1865cf7590c13a37f356df43b4ec31ffb147ac79aac5bf66920dcc374e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.7.1-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.7.1-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for spooky_chess-0.7.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 61d65c07560a7053a7bdc662a0b90e49ba44dd776fa7bb125ffaba1b5f2206b7
MD5 04d60d65af3718d1e65915fcd682ab84
BLAKE2b-256 ed559c53efff0c724a05727a089112731a6f726050e2e3b9892a83ef74441584

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.7.1-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.7.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spooky_chess-0.7.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 68c8ce2fc2be86374557b740a4fea12961e5e362f39b3f705a3fb63bdaef367c
MD5 4253d67604a400eb1916c9ab6716be3b
BLAKE2b-256 5607eaecb33c32240156f43ea551685b6c526d309d29de9b95d520719720415e

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.7.1-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