Saravanan666/pypi-org huggingface dataset:
Package: pokemontcgsdkasync
Pokémon TCG SDKThis is an async adaption of thePokémon TCG SDK for Python. It is a wrapper around the Pokémon TCG API ofpokemontcg.io.RequirementsPython >= 3.6This library usesaiohttp. The documentation suggests installing this two optional library:cchardet: cChardet is high speed universal character encoding detector - binding to charsetdetect.aiodns: DNS resolver for asyncio.UsageWrap all the coroutines that needs to use the API inside one AsyncClientContext().
The AsyncClientContext will automatically open and close the underlying aiohttp session.
You can also wrap your entire application.async with AsyncClientContext(api_key='12345678-1234-1234-1234-123456789ABC'):
    await all_your_coroutines_that_use_the_api()Import (Card and Set will be most used)from pokemontcgsdk import Card
from pokemontcgsdk import Set
from pokemontcgsdk import Type
from pokemontcgsdk import Supertype
from pokemontcgsdk import Subtype
from pokemontcgsdk import RarityClassesCard
Set
Type
Supertype
Subtype
RarityProperties Per ClassCardabilities
artist
ancientTrait
attacks
convertedRetreatCost
evolvesFrom
flavorText
hp
id
images
legalities
regulationMark
name
nationalPokedexNumbers
number
rarity
resistances
retreatCost
rules
set
subtypes
supertype
tcgplayer
types
weaknessesSetid
images
legalities
name
printedTotal
ptcgoCode
releaseDate
series
total
updatedAtFunctions AvailableFind a card by idcard = await Card.find('xy1-1').get()Filter Cards via query parameters# List (may take a while)
cards = await Card.where(q='set.name:generations supertype:pokemon').get()

# Generator
async for card in Card.where(q='set.name:generations supertype:pokemon').generator():
    ...Find all cards# List (will take a while)
cards = await Card.all().get()

# Generator
async for card in Card.all().generator():
    ...Get all cards, but only a specific page of datacards = await Card.where(page=5, pageSize=250).get()Find a set by codeset = await Set.find('base1').get()Filter sets via query parameters# List
sets = await Set.where(q='legalities.standard:legal').get()

# Generator
async for set in Set.where(q='legalities.standard:legal').generator():
    ...Get all Sets# List
sets = await Set.all().get()

# Generator
async for set in Set.all().generator():
    ...Get all Typestypes = await Type.all().get()Get all Subtypessubtypes = await Subtype.all().get()Get all Supertypessupertypes = await Supertype.all().get()Get all Raritiesrarities = await Rarity.all().get()
Package: pokepalette
pokepaletteA simple pokemon color chooser"This repo is based onCDWimmer/PokePaletteInstallpipinstallpokepaletteHow to useimportnumpyasnpimportmatplotlib.pyplotaspltimportpokepaletteThere is a handySimpleNamespacewith all the pokemons and their colours available:pokepalette.PokemonColours.pikachu['#f5e551',
 '#f5bc1f',
 '#000000',
 '#9b5100',
 '#dd9300',
 '#613007',
 '#404049',
 '#282828',
 '#fef5a3',
 '#c41f17',
 '#e55940',
 '#fefefe',
 '#727282']pikachu_cmap=pokepalette.get_colormap('pikachu')You can plot passing thepikachucolors directly# Pie chart, where the slices will be ordered and plotted counter-clockwise:labels='Frogs','Hogs','Dogs','Logs'sizes=[15,30,45,10]explode=(0,0.1,0,0)# only "explode" the 2nd slice (i.e. 'Hogs')fig1,ax1=plt.subplots()ax1.pie(sizes,colors=pokepalette.PokemonColours.pikachu,explode=explode,labels=labels,autopct='%1.1f%%',shadow=True,startangle=90)ax1.axis('equal')# Equal aspect ratio ensures that pie is drawn as a circle.plt.show()or passing the corresponding matplotlib's colormapplt.rcParams["figure.figsize"]=[7.50,3.50]plt.rcParams["figure.autolayout"]=TrueN=50x=np.random.randn(N)y=np.random.randn(N)plt.scatter(x,y,c=x,cmap=pikachu_cmap)plt.show()
Package: pokepastes-scraper
pokepastes-scraperA simple library that converts a Pokemon team fromhttps://pokepast.esto a object in Python. Supports conversion to and from JSON.Installationpip install -U pokepastes-scraperUsageLet's say we want to parsethis teamwhich Gavin Michaels used to win theOceania World Championships. Simply callteam_from_url:importpokepastes_scraperaspastesteam=pastes.team_from_url("https://pokepast.es/5c46f9ec443664cb")formoninteam.members:print(f'{mon.species}with{mon.itemor"no item"}(Tera:{mon.tera_type})')Output:Iron Hands with Assault Vest (Tera: Grass)
Amoonguss with Sitrus Berry (Tera: Steel)
Pelipper with Focus Sash (Tera: Flying)
Palafin with Mystic Water (Tera: Water)
Baxcalibur with Dragon Fang (Tera: Poison)
Dragonite with Lum Berry (Tera: Flying)For a detailed example output ofteam_from_url, seeexample/example.pyand its outputexample/example_team.json.Tested in python 3.11, but likely compatible with 3.10+. Feel free to contact me:myapaulogies@tuta.io
Package: pokepy
PokepyA python wrapper forPokéAPI. (formerpykemon)Maintainer:KronoptInstallationNice and simple:$pipinstallpokepyUsageEven simpler:>>>importpokepy>>>client=pokepy.V2Client()>>>client.get_pokemon(14)<Pokemon-Kakuna>DocumentationFor more information, check the documentation athttps://pokeapi.github.io/pokepyFeaturesGenerate Python objects from PokéAPI resourcesCacheHuman-friendly APIHistory0.6.2 (2021-05-16)Addversionsubproperty toFlavorTextSubResource0.6.1 (2020-05-31)Fixed disk-based cache not handling different filesystems on Windows0.6.0 (2019-05-3)V2Client get methods now return element instead of single element listset urllib3 version to >=1.24.3, <1.25 (CVE-2019-11236)Support for Python 3.4 and 3.50.5.2 (2019-03-01)Fixed bug that caused pokemon_encounters subresource to not be detected in LocationAreaResource
(thanks tojachymb)0.5.1 (2019-02-16)New V2Client cache-related methods:cache_infocache_clearcache_location0.5.0 (2019-01-19)Pykemon is now Pokepy!Cache (disk- and memory-based)0.4.0 (2018-10-11)Removed code from pre-beckett versionsRemoved V1 API support, as it is now deprecatedAdded some tweaks to the beckett package0.3.0 (2017-10-19)V2 support addedAdded some missing V1 resourcesRemoved files related to API 0.10.2.0 (2016-06-11)Beckett API Client framework added0.1.2 (2014-1-3)Sprite attribute added to Pokemon class0.1.1 (2013-12-24)Description attribute added to Pokemon class0.1.0 (2013-12-23)First release on PyPIAll PokéAPI resources fully supported and represented in an object-oriented styleEasy-to-use API: just one method!
Package: pokequiz
PokeQuizCurrent version: 1.1.2PokeQuiz is a command line studying tool that allows you to test your knowledge by answering randomly-generated Pokemon questions. Currently, data from generations 1 – 7 is included, but I do have plans to add generation 8 andpossiblyside-games such as Colosseum and XD Gale of Darkness in later releases.PokeQuiz ships with a lightweight SQLite database containing information on:PokemonRegions (Kanto, Johto, etc.)TownsGym LeadersEnemy Teams (Rocket, Magma, etc.)Games (Red & Blue, Silver & Gold, etc.)InstallationTo install via pip, go to your terminal and run:> pip install pokequizTo install using git, run:> git clone https://github.com/Dechrissen/PokeQuiz.git
> cd pokequiz && pip install -U .UsageInstalling PokeQuiz will add an entry point to your PATH namedpokequiz.To run PokeQuiz from your terminal, simply run:> pokequizor> python -m pokequizHow to use the PokeQuiz Main Menu------------------------------
     Welcome to PokeQuiz!
------------------------------
       -----------------
           Main Menu
       -----------------

1 - Start Quiz
2 - Study Categories
3 - Marathon Mode
4 - Settings
5 - Set Seed
6 - Help
7 - Quit

>Start QuizThis will give you a 20-question quiz.Study CategoriesThis will give you a 20-question quiz restricted to ONE category.Marathon ModeThis will give you an endless quiz. Type 'quit' at any time to exit.SettingsHere you can edit global settings (generation filtering and question limit) before studying.Set SeedEnter a seed to challenge others to the same quiz.Sample QuestionsFuchsia City is a town in what region?Who is the Champion in Platinum version?What evolves into Altaria?Team Aqua is the enemy team in what region?Who is the professor in Kalos?SeedsPokeQuiz supports set quiz seeds to generate identical quizzes in order to challenge others and compare scores. All seeds will invoke a 20-question quiz with no restriction on Pokemon generation or question type.Currently supported seeds: 1-100
Package: poker
A Python framework for poker related operations.It contains classes for parsing card Suits, Cards, Hand combinations (called Combos),
construct hand Ranges and check for syntax, parse Hand histories.It can get information from poker related websites like
Pocketfives, TwoplusTwo Forum, or PokerStars website by scraping them.
In the long term, it will have a fast hand evaluator and an equity calculator.It uses the MIT license, so its code can be used in any product without legal consequences.It aims for quality, fully tested code and easy usability with nice APIs, suitable for beginners
to play with.Documentationhttps://poker.readthedocs.org/LicenseThe MIT License (MIT)Copyright (c) 2013-2019 Kiss GyörgyRepo and contactRepo:https://github.com/pokerregion/pokerIssues:https://github.com/pokerregion/poker/issues@kissgyorgyon twitteror you can reach me on mypublic Github e-mail.
Package: pokera
Python client for RecordService implementations.DependenciesRequired:Python 3.4+six,bit_array,thriftpy >=0.3.9pip3installsixbit_array'thriftpy>=0.3.9'Optional:pandasfor conversion toDataFrameobjectsInstallationpip3installpycerebroTo verify:>>>importcerebro.cdas>>>cerebro.cdas.version()'0.8.0-beta3'Usagefromcerebroimportcontextctx=context()withctx.connect(host='localhost',port=12050)asconn:conn.list_databases()pd=conn.scan_as_pandas("cerebro_sample.sample")pdTo enable a connection to a server with token-authentication:fromcerebroimportcontextctx=context()ctx.enable_token_auth(token_str='my-token')withctx.connect(host='localhost',port=12050)asconn:conn.list_databases()To enable a connection to a server with kerberos-authentication:fromcerebroimportcontextctx=context()# Connecting to server principal 'cerebro/service@REALM'ctx.enable_kerberos('cerebro',host_override='service')withctx.connect(host='localhost',port=12050)asconn:conn.list_databases()
Package: poker-calc
Poker Odds CalculatorCalculate your hand odds against other players.For instructions run:poker_calcorpoker_calc--helpYou can easily give from 2-9 players.
if no -b argument is present then Pre-Flop odds are calculated.
Else if -b is 5 cards then it will simply give you who has the strongest hand (winner)
else if -b is between 3-4 cards then flop odds and respecetivly turn odds will be calculated.
After that you can either run arg mode version:poker_calc-p8s9s-pThQd-b8h9sJh--fastOr you could try interactive mode (with limitations- 2 players only and board cards are mandatory)poker_calc--interactive
Package: pokercore
A poker engine core, in Pythonpokercoreprovides 3 classes to be used in a poker engine.Card(a playing card),Hand(a poker hand consisting of Cards,
with evaluation capabilities) andDeck(a deck of Cards).It is a simple starter, mainly written for exploring purposes,
but can be extended and/or used to build something bigger. It is
released under the MIT license.Example>>>frompokercoreimportDeck,Hand>>>deck=Deck()>>>first=Hand(deck.draw(5))>>>firstHand(onepair:Card(9c),Card(9h),Card(Ac),Card(Jh),Card(2h))>>>second=Hand(deck.draw(5))>>>secondHand(highcard:Card(As),Card(Kc),Card(9s),Card(7h),Card(4h))>>>first>secondTrue
Package: pokereval
In pure python27 January 2011, Alvin LiangIntroductionThis is a pure python library to calculate the rank of the best poker
hand out of 5, 6, or 7 cards. It does not run the board for you, or
calculate winning percentage, EV, or anything like that. But if you give
it two hands and the same board, you will be able to tell which hand
wins.It is nowhere near as fast as pypoker-eval, but it works if you can’t
use C for some reason (the early stages of the first MIT pokerbot
competition come to mind). The core algorithm is slower, and you
obviously don’t have the speed of C.Quick Startfrompokereval.cardimportCardfrompokereval.hand_evaluatorimportHandEvaluatorhole=[Card(2,1),Card(2,2)]board=[]score=HandEvaluator.evaluate_hand(hole,board)Rank is 2-14 representing 2-A, while suit is 1-4 representing
spades, hearts, diamonds, clubs.The Card constructor accepts two arguments, rank, and suit.aceOfSpades=Card(14,1)twoOfDiamonds=Card(2,3)AlgorithmThe algorithm for 5 cards is just a port of the algorithm that used to
be at the following URL. (I purposely broke the link because it now hosts
a malware site.)
httx://wwx.suffecool.net/poker/evaluator.htmlI came up with the 6 and 7 card evaluators myself, using a very similar
card representation and applying some of the same ideas with prime
numbers. The idea was to strike a balance between lookup table size and
speed.Also, I haven’t included the code I used to generate the lookup tables,
but you should be able to do that with a simpler, slower algorithm.
Maybe I’ll add that later as well.There is also a two-card ranking/percentile algorithm that is unrelated
to the rest and may get cleaned up later. We used it at one point for
some pre-flop evaluation. Credit to Zach Wissner-Gross for developing
this.Documentation is sparse at the moment, sorry about that, and obviously I
did not really bother to package it or clean it up. I may or may not
work on this in the future. Basically, I made it, so why not release it?ContributorsMe! Go me!Zach Wissner-Gross (2-card algorithm)arslr (Fixes for other Python versions)Jim Kelly (Help with packaging, additional documentation)hwmrocker (Improvements to Card constructor, Python 3 compatibility)radekj (Tests, Python 3 compatibility)
Package: pokerface
PokerFace is a Python package for various poker tools.The following features are present in PokerFace…Types for cards and their components and related helper functionsRankSuitRanksCardHole CardVarious types of poker decksStandard DeckShort DeckPoker hand evaluationsStandard EvaluatorGreek EvaluatorOmaha EvaluatorShort-Deck EvaluatorDeuce-to-Seven Lowball EvaluatorAce-to-Five Lowball EvaluatorBadugi EvaluatorPoker game variantsTexas Hold’emFixed-Limit Texas Hold’emNo-Limit Texas Hold’emOmaha Hold’emPot-Limit Omaha Hold’em5-Card Omaha Hold’emFixed-Limit 5-Card Omaha Hold’emPot-Limit 5-Card Omaha Hold’em6-Card Omaha Hold’emPot-Limit 6-Card Omaha Hold’emGreek Hold’emFixed-Limit Greek Hold’emPot-Limit Greek Hold’emNo-Limit Greek Hold’emShort-Deck Hold’emNo-Limit Short-Deck Hold’em5-Card DrawFixed-Limit 5-Card DrawPot-Limit 5-Card DrawNo-Limit 5-Card DrawBadugiFixed-Limit Badugi2-to-7 Single Draw LowballNo-Limit 2-to-7 Single Draw Lowball2-to-7 Triple Draw LowballFixed-Limit 2-to-7 Triple Draw LowballPot-Limit 2-to-7 Triple Draw LowballKuhn PokerFixed-Limit Kuhn PokerThe full documentation is available atRead the Docs.LicenseGNU GPLv3
Package: poker-log-parser
poker-log-parserpoker-log-parseris a blazingly-fast Rust/Python library for parsing poker hand histories.Parsing hand histories is a common task in most 3rd party poker projects, however it has many edge cases, formats and is very tedious.  This library was written to take poker hand history text files and parse all relevant hand information as quickly as possible without having to deal with all the headaches.FeaturesGeneric poker hand data formatParsing speed (parse multiple GB/s on modern CPUs)Binary serialization/deserializationCompressed binary serialization/deserialization on diskJSON serialization/deserialization into:Custom compact JSON formatOpenHandHistory formatfor interfacing with other toolsSupported websitesPoker Stars (.com / .fr / .it / .es)On Game (.com / .fr / .it)Pluribus (subset of Poker Stars format generated from Pluribus AI match logs)Supported game typesNo Limit Hold'emFuture website supportAbsoluteEverLeafBet OnlineFull Tilt PokerPacific Poker (now called 888Poker)Poker TrackerParty PokerGG PokerWinamaxKings ClubBovadaEnetCakePkrWinning PokerFuture game type supportFixed Limit Hold'emPot Limit Hold'emFixed Limit OmahaPot Limit OmahaFixed Limit OmahaHiLoPot Limit OmahaHiLoGetting startedPythonInstallation:pipinstallpoker-log-parserBasic usage:importpoker_log_parseraspklphands=pklp.parse_path("path/to/my_hand_history.txt")# must be a stringprint(str(hands))
Package: pokerrl-env
OverviewThis is a poker environment for reinforcement learning.Installationrunpython build.pyInstructionsTo instantiate the environment, pass in the config.the config consists of the following parameters:number of players (2-6), default 2bet limit (fixed limit, no limit, pot limit), default pot limitbet sizes allowed (array of floats), default (1, 0.9, 0.75, 0.67, 0.5, 0.33, 0.25, 0.1)Game type [Holdem, OmahaHI], default OmahaHIExample usageThis is the recommended way to use the environment.from pokerrl import Config, Game

