{ "info": { "author": "Alvin Liang, Zach Wissner-Gross, arlsr, Jim Kelly", "author_email": "ayliang@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Poker Hand Evaluator\n====================\n\nIn pure python\n\n27 January 2011, Alvin Liang\n\nIntroduction\n------------\n\nThis is a pure python library to calculate the rank of the best poker\nhand out of 5, 6, or 7 cards. It does not run the board for you, or\ncalculate winning percentage, EV, or anything like that. But if you give\nit two hands and the same board, you will be able to tell which hand\nwins.\n\nIt is nowhere near as fast as pypoker-eval, but it works if you can't\nuse C for some reason (the early stages of the first MIT pokerbot\ncompetition come to mind). The core algorithm is slower, and you\nobviously don't have the speed of C.\n\nQuick Start\n-----------\n\n.. code:: python\n\n from pokereval.card import Card\n from pokereval.hand_evaluator import HandEvaluator\n\n hole = [Card(2, 1), Card(2, 2)]\n board = []\n score = HandEvaluator.evaluate_hand(hole, board)\n\nRank is 2-14 representing 2-A, while suit is 1-4 representing\nspades, hearts, diamonds, clubs.\n\nThe Card constructor accepts two arguments, rank, and suit.\n\n.. code:: python\n\n aceOfSpades = Card(14, 1)\n twoOfDiamonds = Card(2, 3)\n\nAlgorithm\n---------\n\nThe algorithm for 5 cards is just a port of the algorithm that used to\nbe at the following URL. (I purposely broke the link because it now hosts\na malware site.)\nhttx://wwx.suffecool.net/poker/evaluator.html\n\nI came up with the 6 and 7 card evaluators myself, using a very similar\ncard representation and applying some of the same ideas with prime\nnumbers. The idea was to strike a balance between lookup table size and\nspeed.\n\nAlso, I haven't included the code I used to generate the lookup tables,\nbut you should be able to do that with a simpler, slower algorithm.\nMaybe I'll add that later as well.\n\nThere is also a two-card ranking/percentile algorithm that is unrelated\nto the rest and may get cleaned up later. We used it at one point for\nsome pre-flop evaluation. Credit to Zach Wissner-Gross for developing\nthis.\n\nDocumentation is sparse at the moment, sorry about that, and obviously I\ndid not really bother to package it or clean it up. I may or may not\nwork on this in the future. Basically, I made it, so why not release it?\n\nContributors\n------------\n\n- Me! Go me!\n- Zach Wissner-Gross (2-card algorithm)\n- arslr (Fixes for other Python versions)\n- Jim Kelly (Help with packaging, additional documentation)", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/aliang/pokerhand-eval", "keywords": null, "license": "Apache, see LICENSE.txt", "maintainer": null, "maintainer_email": null, "name": "pokereval", "package_url": "https://pypi.org/project/pokereval/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pokereval/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/aliang/pokerhand-eval" }, "release_url": "https://pypi.org/project/pokereval/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "A pure python poker hand evaluator for 5, 6, 7 cards", "version": "0.1.2" }, "last_serial": 1780986, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "b8b7d8e2bea00d7a6ac1cc8a23f188d5", "sha256": "e479fa516e25ff13f33e77be01f4ee433432b89cff2e178b8969f4e1a6c05788" }, "downloads": -1, "filename": "pokereval-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b8b7d8e2bea00d7a6ac1cc8a23f188d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 566292, "upload_time": "2014-01-10T05:21:59", "url": "https://files.pythonhosted.org/packages/80/3f/23881c7f3ee0859e83bf751a57b517b26cd62cf4f6fa4496f1b76339eb58/pokereval-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "494f0facc6f1b5ac3f6ca77eb3a5840c", "sha256": "a8e480db5423d6fe96a5c37fd9636762659d0904f27f757e102241fdbff7b1b0" }, "downloads": -1, "filename": "pokereval-0.1.1.tar.gz", "has_sig": false, "md5_digest": "494f0facc6f1b5ac3f6ca77eb3a5840c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 567479, "upload_time": "2014-03-21T01:24:21", "url": "https://files.pythonhosted.org/packages/4c/e4/2b11ac8e91dbb028e4299b1fa15fe9999a5018f42a98c6c397113d88c18f/pokereval-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "d88f7315fa4359ee68b5933cc04b4f4e", "sha256": "af6f9070c93ef03d054fa0038ab99145107374fdbc018eada18022d21281eced" }, "downloads": -1, "filename": "pokereval-0.1.2.tar.gz", "has_sig": false, "md5_digest": "d88f7315fa4359ee68b5933cc04b4f4e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 567608, "upload_time": "2015-10-22T06:41:28", "url": "https://files.pythonhosted.org/packages/e8/c9/25b96194336150c2c31b99e1a3a97c5c23b6568b7b5b6a4471494f6faa77/pokereval-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d88f7315fa4359ee68b5933cc04b4f4e", "sha256": "af6f9070c93ef03d054fa0038ab99145107374fdbc018eada18022d21281eced" }, "downloads": -1, "filename": "pokereval-0.1.2.tar.gz", "has_sig": false, "md5_digest": "d88f7315fa4359ee68b5933cc04b4f4e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 567608, "upload_time": "2015-10-22T06:41:28", "url": "https://files.pythonhosted.org/packages/e8/c9/25b96194336150c2c31b99e1a3a97c5c23b6568b7b5b6a4471494f6faa77/pokereval-0.1.2.tar.gz" } ] }