poker
poker copied to clipboard
PokerStars ClubHouse Games
I've been trying to parse some ClubHouse games to keep track of how a bunch of friends are doing (PokerStars statistics don't seem to be loading).
A club House game seems to have a slightly different format to the other game types I've seen.
PokerStars Home Game Hand #214296101572: {Club #32872232} Tournament #2905961235, $5.00+$1.25+$0.50 USD Hold'em No Limit - Level III (25/50) - 2020/05/22 21:56:50 WET [2020/05/22 16:56:50 ET] Table '2905961235 1' 9-max Seat #7 is the button
So I've amended the REGEX so accept the new pieces of information (Home Game, {Club #3940394}, factoring in the original timezone date, and a 3rd +$1.50 in the prize values (due to playing a knockout variant)
` _header_re = re.compile( r"""
^PokerStars.+?\s+ # Poker Room
Hand\s+\#(?P<ident>\d+):\s+ # Hand history id
(\{Club\s+\#(?P<club_ident>\d+)\}\s+)? # Club id
(Tournament\s+\#(?P<tournament_ident>\d+),\s+ # Tournament Number
((?P<freeroll>Freeroll)|( # buyin is Freeroll
\$?(?P<buyin>\d+(\.\d+)?) # or buyin
(\+\$?(?P<knockrake>\d+(\.\d+)?))? # knockout or rake value depends on how you're playing
(\+\$?(?P<rake>\d+(\.\d+)?))? # and rake if this is a knockout game
(\s+(?P<currency>[A-Z]+))? # and currency
))\s+
)?
(?P<game>.+?)\s+ # game
(?P<limit>(?:Pot\s+|No\s+|)Limit)\s+ # limit
(-\s+Level\s+(?P<tournament_level>\S+)\s+)? # Level (optional)
\(
(((?P<sb>\d+)/(?P<bb>\d+))|( # tournament blinds
\$(?P<cash_sb>\d+(\.\d+)?)/ # cash small blind
\$(?P<cash_bb>\d+(\.\d+)?) # cash big blind
(\s+(?P<cash_currency>\S+))? # cash currency
))
\)\s+
-\s+.+?\s+ # localized date
\[(?P<date>.+?)\] # ET date
""",
re.VERBOSE,
)`
This got rid of the error I was getting due to match(ident), but now I'm being told that the game type is incorrect but it's evaluating:
"[CLUB #3287223] TOURNAMENT #2905961235, $5.00+$1.25+$0.50 USD HOLD'EM"
rather than just the HOLD'EM piece.