def hand(request): """Parse handhistory defined in hand_text class attribute and returns a PokerStarsHandHistory instance. """ hh = PokerStarsHandHistory(request.instance.hand_text) hh.parse() return hh
def test_parse_all_hands(): for idx, hand in enumerate( {k: v for k, v in stars_hands.__dict__.items() if 'HAND' in k}.values()): print('HAND%s' % (idx + 1)) hh = PokerStarsHandHistory(hand) hh.parse()
#Ranges from poker import Range Range('XX').to_ascii() print(Range('22+ A2+ KT+ QJs+ 32 42 52 62 72').to_ascii()) #Hand history parsing from poker.room.pokerstars import PokerStarsHandHistory # First step, only raw hand history is saved, no parsing will happen yet hh = PokerStarsHandHistory(HAND1) #hh = PokerStarsHandHistory.from_file('C:\\Users\\Robin\\Desktop\\pkr2\\poker-1\\tests\handhistory\\2hand.txt') # You need to explicitly parse. This will parse the whole hh at once. hh.parse() #date in type: datetime a = hh.date #identification number of the hand b = hh.ident #what type was the game c = hh.game_type #what identification number has the tournament d = hh.tournament_ident #in what level, the hand appears e = hh.tournament_level
def get_parsed_flop_hand14(): hand_text = stars_hands.HAND14 hh = PokerStarsHandHistory(hand_text) hh.parse() return hh
def get_parsed_hand(): hand_text = stars_hands.HAND12 hh = PokerStarsHandHistory(hand_text) hh.parse() return hh
def all_stars_hands(request): """Parse all hands from test_data and returns a PokerStarsHandHistory instance.""" hh = PokerStarsHandHistory(request.param) hh.parse() return hh
def test_no_hero(): hh = PokerStarsHandHistory(stars_hands.HAND6) hh.parse()
def hand(hand_text): hh = PokerStarsHandHistory(hand_text) hh.parse() return hh