Skip to main content

Rust poker library

Project description

RustPoker

Build Status docs.rs crates.io

A poker library written in rust.

  • Multithreaded range vs range equity calculation
  • Fast hand evaluation
  • Efficient hand indexing

Developing Bindings

Use virtual env virtualenv .venv.

Enable the envirnmoent source .venv/bin/activate

Run maturin develop to create ptyhon lib with bindings, it will automatically put it inside the python packages dir.

To test out point the ipynb notebooks kernel to virtualenv and then just run the package.

To install pytohn packages pip install poetry && poetry install --no-root

Hand Evaluator

Evaluates the strength of any poker hand using up to 7 cards.

Usage

import pyrust_poker

keep_cards_mask = np.zeros(shape=(2, 52), dtype=np.uint64)

keep_cards_mask[0, [0, 4, 8, 12, 48]] = 1 # 36865 - straight flush 5 high
keep_cards_mask[1, [48, 44, 40, 36, 32]] = 1 # 36874 - straight flush S high

pyrust_poker.get_hand_strengths(keep_cards_mask)

Equity Calculator

Calculates the range vs range equities for up to 6 different ranges specified by equilab-like range strings. Supports monte-carlo simulations and exact equity calculations

Credit

The hand evaluator and equity calculator library is a rust rewrite of zekyll's C++ equity calculator, OMPEval

License

This project is MIT Licensed

Copyright (c) 2020 Kyle Murphy

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

pyrust_poker-0.2.1.tar.gz (56.2 kB view details)

Uploaded Source

Built Distribution

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

pyrust_poker-0.2.1-cp312-cp312-manylinux_2_34_x86_64.whl (243.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

File details

Details for the file pyrust_poker-0.2.1.tar.gz.

File metadata

  • Download URL: pyrust_poker-0.2.1.tar.gz
  • Upload date:
  • Size: 56.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.7.8

File hashes

Hashes for pyrust_poker-0.2.1.tar.gz
Algorithm Hash digest
SHA256 878fe6b6e2dd49e349f6884b7f2142ba80d65e338d28c27bd80c52ab6b723920
MD5 c42d02ae46c15108c548bfb126dff27c
BLAKE2b-256 28426fe327635ac73b1a1eba69c5c971116869cb4905022a1a67293b821e8b0c

See more details on using hashes here.

File details

Details for the file pyrust_poker-0.2.1-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pyrust_poker-0.2.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a11fd4a0ff28c62b207794f4cd88325387ccebec6d14cb2e408251347b948060
MD5 736ba06099b1ed628ac9ee92ae697606
BLAKE2b-256 fb9cebf37a170c7c001685abe07fcdd42116e0ae094746de870e850720e21041

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