A Polars plugin to compute Poker hands
Project description
polars-cactus
Implementation of the Cactus Kev Perfect Hash algorithm.
Installation
From source
Requires Rust
git clone https://github.com/Tijoxa/polars-cactus.git cd polars-cactus uv sync
From PyPI (not yet)
uv add polars-cactus
Usage
- Usage in Python:
import polars_cactus as plc
plc.evaluate("AC", "4C", "5C", "TC", "AH")
>>> 3484
plc.evaluate_7("AC", "4C", "5C", "TC", "AH", "9H", "7S")
>>> 3463
import polars as pl
import polars_cactus as plc
df = pl.DataFrame(
{
"cards": pl.Series(
[
["9H", "8H", "7H", "6H", "TH"],
["AC", "4C", "5C", "TC", "AH"],
]
)
}
)
df.select(plc.col("cards").cactus.evaluate_5cards_str())
>>> pl.Series([5, 3484], dtype=pl.UInt32)
Source
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
polars_cactus-0.2.0.tar.gz
(57.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file polars_cactus-0.2.0.tar.gz.
File metadata
- Download URL: polars_cactus-0.2.0.tar.gz
- Upload date:
- Size: 57.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cef70a06cd4cfcf72467d12fba17ec15801a98757e973f44d9d9a455660cf7e4
|
|
| MD5 |
dd1074b3bfea3aa3f512f69ea12c2d81
|
|
| BLAKE2b-256 |
f4e000d28c970dd975c1f575bac0ba3e826e9410b4c34b9282be218bdd5f8948
|
File details
Details for the file polars_cactus-0.2.0-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: polars_cactus-0.2.0-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 4.8 MB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3782683b75e885bebf5129fd4cdb7fee3dc82d4347fab39c3d5a24496f3a7a01
|
|
| MD5 |
d85978b7bb1664f0254ba560e8cb35f8
|
|
| BLAKE2b-256 |
24be419106b2cee3fce8bb828d7c8391ef5836e537039b310dd707bd0f964164
|