Skip to content

Commit 5dd3017

Browse files
committed
Update tooling to include reading/loading bulk PHH files
1 parent 08d0651 commit 5dd3017

File tree

3 files changed

+39
-6
lines changed

3 files changed

+39
-6
lines changed

changelog.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changelog
22
=========
33

4+
Version 0.0.2 (December 26, 2024)
5+
----------------------------------
6+
7+
**Added**
8+
9+
- Example ``pokerkit`` usage for bulk PHH file reading and writing.
10+
411
Version 0.0.1 (September 19, 2024)
512
----------------------------------
613

conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
project = 'Poker Hand History File Format Specification'
1010
copyright = '2024, Juho Kim'
1111
author = 'Juho Kim'
12-
release = '0.0.1'
12+
release = '0.0.2'
1313

1414
# -- General configuration ---------------------------------------------------
1515
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

tooling.rst

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,34 @@ An example code snippet loading a PHH file in `PokerKit <https://doi.org/10.1109
1212
1313
from pokerkit import *
1414
15-
# Hand loading
16-
17-
with open("...", "rb") as file:
15+
# Load hand
16+
with open("path/to/file.phh", "rb") as file:
1817
hh = HandHistory.load(file)
1918
2019
# Iterate through each action step
21-
2220
for state in hh:
2321
...
22+
23+
An example code snippet loading a bulk PHH file in `PokerKit <https://doi.org/10.1109/TG.2023.3325637>`_ is shown below.
24+
25+
.. code-block:: python
26+
27+
from pokerkit import *
28+
29+
# Load hands
30+
with open("path/to/file.phhs", "rb") as file:
31+
hhs = HandHistory.load_all(file)
32+
33+
# Iterate through each hand history
34+
for hh in hhs:
35+
...
2436
2537
An example code snippet dumping a PHH file in `PokerKit <https://doi.org/10.1109/TG.2023.3325637>`_ is shown below. This hand, played between `Viktor Blom and Patrik Antonius <https://www.cardschat.com/news/10-largest-online-poker-pots-93487/>`_, holds the record for the largest online poker pot ever played.
2638

2739
.. code-block:: python
2840
2941
from pokerkit import *
42+
3043
A = Automation
3144
# Game state construction
3245
game = PotLimitOmahaHoldem(
@@ -75,6 +88,19 @@ An example code snippet dumping a PHH file in `PokerKit <https://doi.org/10.1109
7588
game, state,
7689
)
7790
hh.players = ["Patrik Antonius", "Viktor Blom"]
91+
7892
# Dump hand
79-
with open("...", "wb") as file:
93+
with open("path/to/file.phh", "wb") as file:
8094
hh.dump(file)
95+
96+
An example code snippet dumping a bulk PHH file in `PokerKit <https://doi.org/10.1109/TG.2023.3325637>`_ is shown below.
97+
98+
.. code-block:: python
99+
100+
from pokerkit import *
101+
102+
hhs = [...]
103+
104+
# Dump hands
105+
with open("path/to/file.phhs", "wb") as file:
106+
HandHistory.dump_all(hhs, file)

0 commit comments

Comments
 (0)