Races API
races
Basic Fantasy race definitions and racial rule modifiers.
This module defines the supported races along with ability score restrictions, allowed classes, saving throw modifiers, and racial hit-die limits used during character generation.
RaceName = Literal['dwarf', 'elf', 'halfling', 'human']
module-attribute
Canonical lowercase identifiers for supported character races.
RaceData
Bases: TypedDict
Structured rule data describing racial modifiers and restrictions.
Attributes:
| Name | Type | Description |
|---|---|---|
ability_min |
dict[AbilityName, int]
|
Minimum ability score requirements for the race. |
ability_max |
dict[AbilityName, int]
|
Maximum ability score limits for the race. |
allowed_classes |
list[ClassName]
|
Classes available to the race. |
saving_throw_modifiers |
dict[SavingThrowName, int]
|
Racial adjustments applied to saving throws. |
hit_die_max |
int | None
|
Optional cap on the class hit die size. |
Source code in src/rpgcharacters/races.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |