Go to file
2024-01-18 22:48:58 -08:00
rolltable adding reset() 2024-01-18 22:48:58 -08:00
tests adding importable roll tables and generative CLI 2024-01-17 21:15:39 -08:00
.gitignore Initial commit 2022-07-30 09:31:03 -07:00
example.yaml 1.0 release 2022-07-31 15:03:19 -07:00
LICENSE Initial commit 2022-07-30 09:31:03 -07:00
pyproject.toml updating source for random-sets to github 2023-12-23 15:38:05 -08:00
README.md Fix random value generator, new CLI 2024-01-16 22:09:09 -08:00

RollTables

RollTables is a python library for generating tables suitable for selecting random options using dice rolls.

Quick Start

Clone the repo and install the virtual env:

% git clone https://github.com/evilchili/dnd-rolltable
% cd dnd-rolltable
% poetry install

Invoke the CLI:

% poetry run roll-table custom example.yaml
┏━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┓
┃ Roll    ┃ Rarity   ┃ Color    ┃ Notes              ┃
┡━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━┩
│ d1-d5   │ common   │ red      │                    │
│ d6-d10  │ common   │ yellow   │                    │
│ d11-d12 │ rare     │ indigo   │                    │
│ d13     │ rare     │ violet   │                    │
│ d14-d15 │ uncommon │ blue     │                    │
│ d16-d19 │ uncommon │ green    │                    │
│ d20     │ wondrous │ octarine │ the color of magic │
└─────────┴──────────┴──────────┴────────────────────┘

Run poetry run roll-table --help for details.

Library Use

from rolltable import tables

sources = [
    Path('spells.yaml').read_text(),
    Path('weapons.yaml').read_text(),
    Path('items.yaml').read_text()
]
rt = tables.RollTable(sources, die=100)