py-pokernow
A Python library for primarily interacting with pokernow.club's club API.
Features
- Club Management: Create and manage poker clubs (chips, games, etc)
- 🔐 Authentication: Easy login through api
🎮 Play API: Maybe one day
Contributing
If someone could actually implement the api/websocket for playing, you would be the goat.
Installation
pip install py-pokernow
Quick Start
from pokernow import PokerNowSession
# Initialize session with your authentication token
session = PokerNowSession(apt_token="your_apt_token_here")
# Get club information
club = session.get_club("your-club-slug")
print(f"Club: {club.name}")
print(f"Players: {len(club.players)}")
print(f"Total chips: {club.total_chips_in_club()}")
# Add chips to a player using the club object.
# Chip operations take the player's NETWORK user id (player.user_id),
# not the club player id (player.id).
player = club.get_player_by_username("player_name")
if player:
club.add_chips_to_player(
user_id=player.user_id,
amount=1000,
reason="Bonus chips"
)
# Create a new game using the club object
from pokernow import PokerGameConfig
config = PokerGameConfig(
name="High Stakes",
small_blind=50,
big_blind=100,
maxQuantityPlayers='9',
gameType='th' # Texas Hold'em
)
game_id = club.create_game(config)
print(f"Created game: {game_id}")
Core Classes
PokerNowSession
Main session class for API interactions.
session = PokerNowSession(apt_token="your_token", timeout=30) # timeout optional
PokerNowClub
Represents a poker club with all its data.
club = session.get_club("club-slug")
print(club.name)
print(club.description)
print(club.players) # List of PokerNowPlayer objects
print(club.games) # List of PokerNowGame objects
PokerNowPlayer
Represents a player in the club.
player = club.get_player_by_username("username")
print(player.chips_balance)
print(player.club_role)
print(player.credit_limit)
PokerNowGame
Represents a game/table.
game = club.games[0]
print(game.custom_table_name)
print(game.small_blind, game.big_blind)
print(game.status)
PokerNowTransaction
Represents a wallet transaction.
transactions = club.get_player_transactions(player.user_id)
for tx in transactions:
print(f"{tx.reason}: {tx.quantity} chips")
API Methods
PokerNowSession Methods
Club Management:
get_club(slug)- Get club information (returns club with session attached)create_club(slug, name, description, use_cents)- Create a new club
User Profile:
update_user(username, email)- Update current user's profile
Payment & Subscription:
create_stripe_checkout(mode, plan, receiver_user_id)- Create checkout sessionhandle_payment_callback(session_id)- Handle payment callback
PokerNowClub Methods
Once you have a club object (via session.get_club()), you can call these methods directly on it:
Settings:
club.set_ledger_visibility(show)- Toggle ledger visibilityclub.set_play_report_visibility(show)- Toggle play report visibilityclub.set_game_archive_visibility(show)- Toggle archive visibilityclub.set_p2p_transfers(enabled)- Enable/disable P2P transfersclub.set_exclusivity(option, message)- Set club exclusivity settingsclub.set_landing_page(content)- Set club landing page (Markdown)club.set_rules(content)- Set club rules (Markdown)
Player Management:
club.add_chips_to_player(user_id, amount, reason)- Add chipsclub.remove_chips_from_player(user_id, amount, reason)- Remove chipsclub.send_chips_to_player(receiver_user_id, amount)- Send chips to another player (P2P)club.set_credit_limit_for_player(user_id, amount)- Set credit limitclub.get_player_transactions(user_id)- Get transaction historyclub.set_player_role(player_user_id, role)- Set player role
Game Management:
club.create_game(config)- Create a new gameclub.create_preset(config)- Create a game presetclub.close_game(game_id)- Close a game
Game Configuration
Create custom game configurations using PokerGameConfig:
config = PokerGameConfig(
name="My Game",
small_blind=10,
big_blind=20,
# Optional parameters
maxQuantityPlayers='6',
gameType='plo', # Pot Limit Omaha
decisionTime='30',
timebank='15',
straddle='true',
runItTwice='ask_players'
)
Game Types
'th'- Texas Hold'em'omaha'- Omaha Hi'plo8'- Omaha Hi/low
Authentication
Get your apt_token by logging into pokernow.club and inspecting your cookies (view QUICKSTART.md for step by step instructions).
For programmatic login (requires OTP):
from pokernow import login
def otp_callback(email):
return input(f"Enter OTP sent to {email}: ")
session = login("your@email.com", otp_callback)
Requirements
- Python 3.7+
- beautifulsoup4 >= 4.9.0
- requests >= 2.25.0
Development
# Clone the repository
git clone https://github.com/yourusername/py-pokernow.git
cd py-pokernow
# Install development dependencies
pip install -e ".[dev]"
Disclaimer
This is an unofficial library and is not affiliated with or endorsed by pokernow.club. Use at your own risk and ensure compliance with pokernow.club's terms of service.
Metadata
Release files for py-pokernow 0.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| py_pokernow-0.2.6.tar.gz | 29.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| py_pokernow-0.2.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 54.8 kB
Release files / py_pokernow-0.2.6.tar.gz
| Download URL | py_pokernow-0.2.6.tar.gz |
|---|---|
| Size | 29.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4f81846f6aeb86a61c00a5a5898de06e1b9b19dfacb0c1bf6a9d12fa84d5619f
|
|
BLAKE2b-256 checksum How to use checksums |
1553e651c7ba2dca6bac1ab973254fd12b20754078c75b3c26b3680e48a26f33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / py_pokernow-0.2.6-py3-none-any.whl
| Download URL | py_pokernow-0.2.6-py3-none-any.whl |
|---|---|
| Size | 25.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
00a407811ab47fb17f02f27bb3e7c080671f9fd3d44ec51f3b5992661be2d165
|
|
BLAKE2b-256 checksum How to use checksums |
6702d165cbd7af32b8c9327c81bdb9efa003f287850d4785e54e7b7e1fca652f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|