# RustPoker
[![Build Status](https://travis-ci.org/kmurf1999/rust_poker.svg?branch=master)](https://travis-ci.org/kmurf1999/rust_poker)
[![docs.rs](https://docs.rs/rust_poker/badge.svg)](https://docs.rs/rust_poker)
[![crates.io](https://img.shields.io/crates/v/rust_poker.svg)](https://crates.io/crates/rust_poker)
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
```python
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 A 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](https://github.com/zekyll/OMPEval)
## License
This project is MIT Licensed
Copyright (c) 2020 Kyle Murphy
Raw data
{
"_id": null,
"home_page": null,
"name": "pyrust-poker",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "poker, python",
"author": "kmurf1999 <kwmurph2@asu.edu>",
"author_email": "kmurf1999 <kwmurph2@asu.edu>",
"download_url": "https://files.pythonhosted.org/packages/14/ea/91b7f1bc3899fc8bf6954a720e35bba9a3e2bbfe561f80c0a2e422096d15/pyrust_poker-0.2.3.tar.gz",
"platform": null,
"description": "# RustPoker\n\n[![Build Status](https://travis-ci.org/kmurf1999/rust_poker.svg?branch=master)](https://travis-ci.org/kmurf1999/rust_poker)\n[![docs.rs](https://docs.rs/rust_poker/badge.svg)](https://docs.rs/rust_poker)\n[![crates.io](https://img.shields.io/crates/v/rust_poker.svg)](https://crates.io/crates/rust_poker)\n\nA poker library written in rust.\n\n - Multithreaded range vs range equity calculation\n - Fast hand evaluation\n - Efficient hand indexing\n\n## Developing Bindings\n\nUse virtual env `virtualenv .venv`.\n\nEnable the envirnmoent `source .venv/bin/activate`\n\nRun `maturin develop` to create ptyhon lib with bindings, it will automatically put it inside the python packages dir.\n\nTo test out point the ipynb notebooks kernel to virtualenv and then just run the package.\n\nTo install pytohn packages `pip install poetry && poetry install --no-root`\n\n## Hand Evaluator\n\nEvaluates the strength of any poker hand using up to 7 cards.\n\n### Usage\n\n```python\nimport pyrust_poker\n\nkeep_cards_mask = np.zeros(shape=(2, 52), dtype=np.uint64)\n\nkeep_cards_mask[0, [0, 4, 8, 12, 48]] = 1 # 36865 - straight flush 5 high\nkeep_cards_mask[1, [48, 44, 40, 36, 32]] = 1 # 36874 - straight flush A high\n\npyrust_poker.get_hand_strengths(keep_cards_mask)\n```\n\n## Equity Calculator\n\nCalculates the range vs range equities for up to 6 different ranges specified by equilab-like range strings.\nSupports monte-carlo simulations and exact equity calculations\n\n## Credit\n\nThe hand evaluator and equity calculator library is a rust rewrite of **zekyll's** C++ equity calculator, [OMPEval](https://github.com/zekyll/OMPEval)\n\n## License\n\nThis project is MIT Licensed\n\nCopyright (c) 2020 Kyle Murphy\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Rust poker library",
"version": "0.2.3",
"project_urls": {
"Source Code": "https://github.com/Townsheriff/python_rust_poker"
},
"split_keywords": [
"poker",
" python"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "f03b9e2202691cf4cc629d00c80bde83876a971e4fc4c08eee669670332f9593",
"md5": "eff1b0a21f947eabac56a1eb458c06e9",
"sha256": "2e645c15287807741d31460f1535c03ff3cb34085e39989289fa411966e1bb31"
},
"downloads": -1,
"filename": "pyrust_poker-0.2.3-cp312-cp312-manylinux_2_34_x86_64.whl",
"has_sig": false,
"md5_digest": "eff1b0a21f947eabac56a1eb458c06e9",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.8",
"size": 243815,
"upload_time": "2024-12-22T15:27:52",
"upload_time_iso_8601": "2024-12-22T15:27:52.930834Z",
"url": "https://files.pythonhosted.org/packages/f0/3b/9e2202691cf4cc629d00c80bde83876a971e4fc4c08eee669670332f9593/pyrust_poker-0.2.3-cp312-cp312-manylinux_2_34_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "14ea91b7f1bc3899fc8bf6954a720e35bba9a3e2bbfe561f80c0a2e422096d15",
"md5": "7153bffa45015e7a52501d1fa3de2fd6",
"sha256": "6ac7fba6469f6e74564aee266cf03953d900797dc0fb797ba87d62dd50e292c4"
},
"downloads": -1,
"filename": "pyrust_poker-0.2.3.tar.gz",
"has_sig": false,
"md5_digest": "7153bffa45015e7a52501d1fa3de2fd6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 57521,
"upload_time": "2024-12-22T15:27:54",
"upload_time_iso_8601": "2024-12-22T15:27:54.885503Z",
"url": "https://files.pythonhosted.org/packages/14/ea/91b7f1bc3899fc8bf6954a720e35bba9a3e2bbfe561f80c0a2e422096d15/pyrust_poker-0.2.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-22 15:27:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Townsheriff",
"github_project": "python_rust_poker",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"lcname": "pyrust-poker"
}