Skip to content

Repository files navigation

The Gang Card Tools

This repository contains scripts to:

  • Generate poker reference card images.
  • Generate a rules summary card image.
  • Arrange card images into printable grid pages.

Requirements

  • Python 3.10+
  • pip (or another Python package manager)
  • Pillow (PIL)

Quick Setup (Any Machine)

From the repository root:

python -m venv .venv

Activate the virtual environment:

macOS/Linux:

source .venv/bin/activate

Windows PowerShell:

.venv\Scripts\Activate.ps1

Install dependencies:

python -m pip install --upgrade pip Pillow

Scripts

1) Generate hand-rank cards

Script: Reference_Cards.py

python Reference_Cards.py

Expected outputs include files like:

  • hand_ranks_card_1.png
  • hand_ranks_card_2.png
  • hand_ranks_card_3.png
  • hand_ranks_card_4.png

2) Generate rules card

Script: Rules_Card.py

python Rules_Card.py

Expected output:

  • rules_card.png

3) Build printable grid pages from a folder of card images

Script: Print_Card_Grid.py

Basic example (run from repo root):

python Print_Card_Grid.py --input "./Reference Cards" --output "./Reference Cards/print.png"

This produces one or more page images such as:

  • print_01.png
  • print_02.png

If only one page is needed, a single output page may be created.

Print Grid Options

python Print_Card_Grid.py \
	--input "./Reference Cards" \
	--output "./Reference Cards/print.png" \
	--dpi 300 \
	--page-size letter \
	--margin-in 0.25 \
	--gap-in 0.00

Option notes:

  • --input: folder containing card images.
  • --output: .pdf for multipage PDF, or image extension (like .png) for page image output.
  • --page-size: letter or a4.
  • --margin-in: outer margin in inches.
  • --gap-in: spacing between cards in inches (default is 0.00, so cards touch edge-to-edge).

Behavior Notes

  • The print-grid script assumes source images are already card-sized artwork (for example, generated by Reference_Cards.py and Rules_Card.py).
  • The print-grid script automatically excludes its own generated output name and numbered pages from input discovery (for example, excludes print.png, print_01.png, print_02.png, etc. when --output print.png is used).
  • In some environments, PDF export can fail if Pillow lacks JPEG encoder support. If that happens, use image output (.png) and print those pages.

About

Things related to The Gang

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages