semvec/pypi-packages huggingface dataset:
hearthstone 9.19.9
CardDefs.xml parser and Hearthstone enums for Python
Requires Python: >=3.6

# python-hearthstone

[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/hearthsim/python-hearthstone/ci.yml?branch=master)](https://github.com/HearthSim/python-hearthstone/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/hearthstone.svg)](https://pypi.org/project/hearthstone/)

A Hearthstone Python library containing:

* A CardDefs.xml parser (`hearthstone.cardxml`)
* A DbfXml parser (`hearthstone.dbf`)
* A deck code encoder and decoder (`hearthstone.deckstrings`)
* Hearthstone enums as IntEnum (`hearthstone.enums`)

The CardDefs.xml data for the latest build can optionally be installed from the
[python-hearthstone-data repository](https://github.com/HearthSim/python-hearthstone-data)
or on PyPI with `pip install hearthstone_data`. Otherwise, they will be download at runtime.


## Requirements

* Python 3.6+
* lxml

## Installation

* To install from PyPI: `pip install hearthstone`


## License

This project is licensed under the MIT license. The full license text is
available in the LICENSE file.


## Community

This is a [HearthSim](https://hearthsim.info) project.
Join the HearthSim Developer community [on Discord](https://discord.gg/hearthsim-devs).
polars-cactus 0.2.2
A Polars plugin to compute Poker hands
Requires Python: >=3.13

# polars-cactus

Implementation of the Cactus Kev Perfect Hash algorithm.

# Installation

## From PyPI

<pre>uv add polars-cactus</pre>

## From source

Requires [Rust](https://www.rust-lang.org/fr)

<pre>git clone https://github.com/Tijoxa/polars-cactus.git
cd polars-cactus
uv sync</pre>

# Usage

- Usage in Python:

```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
```

```Python
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

- [Cactus Kev Algorithm](https://suffe.cool/poker/evaluator.html)
- [Hash Tables](http://suffe.cool/poker/7462.html)