Poker Api Javascript

Posted onby

This package contains mostly scraping tools for well known websites like Two Plus Two forum,Pocketsfives, etc…

Beginning with version 4.20, the Poker Mavens API contains an option to return responses from the server in JSON format. This allows the entire result to be assigned to a single object in your code and replaces the repetitive parameter names with simple arrays. The getRegistrations method of the ServiceWorkerContainer interface gets all ServiceWorkerRegistrations associated with a ServiceWorkerContainer, in an array. The method returns a Promise that resolves to an array of ServiceWorkerRegistration. Jan 26, 2016 At Auth0 we use JavaScript heavily. Using our authentication and authorization server from your JavaScript web apps is a piece of cake. Here's one simple example using ECMAScript 2015 features and the Auth0.js library. This is the main client-side script to authenticate and authorize a user to access an API.

Two Plus Two Forum API¶

poker.website.twoplustwo.FORUM_URL
Poker Api Javascript
poker.website.twoplustwo.FORUM_MEMBER_URL
class poker.website.twoplustwo.ForumMember(username)[source]

Download and store a member data from the Two Plus Two forum.

Parameters:

id (int,str) –

Forum id (last part of members URL, e.g. in case of
the id is 407153)
Variables:
  • id (str) – Forum id
  • username (str) – Forum username
  • rank (str) – Forum rank like 'enthusiast'
  • profile_picture (str,None) – URL of profile if set.
  • location (str) – Location (country)
  • total_posts (int) – Total posts
  • posts_per_day (float) – Posts per day on account page
  • last_activity (datetime) – Last activity with the website timezone
  • join_date (date) – Join date on account page
  • public_usergroups (tuple) – Public usergroup permission as in the box on the top right
  • donwload_date (datetime) – When were the data downloaded from TwoplusTwo

Pocketfives API¶

class poker.website.pocketfives._Player(name, country, triple_crowns, monthly_win, biggest_cash, plb_score, biggest_score, average_score, previous_rank)[source]

Pocketfives player data.

Variables:
  • name (str) – Player name
  • country (str) – Country name
  • triple_crowns (int) – Number of triple crowns won
  • monthly_win (int) –
  • biggest_cash (str) –
  • plb_score (float) –
  • biggest_score (float) – Biggest Pocketfives score
  • average_score (float) – Average pocketfives score
  • previous_rank (str) – Previous pocketfives rank
poker.website.pocketfives.get_ranked_players()[source]

Get the list of the first 100 ranked players.

Returns:generator of _Players

PokerStars website API¶

poker.website.pokerstars.WEBSITE_URL
Poker Api Javascript
poker.website.pokerstars.TOURNAMENTS_XML_URL
poker.website.pokerstars.STATUS_URL
poker.website.pokerstars.get_current_tournaments()[source]

Get the next 200 tournaments from pokerstars.

Returns:generator of _Tournament

Note

Downloading this list is an extremly slow operation!

poker.website.pokerstars.get_status()[source]

Get pokerstars status: players online, number of tables, etc.

Returns:_Status
class poker.website.pokerstars._Tournament(start_date, name, game, buyin, players)[source]

Upcoming pokerstars tournament.

Variables:
  • start_date (datetime) –
  • name (str) – Tournament name as seen in PokerStars Lobby
  • game (str) – Game Type
  • buyin (str) – Buy in with fee
  • players (int) – Number of players already registered
class poker.website.pokerstars._Status(updated, tables, next_update, players, clubs, active_tournaments, total_tournaments, sites, club_members)[source]

PokerStars status.

Variables:
  • updated (datetime) – Status last updated
  • tables (int) – Number of tournament tables
  • players (int) – Number of players logged in to PokerStars
  • clubs (int) – Total number of Home Game clubs created
  • club_members (int) – Total number of Home Game club members
  • active_tournaments (int) –
  • total_tournaments (int) –
  • sites (tuple) – Tuple of _SiteStatus
class poker.website.pokerstars._SiteStatus(id, tables, players, active_tournaments)[source]

PokerStars status on different subsites like FR, ES IT or Play Money.

Variables:
  • id (str) – ID of the site ('.IT', '.FR', 'PlayMoney')
  • tables (int) –
  • player (int) –
  • active_tournaments (int) –

Shape¶

class poker.hand.Shape[source]

An enumeration.

See: Shape

Poker Api Javascript Server

Warning

This might be removed in future version for simplify API.

Hand¶

class poker.hand.Hand(hand)[source]

General hand without a precise suit. Only knows about two ranks and shape.

Parameters:

hand (str) – e.g. ‘AKo’, ‘22’

Variables:
  • first (Rank) – first Rank
  • second (Rank) – second Rank
  • shape (Shape) – Hand shape (pair, suited or offsuit)
rank_difference

The difference between the first and second rank of the Hand.

Type:int
first
Type:poker.card.Rank
second
Type:poker.card.Rank
shape
Type:Shape
is_broadway
is_connector
is_offsuit
is_one_gapper
is_pair
is_suited
is_suited_connector
is_two_gapper
to_combos()[source]
poker.hand.PAIR_HANDS = (Hand('22'), Hand('33'), Hand('44'), Hand('55'), Hand('66'), Hand('77'), Hand('88'), Hand('99'), Hand('TT'), Hand('JJ'), Hand('QQ'), Hand('KK'), Hand('AA'))

Tuple of all pair hands in ascending order.

