Skip to main content

AnkiPokerMaster

Python tool to generate one or multiple Anki decks for memorizing Texas Hold'em Poker preflop ranges.

Anki is a powerful tool to learn and memorize useful information. It is available for Windows, Linux, macOS, Android and iOS. Official website and inspiring examples of the power of Anki.

You can read some more about Poker preflop ranges here and here.

Usage

Write a YAML file to define all scenarios (situations) you want to memorize, for example "Opening as Button in a 100BB Cash game". AnkiPokerMaster will generate Anki decks based solely on this scenario.yml file and you will get Anki cards like the screenshots below.

- game: "Cash 100BB 6P"
  position: "LJ"
  scenario: "Opening"
  ranges:
    Raise: "A2s+, K5s+, Q9s+, JTs, T9s, ATo+, KJo+, QJo+, 77+"
  source: pokertrainer.se

See a more complex example here: example_scenarios.yml

Execute anki-poker-master --help to see usage information.

Ranges

Some examples for how ranges can be specified:

  • 77+ (All pairs 77 and up i.e. 77, 88, 99, ...)
  • 77- (All pairs 77 and below i.e. 77, 66, 55, ...)
  • A2s+ (A2 suited and up excluding pairs i.e. A2s, A3s, A4s, ...)
  • KT+ (KT and up both suited and offsuit excluding pairs i.e. KTs, KJs, KQs, KTo, KJo and KQo)
  • 23s (A specific hand i.e. 23s)
  • 95s-98s (Hands between i.e. 95s, 96s, 97s and 98s)
  • Combining any of the above separated by commas

Screenshots

When opening as the small blind, how should you play King Three offsuit?

Answer:

When opening as Lojack, how should you play Jack and another suited card?

Answer:

What table position does the following range table correspond to? (this question is a memorization aid)

Answer:

Fill in the blank cells in this range table.

Note that here it's possible to mark cells using the mouse or finger (touchscreen) as a memory aid before flipping to the answer side.

Answer:

Of course also with dark mode: How should you open with QQ as Hijack?

Answer:

Develop

Check the repository on GitHub: https://github.com/omarkohl/anki-poker-master

poetry install
poetry run anki-poker-master
# poetry shell

Tests

poetry run pytest

Most of the tests generate output that is compared with golden files (i.e. files containing the expected output). This has the big advantage that you can look at these files easily to see what the functions actually generate. Looking at the HTML files in a browser gives you the full experience.

If you modify the code instead of having to manually fix all golden files you can run the following command to overwrite them all. Obviously you should only do this if you understand what you are changing.

poetry run pytest --update-golden

Occasionally you should delete all golden files and re-generate them to make sure there are no orphaned files lying around because a test was renamed or deleted:

rm -rf tests/golden
poetry run pytest --update-golden

Manual tests

Currently some tests are not automated because they would require programatically evaluating Anki decks. For now doing it manually is simpler. The tests will interactively guide you.

APM_MANUAL_TESTS=true poetry run pytest tests/test_manual.py -s

Support

Raise any issues on GitHub.

License

Unless otherwise specified, the code is under the MIT license and the card images are published under LGPL 3.0 (see below for original source of the card images).

Credits

Playing Cards

Slightly modified (see list of changes in playing-cards.svg) from original source:

Vector Playing Cards 3.2
https://totalnonsense.com/open-source-vector-playing-cards/
Copyright 2011,2021 – Chris Aguilar – conjurenation@gmail.com
Licensed under: LGPL 3.0 - https://www.gnu.org/licenses/lgpl-3.0.html

Inspiration

Metadata

Release files for anki_poker_master 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anki_poker_master 0.2.0
File Size Uploaded
anki_poker_master-0.2.0.tar.gz 1.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for anki_poker_master 0.2.0
File Interpreter ABI Platform
anki_poker_master-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.5 MB

Release files / anki_poker_master-0.2.0.tar.gz

Download URL anki_poker_master-0.2.0.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
a3e08c8148a349bd25824e6accd885b74c121053b6fbbef3f64dc936d68666ee
BLAKE2b-256 checksum
How to use checksums
a4ade94f18d929283e72b73123e616074288d32a1545d1181b74c068f3ddf137
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.8.10 Linux/5.4.0-172-generic

Release files / anki_poker_master-0.2.0-py3-none-any.whl

Download URL anki_poker_master-0.2.0-py3-none-any.whl
Size 1.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
5c4a0828142d484ee17ac283955e920857f3c3c1609b09d9990baa43f11d056a
BLAKE2b-256 checksum
How to use checksums
260cdb81aca03617061a5b245b8bd7dd5ed395275751c432ad06f34029102f40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.8.10 Linux/5.4.0-172-generic

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page