config = Config(
    num_players=2,
    bet_limit=BetLimits.POT_LIMIT,
    bet_sizes=[1, 0.5],
    game_type=GameTypes.OMAHA_HI,
)
game = Game(config)
player_state,done,winnings,action_mask = game.reset()
while not done:
  action = model(player_state)
  player_state,done,winnings,action_mask = game.step(action)Play a game (both sides)from pokerrl import play_game
play_game()Example usage (low level)from pokerrl import Config, init_state, step_state, GameTypes, BetLimits, player_view, Positions, get_current_player

config = Config(
    num_players=2,
    bet_limit=BetLimits.POT_LIMIT,
    bet_sizes=[1, 0.5],
    game_type=GameTypes.OMAHA_HI,
)
global_state,done,winnings,action_mask = init_state(config)
while not done:
  player_idx = get_current_player(global_state)
  player_state = player_view(global_state, player_idx)
  action = model(player_state)
  global_state,done,winnings,action_mask = step_state(global_state, action, config)Player view (low level)from pokerrl import Config, init_state, step_state, GameTypes, BetLimits, player_view, Positions, get_current_player

config = Config()
global_state,done,winnings,action_mask = init_state(config)
while not done:
  player_idx = get_current_player(global_state)
  human_readable_view(global_state,player_idx, config)
  action = get_action(action_mask,global_state,config)
  global_state,done,winnings,action_mask = step_state(global_state, action, config)StateThe state is an array. To get a player's view of the state, pass the state into the view with the appropriate player index.Design decisionsRecord the total amount raised.
