Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thlorenz/hhp
Poker HandHistory Parser
https://github.com/thlorenz/hhp
Last synced: 15 days ago
JSON representation
Poker HandHistory Parser
- Host: GitHub
- URL: https://github.com/thlorenz/hhp
- Owner: thlorenz
- License: mit
- Created: 2016-03-02T06:41:17.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-04-03T08:40:58.000Z (over 4 years ago)
- Last Synced: 2024-10-16T15:32:32.489Z (21 days ago)
- Language: JavaScript
- Size: 1.38 MB
- Stars: 18
- Watchers: 4
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hhp [![build status](https://secure.travis-ci.org/thlorenz/hhp.svg)](http://travis-ci.org/thlorenz/hhp)
Poker HandHistory Parser
## Status
Parses PokerStars, Ignition, PartyPoker and Pacific (888) Hold'em hands, tourneys, SNGs and Cash.
## Installation
npm install hhp
## [API](https://thlorenz.github.io/hhp)
### parseHand
Parses PokerHand Histories as output by the given online Poker Rooms.
Autodetects the game type and the PokerRoom.The parsed hands can then be further analyzed with the
[hha](https://github.com/thlorenz/hha) module.As an example [this
hand](https://github.com/thlorenz/hhp/blob/master/test/fixtures/holdem/pokerstars/actiononall.txt)
is parsed into [this object
representation](https://github.com/thlorenz/hha/blob/master/test/fixtures/holdem/actiononall.json).**Parameters**
- `input` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the textual representation of one poker hand as written to the HandHistory folder
- `opts` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** various options
- `opts.infoOnly` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** denotes that only the header line of the hand is parsed and only the info object returned
- `opts.buyinFile` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** file name overrides buyin for rooms that don't include it in the history like IgnitionReturns **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** representation of the given hand to be used as input for other tools like hha
### canParse
Determines if any of the parsers can parse the passed hand(s).
**Parameters**
- `input` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** to parse
Returns **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` if it knows how to parse this text
### extractHands
Extracts all hands from a given text file.
**Parameters**
- `txt` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the text containing the hands
Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)>** an array of hands, each hand split into lines
### parseHands
Parses multiple hands from a given text.
**Parameters**
- `input` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the textual representation of the poker hands as written to the HandHistory folder
- `opts` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** various options, passed along to `parseHand`Returns **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** parsed hands and errors encountered: `{ parsedHands: Array, errors: Array, count: Number }`
## License
MIT