pokerdf 1.0.1__py3-none-any.whl → 1.0.3__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/core/read_and_convert.py +39 -40
- pokerdf/regex/regex_execution.py +6 -6
- pokerdf/regex/regex_patterns.py +2 -5
- {pokerdf-1.0.1.dist-info → pokerdf-1.0.3.dist-info}/METADATA +2 -3
- pokerdf-1.0.3.dist-info/RECORD +12 -0
- pokerdf-1.0.1.dist-info/RECORD +0 -12
- {pokerdf-1.0.1.dist-info → pokerdf-1.0.3.dist-info}/LICENSE +0 -0
- {pokerdf-1.0.1.dist-info → pokerdf-1.0.3.dist-info}/WHEEL +0 -0
- {pokerdf-1.0.1.dist-info → pokerdf-1.0.3.dist-info}/entry_points.txt +0 -0
pokerdf/core/read_and_convert.py
CHANGED
@@ -53,46 +53,45 @@ def compose_dataframe() -> pd.DataFrame:
|
|
53
53
|
"""
|
54
54
|
# Compose default dataframe
|
55
55
|
df = pd.DataFrame(
|
56
|
-
|
57
|
-
"Modality",
|
58
|
-
"TableSize",
|
59
|
-
"BuyIn",
|
60
|
-
"TournID",
|
61
|
-
"TableID",
|
62
|
-
"HandID",
|
63
|
-
"LocalTime",
|
64
|
-
"Level",
|
65
|
-
"Ante",
|
66
|
-
"Blinds",
|
67
|
-
"Owner",
|
68
|
-
"OwnersHand",
|
69
|
-
"Playing",
|
70
|
-
"Player",
|
71
|
-
"Seat",
|
72
|
-
"PostedAnte",
|
73
|
-
"Position",
|
74
|
-
"PostedBlind",
|
75
|
-
"Stack",
|
76
|
-
"PreflopAction",
|
77
|
-
"FlopAction",
|
78
|
-
"TurnAction",
|
79
|
-
"RiverAction",
|
80
|
-
"AnteAllIn",
|
81
|
-
"PreflopAllIn",
|
82
|
-
"FlopAllIn",
|
83
|
-
"TurnAllIn",
|
84
|
-
"RiverAllIn",
|
85
|
-
"BoardFlop",
|
86
|
-
"BoardTurn",
|
87
|
-
"BoardRiver",
|
88
|
-
"ShowDown",
|
89
|
-
"CardCombination",
|
90
|
-
"Result",
|
91
|
-
"Balance",
|
92
|
-
"FinalRank",
|
93
|
-
"Prize",
|
94
|
-
|
95
|
-
data=None,
|
56
|
+
{
|
57
|
+
"Modality": pd.Series(dtype="object"),
|
58
|
+
"TableSize": pd.Series(dtype="int64"),
|
59
|
+
"BuyIn": pd.Series(dtype="object"),
|
60
|
+
"TournID": pd.Series(dtype="object"),
|
61
|
+
"TableID": pd.Series(dtype="object"),
|
62
|
+
"HandID": pd.Series(dtype="object"),
|
63
|
+
"LocalTime": pd.Series(dtype="datetime64[ns]"),
|
64
|
+
"Level": pd.Series(dtype="object"),
|
65
|
+
"Ante": pd.Series(dtype="float64"),
|
66
|
+
"Blinds": pd.Series(dtype="object"),
|
67
|
+
"Owner": pd.Series(dtype="object"),
|
68
|
+
"OwnersHand": pd.Series(dtype="object"),
|
69
|
+
"Playing": pd.Series(dtype="int64"),
|
70
|
+
"Player": pd.Series(dtype="object"),
|
71
|
+
"Seat": pd.Series(dtype="int64"),
|
72
|
+
"PostedAnte": pd.Series(dtype="float64"),
|
73
|
+
"Position": pd.Series(dtype="object"),
|
74
|
+
"PostedBlind": pd.Series(dtype="float64"),
|
75
|
+
"Stack": pd.Series(dtype="float64"),
|
76
|
+
"PreflopAction": pd.Series(dtype="object"),
|
77
|
+
"FlopAction": pd.Series(dtype="object"),
|
78
|
+
"TurnAction": pd.Series(dtype="object"),
|
79
|
+
"RiverAction": pd.Series(dtype="object"),
|
80
|
+
"AnteAllIn": pd.Series(dtype="bool"),
|
81
|
+
"PreflopAllIn": pd.Series(dtype="bool"),
|
82
|
+
"FlopAllIn": pd.Series(dtype="bool"),
|
83
|
+
"TurnAllIn": pd.Series(dtype="bool"),
|
84
|
+
"RiverAllIn": pd.Series(dtype="bool"),
|
85
|
+
"BoardFlop": pd.Series(dtype="object"),
|
86
|
+
"BoardTurn": pd.Series(dtype="object"),
|
87
|
+
"BoardRiver": pd.Series(dtype="object"),
|
88
|
+
"ShowDown": pd.Series(dtype="object"),
|
89
|
+
"CardCombination": pd.Series(dtype="object"),
|
90
|
+
"Result": pd.Series(dtype="object"),
|
91
|
+
"Balance": pd.Series(dtype="float64"),
|
92
|
+
"FinalRank": pd.Series(dtype="int64"),
|
93
|
+
"Prize": pd.Series(dtype="float64"),
|
94
|
+
}
|
96
95
|
)
|
97
96
|
return df
|
98
97
|
|
pokerdf/regex/regex_execution.py
CHANGED
@@ -4,7 +4,7 @@ from pokerdf.regex.regex_patterns import RegexPatterns
|
|
4
4
|
r = RegexPatterns()
|
5
5
|
|
6
6
|
|
7
|
-
def capture_common_data(
|
7
|
+
def capture_common_data(splitted_hand: list[str]) -> dict[str, Any]:
|
8
8
|
"""
|
9
9
|
Captures the common data of the tournament
|
10
10
|
|
@@ -15,11 +15,11 @@ def capture_common_data(hand: list[str]) -> dict[str, Any]:
|
|
15
15
|
dict: Dictionary of captured values.
|
16
16
|
"""
|
17
17
|
row: dict[str, Any] = {}
|
18
|
-
row["Modality"] = r.get_modality(
|
19
|
-
row["TableSize"] = r.get_table_size(
|
20
|
-
row["BuyIn"] = r.get_buyin(
|
21
|
-
row["TournID"] = r.get_tourn_id(
|
22
|
-
row["Owner"] = r.get_owner(
|
18
|
+
row["Modality"] = r.get_modality(splitted_hand)
|
19
|
+
row["TableSize"] = r.get_table_size(splitted_hand)
|
20
|
+
row["BuyIn"] = r.get_buyin(splitted_hand)
|
21
|
+
row["TournID"] = r.get_tourn_id(splitted_hand)
|
22
|
+
row["Owner"] = r.get_owner(splitted_hand)
|
23
23
|
|
24
24
|
return row
|
25
25
|
|
pokerdf/regex/regex_patterns.py
CHANGED
@@ -793,16 +793,13 @@ class RegexPatterns:
|
|
793
793
|
if hand != []:
|
794
794
|
|
795
795
|
# Pattern to extract
|
796
|
-
regex = rf"{player} .* (?:and receives|and received) (\
|
796
|
+
regex = rf"{player} .* (?:and receives|and received) (?:[$€£]?)\s*(\d+(?:\.\d+)?)"
|
797
797
|
|
798
798
|
# Get the first SHOW_DOWN content of a played hand
|
799
799
|
target = hand[0]
|
800
800
|
|
801
801
|
# Apply regex
|
802
|
-
|
803
|
-
|
804
|
-
# Normalize
|
805
|
-
final_result = [float(x) for x in result_of_regex if str(x).isdigit()]
|
802
|
+
final_result = re.findall(regex, target)[:1]
|
806
803
|
|
807
804
|
# Normalize output
|
808
805
|
if final_result == []:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: pokerdf
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.3
|
4
4
|
Summary: Converts poker hand history files to pandas DataFrames.
|
5
5
|
Author: Murilo Amaral
|
6
6
|
Author-email: murilogmamaral@gmail.com
|
@@ -14,8 +14,7 @@ Requires-Dist: pandas (>=2.0.0)
|
|
14
14
|
Requires-Dist: pyarrow (>=16.1.0)
|
15
15
|
Requires-Dist: pydantic (>=2.8.0)
|
16
16
|
Requires-Dist: ruff (>=0.0.0)
|
17
|
-
Project-URL:
|
18
|
-
Project-URL: repository, https://gitlab.com/murilogmamaral/pokerdf
|
17
|
+
Project-URL: repository, https://github.com/murilogmamaral/pokerdf
|
19
18
|
Description-Content-Type: text/markdown
|
20
19
|
|
21
20
|
# PokerDF
|
@@ -0,0 +1,12 @@
|
|
1
|
+
pokerdf/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
pokerdf/core/read_and_convert.py,sha256=52bfqszQ2STXBh4EFLyw8spieYm7Zus5iTdraHdVVC8,8029
|
3
|
+
pokerdf/main.py,sha256=wZNxv8Os29FErPSqwtW4EL6W9g7Hrs-3YrLNOUBfwUU,2609
|
4
|
+
pokerdf/regex/regex_execution.py,sha256=I5nbCiC-ulnf6ehh55hiSwdGwKGdmOwVEj5b348hzs0,3387
|
5
|
+
pokerdf/regex/regex_patterns.py,sha256=mYtLVx6IholDeygTeaIf8FEGwLgzOnBB8hCLhGvD1zY,22722
|
6
|
+
pokerdf/utils/strings.py,sha256=M67LK8HDsCRJbMosSpldAhkh7dJbvFm3P_cwCJJwABo,24
|
7
|
+
pokerdf/validation/pydantic_modules.py,sha256=sta6I4kOSpVVp1ztMds-6um6GKzHjmKJMdWWjVgi2vs,1302
|
8
|
+
pokerdf-1.0.3.dist-info/LICENSE,sha256=cwU1q-Z805EbGDpnov1ZMvOm_1FN9GHLUymwEy7poHM,1070
|
9
|
+
pokerdf-1.0.3.dist-info/METADATA,sha256=xJNvQbVliqc6JtkcPoMMMIPID1rzgRUhtvudWNvHWcU,12997
|
10
|
+
pokerdf-1.0.3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
11
|
+
pokerdf-1.0.3.dist-info/entry_points.txt,sha256=Ut_cKkG47Nvu8xyWDuDLPo7qry4Wye_te9Y3LqWNwA8,45
|
12
|
+
pokerdf-1.0.3.dist-info/RECORD,,
|
pokerdf-1.0.1.dist-info/RECORD
DELETED
@@ -1,12 +0,0 @@
|
|
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=9UV7K-ojFgUkmbdfBTmfYi_-qKT6OsSO4W5Btcy4gTc,22803
|
6
|
-
pokerdf/utils/strings.py,sha256=M67LK8HDsCRJbMosSpldAhkh7dJbvFm3P_cwCJJwABo,24
|
7
|
-
pokerdf/validation/pydantic_modules.py,sha256=sta6I4kOSpVVp1ztMds-6um6GKzHjmKJMdWWjVgi2vs,1302
|
8
|
-
pokerdf-1.0.1.dist-info/LICENSE,sha256=cwU1q-Z805EbGDpnov1ZMvOm_1FN9GHLUymwEy7poHM,1070
|
9
|
-
pokerdf-1.0.1.dist-info/METADATA,sha256=j49HeDSDZhvdf4nz1nOgl1mFFzv8EPAL9mvRGEUa8j4,13062
|
10
|
-
pokerdf-1.0.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
11
|
-
pokerdf-1.0.1.dist-info/entry_points.txt,sha256=Ut_cKkG47Nvu8xyWDuDLPo7qry4Wye_te9Y3LqWNwA8,45
|
12
|
-
pokerdf-1.0.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|