If you record the actual amount raised this means its more difficult to tell what the raise size is when facing multiple raises. But easier to tell what the raise size is when facing a single raise. Also complicates the process of determining how much a player has to call, as the raise size is in relation to the previous bet, which in multiplayer games, is not necessarily the current player.Global state player numbers are identical to their position.SB and BB posts are the first two states.A raise is the total amount. Subtract player street totalA call vs a raise is the difference = villain bet - player street totalA call vs a bet is the full amount = villain bet - player street totalA bet is the full amountA fold is 0
Package: pokers
PokersEmbarrassingly simple no limit texas holdem environment for RL.Why another poker environment?Poker is a incredibly deep game with very simple rules, so why are all the environments so overly complex? Heck, someone could say that you need to publish a paper before building one (looking at you RLCard 👀). Pokers way is to discard the agent environment cycle and all that stuff, just the good old new_state = state + action model. Through its simplicity pokers tries to be flexible and easily integrable into any framework.Why not to use pokersPokers is a side project inside another side project. This means that it is guaranteed to have bugs, which is not very nice for a RL environment. We have done our best to minimize the errors, testing it against the 10k hands pluribus logs. However, this doesn't cover some areas of the state space, so if you need a more reliable environment RLCard is a better option.InstallationPokers can be installed directly from pypi.pipinstallpokersUsageJust create the initial state and act over it. Easy peasy.importpokersaspkrsagents=[agent0,agent1,agent2,agent3,agent4,agent5]# Build the agents however you wantinitial_state=pkrs.State.from_seed(n_players=len(agents),button=0,sb=0.5,bb=1.0,stake=100.0,seed=1234)trace=[initial_state]whilenottrace[-1].final_state:state=trace[-1]action=agents[state.current_player].choose_action(trace)new_state=state.apply_action(action)trace.append(new_state)The initial state can also be declared with a fixed deck withState.from_deck().Curious about what info a state contains? Just go topokers.pyiand see it yourself, I bet there's all you need.As a bonus you can print the entire hand as text. Who wants GUIs anyway?print(pkrs.visualize_trace(trace))Error handlingThere are two possible types of erroneous states: when an illegal action is performed and when a player bets more chips than he has available. These cases are represented by the enumStateStatuswith the valuesIllegalActionandHighBet, the valueOkis used for correct states. This information is stored in the fieldstatusof the state so you can filter them.Every erroneous state is also final. So applying an action over it will return the same exact state.Parallel actionsIf you have a bunch of independent states and want to perform multiple actions in parallel you can easily trick the GIL withparallel_apply_action().importpokersaspkrsagents=[agent0,agent1,agent2,agent3,agent4,agent5]states=[pkrs.State.from_seed(n_players=len(agents),button=0,sb=0.5,bb=1.0,stake=100.0,seed=seed)forseedinrange(10)]whilenotall([s.final_stateforsinstates]):actions=[agents[s.current_player].choose_action(s)forsinstates]states=pkrs.parallel_apply_action(states,actions)Since final states do not change when an action is performed, you can safely wait for all hands in the batch to end.AlternativesTo our knowledge these are some other poker environments that you would want to consider.RLCard: Great RL environment for multiple card games.neuron_poker: OpenAI gym for texas holdem.pgx: Pretty cool project with jax-native game simulators. Sadly (at the moment) it doesn't implement NLTH.
Package: pokersolverquery.py
pokersolverquery.pyA Poker BaseSolver Query package for interacting with UPI engines such as PioSOLVER and jesolverFeaturesEasy to use python interfaceGeneral in optionsInstallationHow To UseImport the solver object via:frompokersolverquery.solverimportBaseSolverInitiate the solver class and send any UPI command!solver=BaseSolver(solver_path=r'C:\PioSOLVER\PioSOLVER-edge.exe')output=solver.command("load_tree QsJh2h")range=solver.command("show_range OOP r")
Package: pokerware
PokerwareAn application for those that don't want to manually look uppokerwarewords.Usageusage: pokerware [-h] [--formal | --slang | --custom CUSTOM_PATH]
                 code [code ...]

Generate Pokerware password

positional arguments:
  code                  A sequence of (Value, Suit, Value, Suit, Suit) entries

optional arguments:
  -h, --help            show this help message and exit
  --formal              Lookup words in the 'formal' wordlist
  --slang               Lookup words in the 'slang' wordlist
  --custom CUSTOM_PATH  Lookup words in a custom wordlistExamples$ pokerware --formal ACADD ACTCC 3C4CH 5STHS
abide anemia fake peace
$ pokerware --slang ACADD
abate