Skip to content

Commit

Permalink
Update docs to add bulk PHH read/write
Browse files Browse the repository at this point in the history
  • Loading branch information
AussieSeaweed committed Dec 26, 2024
1 parent 53db107 commit 3eb49ef
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions docs/notation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Reading hands
from pokerkit import *
# Hand loading
with open("...", "rb") as file:
# Load hand
with open("path/to/file.phh", "rb") as file:
hh = HandHistory.load(file)
# Create game
Expand All @@ -33,6 +33,20 @@ Reading hands
for state, action in hh.state_actions:
...
If you have multiple hands in a single file, they can be loaded together.

.. code-block:: python
from pokerkit import *
# Load hands
with open("path/to/file.phhs", "rb") as file:
hhs = HandHistory.load_all(file)
# Iterate through each hand history
for hh in hhs:
...
Logs from third-party platforms like online casinos or research environments can be loaded as well. Feel free to open an issue if incompatibilities are found.

Supported Platforms are tabulated below.
Expand Down Expand Up @@ -162,9 +176,21 @@ Writing Hands
hh.players = ["Patrik Antonius", "Viktor Blom"]
# Dump hand
with open("...", "wb") as file:
with open("path/to/file.phh", "wb") as file:
hh.dump(file)
If you have multiple hands, they can be dumped together in a single file.

.. code-block:: python
from pokerkit import *
hhs = [...]
# Dump hands
with open("path/to/file.phhs", "wb") as file:
HandHistory.dump_all(hhs, file)
Annual Computer Poker Competition (ACPC) Protocol
-------------------------------------------------

Expand Down

0 comments on commit 3eb49ef

Please sign in to comment.