poker.hand.OFFSUIT_HANDS = (Hand('32o'), Hand('42o'), Hand('43o'), Hand('52o'), Hand('53o'), Hand('54o'), Hand('62o'), Hand('63o'), Hand('64o'), Hand('65o'), Hand('72o'), Hand('73o'), Hand('74o'), Hand('75o'), Hand('76o'), Hand('82o'), Hand('83o'), Hand('84o'), Hand('85o'), Hand('86o'), Hand('87o'), Hand('92o'), Hand('93o'), Hand('94o'), Hand('95o'), Hand('96o'), Hand('97o'), Hand('98o'), Hand('T2o'), Hand('T3o'), Hand('T4o'), Hand('T5o'), Hand('T6o'), Hand('T7o'), Hand('T8o'), Hand('T9o'), Hand('J2o'), Hand('J3o'), Hand('J4o'), Hand('J5o'), Hand('J6o'), Hand('J7o'), Hand('J8o'), Hand('J9o'), Hand('JTo'), Hand('Q2o'), Hand('Q3o'), Hand('Q4o'), Hand('Q5o'), Hand('Q6o'), Hand('Q7o'), Hand('Q8o'), Hand('Q9o'), Hand('QTo'), Hand('QJo'), Hand('K2o'), Hand('K3o'), Hand('K4o'), Hand('K5o'), Hand('K6o'), Hand('K7o'), Hand('K8o'), Hand('K9o'), Hand('KTo'), Hand('KJo'), Hand('KQo'), Hand('A2o'), Hand('A3o'), Hand('A4o'), Hand('A5o'), Hand('A6o'), Hand('A7o'), Hand('A8o'), Hand('A9o'), Hand('ATo'), Hand('AJo'), Hand('AQo'), Hand('AKo'))

Tuple of offsuit hands in ascending order.

poker.hand.SUITED_HANDS = (Hand('32s'), Hand('42s'), Hand('43s'), Hand('52s'), Hand('53s'), Hand('54s'), Hand('62s'), Hand('63s'), Hand('64s'), Hand('65s'), Hand('72s'), Hand('73s'), Hand('74s'), Hand('75s'), Hand('76s'), Hand('82s'), Hand('83s'), Hand('84s'), Hand('85s'), Hand('86s'), Hand('87s'), Hand('92s'), Hand('93s'), Hand('94s'), Hand('95s'), Hand('96s'), Hand('97s'), Hand('98s'), Hand('T2s'), Hand('T3s'), Hand('T4s'), Hand('T5s'), Hand('T6s'), Hand('T7s'), Hand('T8s'), Hand('T9s'), Hand('J2s'), Hand('J3s'), Hand('J4s'), Hand('J5s'), Hand('J6s'), Hand('J7s'), Hand('J8s'), Hand('J9s'), Hand('JTs'), Hand('Q2s'), Hand('Q3s'), Hand('Q4s'), Hand('Q5s'), Hand('Q6s'), Hand('Q7s'), Hand('Q8s'), Hand('Q9s'), Hand('QTs'), Hand('QJs'), Hand('K2s'), Hand('K3s'), Hand('K4s'), Hand('K5s'), Hand('K6s'), Hand('K7s'), Hand('K8s'), Hand('K9s'), Hand('KTs'), Hand('KJs'), Hand('KQs'), Hand('A2s'), Hand('A3s'), Hand('A4s'), Hand('A5s'), Hand('A6s'), Hand('A7s'), Hand('A8s'), Hand('A9s'), Hand('ATs'), Hand('AJs'), Hand('AQs'), Hand('AKs'))

Tuple of suited hands in ascending order.

Combo¶

class poker.hand.Combo[source]

Hand combination.

See Combo

first
Type:poker.card.Card
second
Type:poker.card.Card
shape
Type:Shape
classmethod from_cards(first, second)[source]
is_broadway
is_connector
is_offsuit
is_one_gapper
is_pair
is_suited
is_suited_connector
is_two_gapper
rank_difference

The difference between the first and second rank of the Combo.

to_hand()[source]

Convert combo to Hand object, losing suit information.

Range¶

class poker.hand.Range(range=')[source]

Parses a str range into tuple of Combos (or Hands).

Parameters:range (str) – Readable range in unicode

Note

All of the properties below are cached_property, so make sure you invalidate the cache if you manipulate them!

hands

Tuple of hands contained in this range. If only one combo of the same hand is present,it will be shown here. e.g. Range('2s2c').hands(Hand('22'),)

Type:tuple of poker.hand.Hands
combos
Type:tuple of poker.hand.Combos

Poker Api Javascript Games

percent

What percent of combos does this range have compared to all the possible combos.

Javascript

There are 1326 total combos in Hold’em: 52 * 51 / 2 (because order doesn’t matter)Precision: 2 decimal point

Poker Api Javascript Course

Type:float (1-100)
rep_pieces
Api

List of str pieces how the Range is represented.

Type:list of str
to_html()[source]

Returns a 13x13 HTML table representing the range.

The table’s CSS class is range, pair cells (td element) are pair, offsuit hands areoffsuit and suited hand cells has suited css class.The HTML contains no extra whitespace at all.Calculating it should not take more than 30ms (which takes calculating a 100% range).

Return type:str

Poker Api Javascript Server

to_ascii(border=False)[source]

Returns a nicely formatted ASCII table with optional borders.

Return type:str
classmethod from_file(filename)[source]

Creates an instance from a given file, containing a range.It can handle the PokerCruncher (.rng extension) format.

Poker Api Javascript Games

classmethod from_objects(iterable)[source]

Make an instance from an iterable of Combos, Hands or both.

Poker Api Javascript Download

slots = ('_hands', '_combos')