예제 #1
0
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
예제 #2
0
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
예제 #3
0
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()
예제 #4
0
#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
예제 #5
0
def get_parsed_flop_hand14():
    hand_text = stars_hands.HAND14
    hh = PokerStarsHandHistory(hand_text)
    hh.parse()
    return hh
예제 #6
0
def get_parsed_hand():
    hand_text = stars_hands.HAND12
    hh = PokerStarsHandHistory(hand_text)
    hh.parse()
    return hh
예제 #7
0
파일: conftest.py 프로젝트: icyblade/poker
def all_stars_hands(request):
    """Parse all hands from test_data and returns a PokerStarsHandHistory instance."""
    hh = PokerStarsHandHistory(request.param)
    hh.parse()
    return hh
예제 #8
0
파일: conftest.py 프로젝트: lmacken/poker
def all_stars_hands(request):
    """Parse all hands from test_data and returns a PokerStarsHandHistory instance."""
    hh = PokerStarsHandHistory(request.param)
    hh.parse()
    return hh
예제 #9
0
def test_no_hero():
    hh = PokerStarsHandHistory(stars_hands.HAND6)
    hh.parse()
예제 #10
0
파일: test_stars.py 프로젝트: kakty3/poker
 def hand(hand_text):
     hh = PokerStarsHandHistory(hand_text)
     hh.parse()
     return hh