Skip to main content

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


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.2.tar.gz (57.6 kB view details)

Uploaded Source

Built Distribution

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

polars_cactus-0.2.2-cp39-abi3-win_amd64.whl (4.8 MB view details)

Uploaded CPython 3.9+Windows x86-64

File details

Details for the file polars_cactus-0.2.2.tar.gz.

File metadata

  • Download URL: polars_cactus-0.2.2.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

Hashes for polars_cactus-0.2.2.tar.gz
Algorithm Hash digest
SHA256 229d5bd19874a9b1ac851d8936679b5c5121ca2cb6084556453bf87de733fdb1
MD5 54db52459ddbe46073955543be2559ee
BLAKE2b-256 add9c273a5a98cb98599f24b42c64d95feb5b5f5088e5869e6efce26d7a0a4b0

See more details on using hashes here.

File details

Details for the file polars_cactus-0.2.2-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: polars_cactus-0.2.2-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

Hashes for polars_cactus-0.2.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 460534ff24b9bbe8f60218dd3044bbe580cbaf4cf99cb8ccddd757c8c25ea7e2
MD5 69f59ef05312e88b217e2035635a0852
BLAKE2b-256 ef27aefba1f0d293ed4d84591b30a34bc39f9454c235ae4b85bdf13aea5d5972

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