Skip to main content

Description

Xtreys(eXtended treys) is a lightweight add-on to the library Treys. Xtreys uses integers created from Treys to rank hole cards, calculate equity, etc.

Installation

First, open your terminal and run:

pip install git+https://github.com/bingchiliingsacker-dot/Xtreys.git

or:

pip install xtreys

Note: If you run into any issues installing or using Xtreys, feel free to open a ticket on the Issues tab!

Usages

One of Xtreys' goals is to evaluate hole cards only. Cards are ranked from 1 to 91 with 'A-A' or pocket Ace's being the strongest and a '2-7' being the weakest pair

The function for this is preflop_eval.

Here is a quick test to see if Xtreys is working:

from treys import Deck
from xtreys import preflop_eval

d = Deck()
cards = d.draw(2)

rank = preflop_eval(cards)
print(f"Pre-flop hand rank:\t{rank}") #Output: Pre-flop hand rank:    1-91

Another usage of Xtreys is calculating the approximate and accurate equity of cards. approximate_equity gives an approximate equity from 0.1(lowest) to 0.9(highest).

Heres a quick test:

from xtreys import approximate_equity

d = Deck()

cards = d.draw(2)
flop_board = d.draw(3)
turn_card, river_card = d.draw(1), d.draw(1)

turn_board = flop_board + turn_card
river_board = flop_board + river_card

flop_equity = approximate_equity(cards, flop_board)

print('---Flop---')
print(f'Approximate equity:\t{flop_equity}')
print('')

turn_equity = approximate_equity(cards, turn_board)

print('---Turn---')
print(f'Approximate equity:\t{turn_equity}')
print('')

river_equity = approximate_equity(cards, river_board)

print('---River---')
print(f'Approximate equity:\t{river_equity}')

'''
Output:
---Flop---
Approximate equity:     0.2

---Turn---
Approximate equity:     0.3

---River---
Approximate equity:     0.2
'''

Accurate equity outputs a much more pinpoint equity than approximate equity, it needs a cards variable of type list[int], a board variable of type list[int], and how many Monte-Carlo simulations you want to make(default=50).

Heres a quick test for accurate_equity:

from xtreys import accurate_equity
d = Deck()

cards = d.draw(2)
flop_board = d.draw(3)
turn_card, river_card = d.draw(1), d.draw(1)

turn_board = flop_board + turn_card

flop_equity = accurate_equity(cards, flop_board, 100)

print('---Flop---')
print(f'Accurate equity:\t{flop_equity:.2f}')
print('')

turn_equity = accurate_equity(cards, turn_board, 150)

print('---Turn---')
print(f'Accurate equity:\t{turn_equity:.2f}')
print('')

river_equity = accurate_equity(cards, river_board)

print('---River---')
print(f'Accurate equity:\t{river_equity:.2f}')
river_board = flop_board + river_card

'''
Output:

---Flop---
Accurate equity:        0.54

---Turn---
Accurate equity:        0.39

---River---
Accurate equity:        0.30
'''

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xtreys-0.2.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xtreys-0.2.2-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file xtreys-0.2.2.tar.gz.

File metadata

  • Download URL: xtreys-0.2.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for xtreys-0.2.2.tar.gz
Algorithm Hash digest
SHA256 b16cfc720a31671032be3ac476540084cac14f121a4db8f3b6d6d079772f3fbf
MD5 8f6805ec5c96e7d16b9b4c967a8d0297
BLAKE2b-256 bcc51af6fd05122615edb105f41db532be43615d92afeed9c87276d25b09a1c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for xtreys-0.2.2.tar.gz:

Publisher: python-publish.yml on bingchiliingsacker-dot/Xtreys

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xtreys-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: xtreys-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for xtreys-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 785edf514dfadf648fe07a19456c0d977e0844a919586f3e0ad80be914cd87e7
MD5 25a4a4a1a9781a190f9b6453af0ee750
BLAKE2b-256 fcbe987db1ced1d2b181083c4d9dd4047125ab3228feebbe025907b0d8280e91

See more details on using hashes here.

Provenance

The following attestation bundles were made for xtreys-0.2.2-py3-none-any.whl:

Publisher: python-publish.yml on bingchiliingsacker-dot/Xtreys

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.43

2 files

0.2.42

2 files

0.2.41

2 files

0.2.4

2 files

0.2.3

2 files

This release

0.2.2 This release

2 files

0.2.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page