Skip to main content

Python bindings for the Sanqi Rust engine

Project description

sanqi-python

Python bindings for the Sanqi Rust engine.

Build

From crates/sanqi-python:

maturin develop

Or build a wheel:

maturin build

Example

import sanqi_python as sanqi

position = sanqi.Position.initial()
print(position.legal_moves()[:5])

move = position.best_move(2)
if move is not None:
    svg = position.svg_for_move(move)
    position.apply_move(move)

Exposed API

  • Position.initial()
  • Position.empty("white" | "black")
  • Position.legal_moves()
  • Position.is_legal_move(move)
  • Position.apply_move(move)
  • Position.piece_at(square)
  • Position.set_piece(color, square)
  • Position.clear_square(square)
  • Position.piece_count(color)
  • Position.ascii_board()
  • Position.svg_board()
  • Position.svg_for_move(move)
  • Position.best_move(depth)
  • Position.evaluate()
  • Position.outcome()
  • Position.supporting_pivots(move)

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

sanqi_python-0.1.0.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

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

sanqi_python-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl (321.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

File details

Details for the file sanqi_python-0.1.0.tar.gz.

File metadata

  • Download URL: sanqi_python-0.1.0.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sanqi_python-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4c879d97aa88c06cca6c3c811b3224527ae3245b560ac74b67e0ac0d9c39f13b
MD5 31bdbc417ea3d560eb1cc04ce10aeaa6
BLAKE2b-256 a24675d22a3e4837147da33988f22a36ec15089ecc7d0edcbf9611b10b71a03a

See more details on using hashes here.

Provenance

The following attestation bundles were made for sanqi_python-0.1.0.tar.gz:

Publisher: release-python.yml on curoli/sanqi

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

File details

Details for the file sanqi_python-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for sanqi_python-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5c47ace96818bb968fa5877f2e447b555a3e2574d4341827742adf8994d253fe
MD5 d7a98ccc83cb79e36a5231410add532c
BLAKE2b-256 29a8cff14f35248b994e12b7fba9eeb6a57bec32d356525ba4319fd3e49b2974

See more details on using hashes here.

Provenance

The following attestation bundles were made for sanqi_python-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl:

Publisher: release-python.yml on curoli/sanqi

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