{"id":15724505,"url":"https://github.com/jshrake/hearthcards","last_synced_at":"2026-03-12T18:48:25.636Z","repository":{"id":25277218,"uuid":"28702859","full_name":"jshrake/hearthcards","owner":"jshrake","description":"a library for Hearthstone analysis","archived":false,"fork":false,"pushed_at":"2015-07-19T15:25:47.000Z","size":1096,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-20T22:56:06.333Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jshrake.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-02T03:52:22.000Z","updated_at":"2025-05-07T22:27:58.000Z","dependencies_parsed_at":"2022-08-24T00:11:08.357Z","dependency_job_id":null,"html_url":"https://github.com/jshrake/hearthcards","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jshrake/hearthcards","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshrake%2Fhearthcards","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshrake%2Fhearthcards/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshrake%2Fhearthcards/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshrake%2Fhearthcards/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jshrake","download_url":"https://codeload.github.com/jshrake/hearthcards/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshrake%2Fhearthcards/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30438516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T22:16:53.515Z","updated_at":"2026-03-12T18:48:25.620Z","avatar_url":"https://github.com/jshrake.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hearthcards\nhearthcards is a Python 3 library for Hearthstone analysis\n\n# install\n    python setup.py install\n\n# uninstall\n    python setup.py clean --all\n\n# test\n    python3 -m unittest\n\n# usage\n## Arena draft calculations\n```python\nfrom hearthcards import arena, Hero, CardRace, GameTag\n# The expected number of turns containing at least one 3-drop minion, given 10 turns remaining\nis_3_drop = lambda card: card.is_minion and card.cost == 3\narena.draft_e(Hero.MAGE, is_3_drop, 10)\n\u003e\u003e4.544\n\n# The expected number of turns containing at least one spell\narena.draft_e(Hero.MAGE, lambda c: c.is_ability, 30)\n\u003e\u003e 14.961\n\n# The probability that at least 2 of the next 20 turns offers a Fireball\np = arena.draft_p(Hero.MAGE, lambda c: c.name == \"Fireball\", 20)\n1.0 - sum([p(k=i) for i in range(0, 2)])\n\u003e\u003e 0.162\n\n# The expected number of turns containing at least one beast or taunt minion\nbeast_or_taunt = lambda c: c.is_minion and (c.race == CardRace.PET or GameTag.TAUNT in c.mechanics)\narena.draft_e(Hero.HUNTER, beast_or_taunt, 30)\n\u003e\u003e16.4147\n```\n\n[Process and underlying probabilities](http://www.reddit.com/r/CompetitiveHS/comments/2aquyq/hypothesis_arena_card_generation/).\n\n# dependencies\nhearthcards currently extracts the card data directly from the Hearthstone game client data files using [disunity](https://github.com/ata4/disunity).\n- Python 3.4\n    - Scipy\n    - Numpy\n- Installed Hearthstone game client\n- Java for [disunity](https://github.com/ata4/disunity)\n\nIn the future, I may remove the Hearthstone and Java dependencies by adding an option to load the card definition data from a (JSON?) file.\n\n# hson\nhearthcards comes with a `hson`, a command-line utility for extracting all card data from the Hearthstone asset files and generating JSON output.\n\n    hson [-h] [-r] [-d DATA_DIR] [-o OUTPUT_DIR]\n\n    optional arguments:\n      -h, --help            show this help message and exit\n      -r, --raw             Output the raw integer values specified in the\n                            Hearthstone data file rather than the human readable\n                            string representations. Useful for application\n                            interop.\n      -d DATA_DIR, --data-dir DATA_DIR\n                            Hearthstone data directory containing the\n                            cardxml0.unity3d file. Only required for a non-default\n                            Hearthstone install. Default install location on\n                            Windows: C:\\Program Files (x86)\\Hearthstone\\Data\\Win\n                            Default install location on OS X:\n                            /Applications/Hearthstone/Data/OSX\n      -o OUTPUT_DIR, --output-dir OUTPUT_DIR\n                            Output directory. By default, outputs data into\n                            current/working/directory/hson-output/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjshrake%2Fhearthcards","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjshrake%2Fhearthcards","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjshrake%2Fhearthcards/lists"}