Metadata-Version: 2.4
Name: pkrbot
Version: 1.0.3
Summary: Fast poker hand evaluation library with eval7-compatible API
Home-page: https://github.com/bossbobster/pkrbot
Author: Bobby Costin
Author-email: 
License: MIT
Project-URL: Homepage, https://github.com/bossbobster/pkrbot
Keywords: poker,hand evaluation,eval7,cards,game,pokerbots
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Cython
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# pkrbot

Fast poker hand evaluator. Drop-in replacement for eval7, 2-3x faster.

## Install

```bash
pip install pkrbot
```

## Usage

```python
import pkrbot
import random

# Evaluate a hand
hand = [pkrbot.Card('As'), pkrbot.Card('Kh'), pkrbot.Card('Qd'), pkrbot.Card('Jc'), pkrbot.Card('Ts')]
result = pkrbot.evaluate(hand)
print(pkrbot.handtype(result))  # "Straight"

# Use a deck
deck = pkrbot.Deck()
deck.shuffle()
hand = deck.deal(7)
result = pkrbot.evaluate(hand)

# Use a set seed deck
rng = random.Random(42)
deck = pkrbot.Deck(seed=42)
deck.shuffle()            # will use seed 42
hand = deck.sample(7)     # will use seed 42 as well
deck_2 = pkrbot.Deck(rng) # will use seed 42, but with persisted random state in rng
print(pkrbot.handtype(pkrbot.evaluate(hand)))
```

## API

**Cards**: `pkrbot.Card('As')` - Ranks: `2-9, T, J, Q, K, A`, Suits: `c, d, h, s`

**Deck**: 
- `deck.shuffle()` - Randomize
- `deck.deal(n)` - Remove and return n cards
- `deck.peek(n)` - View top n cards
- `deck.sample(n)` - Get n random cards

**Evaluate**: `result = pkrbot.evaluate(hand)` - Higher values = better hands

**Hand Type**: `pkrbot.handtype(result)` - Returns: "Straight Flush", "Quads", "Full House", "Flush", "Straight", "Trips", "Two Pair", "Pair", "High Card"

## Performance

~2-3x faster than eval7. Optimized Cython with aggressive compiler flags.

## License

MIT
