pokerdf 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pokerdf/__init__.py +0 -0
- pokerdf/core/read_and_convert.py +254 -0
- pokerdf/main.py +79 -0
- pokerdf/regex/regex_execution.py +89 -0
- pokerdf/regex/regex_patterns.py +814 -0
- pokerdf/utils/strings.py +1 -0
- pokerdf/validation/pydantic_modules.py +42 -0
- pokerdf-1.0.0.dist-info/LICENSE +21 -0
- pokerdf-1.0.0.dist-info/METADATA +113 -0
- pokerdf-1.0.0.dist-info/RECORD +12 -0
- pokerdf-1.0.0.dist-info/WHEEL +4 -0
- pokerdf-1.0.0.dist-info/entry_points.txt +3 -0
pokerdf/utils/strings.py
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
PLATFORM = "PokerStars"
|
@@ -0,0 +1,42 @@
|
|
1
|
+
from pydantic import BaseModel
|
2
|
+
from datetime import datetime
|
3
|
+
|
4
|
+
|
5
|
+
class ValidateInput(BaseModel):
|
6
|
+
Modality: list[str]
|
7
|
+
TableSize: list[int]
|
8
|
+
BuyIn: list[str]
|
9
|
+
TournID: list[str]
|
10
|
+
TableID: list[str]
|
11
|
+
HandID: list[str]
|
12
|
+
LocalTime: list[datetime]
|
13
|
+
Level: list[str]
|
14
|
+
Ante: list[float | None]
|
15
|
+
Blinds: list[tuple[float, float]]
|
16
|
+
Owner: list[str]
|
17
|
+
OwnersHand: list[tuple[str, str]]
|
18
|
+
Playing: list[int]
|
19
|
+
Player: list[str]
|
20
|
+
Seat: list[int]
|
21
|
+
PostedAnte: list[float | None]
|
22
|
+
Position: list[str | None]
|
23
|
+
PostedBlind: list[float | None]
|
24
|
+
Stack: list[float | None]
|
25
|
+
PreflopAction: list[list[tuple[str, str]]]
|
26
|
+
FlopAction: list[list[tuple[str, str]]]
|
27
|
+
TurnAction: list[list[tuple[str, str]]]
|
28
|
+
RiverAction: list[list[tuple[str, str]]]
|
29
|
+
AnteAllIn: list[bool]
|
30
|
+
PreflopAllIn: list[bool]
|
31
|
+
FlopAllIn: list[bool]
|
32
|
+
TurnAllIn: list[bool]
|
33
|
+
RiverAllIn: list[bool]
|
34
|
+
BoardFlop: list[tuple[str, str, str] | tuple[()]]
|
35
|
+
BoardTurn: list[tuple[str, str, str, str] | tuple[()]]
|
36
|
+
BoardRiver: list[tuple[str, str, str, str, str] | tuple[()]]
|
37
|
+
ShowDown: list[tuple[str, str] | tuple[None, None]]
|
38
|
+
CardCombination: list[str | None]
|
39
|
+
Result: list[str]
|
40
|
+
Balance: list[float | None]
|
41
|
+
FinalRank: list[int]
|
42
|
+
Prize: list[float | None]
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2025 Murilo Amaral
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -0,0 +1,113 @@
|
|
1
|
+
Metadata-Version: 2.3
|
2
|
+
Name: pokerdf
|
3
|
+
Version: 1.0.0
|
4
|
+
Summary: Converts poker hand history files to pandas DataFrames.
|
5
|
+
Author: Murilo Amaral
|
6
|
+
Author-email: murilogmamaral@gmail.com
|
7
|
+
Requires-Python: >=3.11.5
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
9
|
+
Classifier: Programming Language :: Python :: 3.12
|
10
|
+
Classifier: Programming Language :: Python :: 3.13
|
11
|
+
Requires-Dist: joblib (==1.3.2)
|
12
|
+
Requires-Dist: mypy (>=0.0.0)
|
13
|
+
Requires-Dist: pandas (>=2.0.0)
|
14
|
+
Requires-Dist: pyarrow (>=16.1.0)
|
15
|
+
Requires-Dist: pydantic (>=2.8.0)
|
16
|
+
Requires-Dist: ruff (>=0.0.0)
|
17
|
+
Project-URL: homepage, https://gitlab.com/murilogmamaral/pokerdf
|
18
|
+
Project-URL: repository, https://gitlab.com/murilogmamaral/pokerdf
|
19
|
+
Description-Content-Type: text/markdown
|
20
|
+
|
21
|
+
# PokerDF
|
22
|
+
|
23
|
+
Converts poker hand history files into structured Pandas DataFrames, making it easier to analyze your games.
|
24
|
+
|
25
|
+
Fast and reliable, PokerDF is able to process 3,000 hand history files into _.parquet_ per minute, in a MacBook Air M2 with 8-core CPU.
|
26
|
+
|
27
|
+
Currently supports PokerStars. Make sure hand histories are saved in English.
|
28
|
+
|
29
|
+
## Introduction
|
30
|
+
|
31
|
+
Converting raw hand histories into structured data is the first step toward building a solid poker strategy and maximizing ROI. What are the optimal VPIP, PFR, and C-BET frequencies for No Limit Hold'em 6-Max? In which specific situations is a 3-Bet most profitable? When is bluffing a clear mistake? Once your data is organized in a Pandas DataFrame, the analytical explorations become unlimited, opening new possibilities to fine-tune your decision-making.
|
32
|
+
|
33
|
+
## Installation
|
34
|
+
```
|
35
|
+
pip install pokerdf
|
36
|
+
```
|
37
|
+
|
38
|
+
## Usage
|
39
|
+
Navigate to the folder where you want to save the output:
|
40
|
+
```
|
41
|
+
cd output_directory
|
42
|
+
```
|
43
|
+
Then, run the package like this:
|
44
|
+
```
|
45
|
+
pokerdf convert /path/to/handhistory/folder
|
46
|
+
```
|
47
|
+
|
48
|
+
Once the process is concluded, you will find something like this:
|
49
|
+
```
|
50
|
+
output_directory/
|
51
|
+
└── output/
|
52
|
+
└── 20250510-105423/
|
53
|
+
├── 20200607-T2928873630.parquet
|
54
|
+
├── 20200607-T2928880893.parquet
|
55
|
+
├── 20200607-T2928925240.parquet
|
56
|
+
├── 20200607-T2928950825.parquet
|
57
|
+
├── 20200607-T2928996127.parquet
|
58
|
+
├── 20200607-T2929005994.parquet
|
59
|
+
├── ...
|
60
|
+
├── fail.txt
|
61
|
+
└── success.txt
|
62
|
+
```
|
63
|
+
#### Details
|
64
|
+
1. Inside `output` you’ll find a subfolder named with the session ID, in this case, `20250510-105423`, containing all _.parquet_ files.
|
65
|
+
2. Each hand history file is converted into a _.parquet_ file with the exact same structure, allowing you to concatenate them seamlessly.
|
66
|
+
3. Each _.parquet_ file follows the naming convention _{DATE_OF_TOURNAMENT}-T{TOURNAMENT_ID}.parquet_.
|
67
|
+
4. The file `fail.txt` provides detailed information about any files that failed to process. This file is only generated if there are failures.
|
68
|
+
5. The file `success.txt` lists all successfully converted files.
|
69
|
+
|
70
|
+
## DataFrame structure
|
71
|
+
| Column | Description | Example | Data Type |
|
72
|
+
|-------------------|--------------------------------------------------------------|-----------------------------------|-----------------|
|
73
|
+
| Modality | The type of game being played | Hold'em No Limit | string |
|
74
|
+
| TableSize | Maximum number of players | 6 | int |
|
75
|
+
| BuyIn | The buy-in amount for the tournament | $4.60+$0.40 | string |
|
76
|
+
| TournID | Unique identifier for the tournament | 2928882649 | string |
|
77
|
+
| TableID | Unique identifier for the table inside a tournament | 10 | int |
|
78
|
+
| HandID | Unique identifier for the hand inside a tournament | 215024616736 | string |
|
79
|
+
| LocalTime | Local time when the hand was played | 2020-06-07 07:44:35 | datetime |
|
80
|
+
| Level | Level of the tournament | IV | string |
|
81
|
+
| Ante | Ante amount posted in the hand | 10.00 | float |
|
82
|
+
| Blinds | Big blind and small blind amounts | [10.0, 20.0] | list[float] |
|
83
|
+
| Owner | Owner of the hand history files | ownername | string |
|
84
|
+
| OwnersHand | Cards held by the owner in a specific hand | [9d, Js] | list[string] |
|
85
|
+
| Playing | Number of players active during the hand | 5 | int |
|
86
|
+
| Player | Player involved in the hand | playername | string |
|
87
|
+
| Seat | Seat number of the player | 3 | int |
|
88
|
+
| PostedAnte | Amount the player paid for the ante | 5.00 | float |
|
89
|
+
| PostedBlind | Amount the player paid for the blinds | 50.00 | float |
|
90
|
+
| Position | Player's position at the table | big blind | string |
|
91
|
+
| Stack | Current stack size of the player | 2500.00 | float |
|
92
|
+
| PreflopAction | Actions taken during the preflop stage | [[checks, ]] | list[list[str]] |
|
93
|
+
| FlopAction | Actions taken during the flop stage | [[bets, 840], [calls, 220]] | list[list[str]] |
|
94
|
+
| TurnAction | Actions taken during the turn stage | [[raises, 400], [calls, 500]] | list[list[str]] |
|
95
|
+
| RiverAction | Actions taken during the river stage | [[folds, ]] | list[list[str]] |
|
96
|
+
| AnteAllIn | Whether the player went all-in during the ante | True | bool |
|
97
|
+
| PreflopAllIn | Whether the player went all-in during preflop | False | bool |
|
98
|
+
| FlopAllIn | Whether the player went all-in during the flop | False | bool |
|
99
|
+
| TurnAllIn | Whether the player went all-in during the turn | False | bool |
|
100
|
+
| RiverAllIn | Whether the player went all-in during the river | False | bool |
|
101
|
+
| BoardFlop | Cards dealt on the flop | [4d, Qs, Ad] | list[string] |
|
102
|
+
| BoardTurn | Card dealt on the turn | [4d, Qs, Ad, 7d] | list[string] |
|
103
|
+
| BoardRiver | Card dealt on the river | [4d, Qs, Ad, 7d, 2d] | list[string] |
|
104
|
+
| ShowDown | Player's cards if went to showdown | [Ah, Ac] | list[string] |
|
105
|
+
| CardCombination | Card combination held by the player | three of a kind, Aces | string |
|
106
|
+
| Result | Result of the hand (folded, lost, mucked, non-sd win, won) | won | string |
|
107
|
+
| Balance | Total value won in a hand | 9150.25 | float |
|
108
|
+
| FinalRank | Player's final ranking in the tournament | 1 | int |
|
109
|
+
| Prize | Prize won by the player, if any | 30000.00 | float |
|
110
|
+
|
111
|
+
## License
|
112
|
+
MIT Licence
|
113
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
pokerdf/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
pokerdf/core/read_and_convert.py,sha256=RKrc4T2wdqOnsu_A1FkZsVQj4sQ_A3T3nbmksdYqexY,7058
|
3
|
+
pokerdf/main.py,sha256=wZNxv8Os29FErPSqwtW4EL6W9g7Hrs-3YrLNOUBfwUU,2609
|
4
|
+
pokerdf/regex/regex_execution.py,sha256=Z7rAJAk_VaeamJ6O-i_WqqSN7E2Bvds6zNKDqf9PWgk,3333
|
5
|
+
pokerdf/regex/regex_patterns.py,sha256=JENvc817pZFdFqdF8wpX6Ste8WVHBr6s-PLkKi8Krlo,22805
|
6
|
+
pokerdf/utils/strings.py,sha256=M67LK8HDsCRJbMosSpldAhkh7dJbvFm3P_cwCJJwABo,24
|
7
|
+
pokerdf/validation/pydantic_modules.py,sha256=sta6I4kOSpVVp1ztMds-6um6GKzHjmKJMdWWjVgi2vs,1302
|
8
|
+
pokerdf-1.0.0.dist-info/LICENSE,sha256=cwU1q-Z805EbGDpnov1ZMvOm_1FN9GHLUymwEy7poHM,1070
|
9
|
+
pokerdf-1.0.0.dist-info/METADATA,sha256=341-TwDhU7nUOsOLaSzTzRZZpfp8elWIYC1DdTTWcAw,8314
|
10
|
+
pokerdf-1.0.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
11
|
+
pokerdf-1.0.0.dist-info/entry_points.txt,sha256=Ut_cKkG47Nvu8xyWDuDLPo7qry4Wye_te9Y3LqWNwA8,45
|
12
|
+
pokerdf-1.0.0.dist-info/RECORD,,
|