A Polars plugin to compute Poker hands
Project description
polars-cactus
Implementation of the Cactus Kev Perfect Hash algorithm.
Installation
From PyPI
uv add polars-cactus
From source
Requires Rust
git clone https://github.com/Tijoxa/polars-cactus.git cd polars-cactus uv sync
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.1.tar.gz
(57.6 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.1.tar.gz.
File metadata
- Download URL: polars_cactus-0.2.1.tar.gz
- Upload date:
- Size: 57.6 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 |
ae516b115fb19f17a5d8ae88bed3e5b5e5fe9f83c8839cca8e0226fe0fee6f72
|
|
| MD5 |
4cb7bfe78e8ffdb8627f8529300ae97f
|
|
| BLAKE2b-256 |
240582fd73f0b044be7118c12f88451119505ba08df52cbc6936922c10e1d443
|
File details
Details for the file polars_cactus-0.2.1-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: polars_cactus-0.2.1-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 |
90cf79fc5bde134f85c4ca73004d4e54ba5a72810806468f8dda1342f9c0b615
|
|
| MD5 |
fe661956874c0cfa34c83e8e432f208a
|
|
| BLAKE2b-256 |
c73f2fde597b2b190ea9f1d0482da273c8a5cdb886c1cd97ac448d2a5f7bf7de
|