Western Geomancy¶
A geomancy engine with the sixteen-figure deck and the shield-chart spread. Casting is RNG-driven: four Mother figures are generated from random points, then the Daughters, Nieces, two Witnesses, and the Judge follow by geomantic addition.
from fortune_telling_core import RandomRng, ReadingRequest
from fortune_telling_core.traditions.geomancy import GEOMANCY_DECK, SHIELD, build_engine
request = ReadingRequest(deck_id=GEOMANCY_DECK.id, spread_id=SHIELD.id)
reading = build_engine().read(request, rng=RandomRng(seed=42))
geomancy ¶
GEOMANCY_DECK
module-attribute
¶
GEOMANCY_DECK = Deck(
id="geomancy.deck.figures.v1",
symbols=tuple(
(
Symbol(
id=figure.symbol_id,
name=figure.name,
attributes={
"slug": figure.slug,
"english": figure.english,
"element": figure.ruling_element,
"rows": "".join(
(str(row)) for row in (figure.rows)
),
"points": str(figure.points),
},
)
)
for figure in FIGURES
),
)
SHIELD
module-attribute
¶
SHIELD = Spread(
id="geomancy.spread.shield.v1",
name="Shield Chart",
positions=(
*(_quad("mother", "Mother")),
*(_quad("daughter", "Daughter")),
*(_quad("niece", "Niece")),
Position(
"right_witness",
"Right Witness",
"Witness formed from the first two Nieces.",
),
Position(
"left_witness",
"Left Witness",
"Witness formed from the last two Nieces.",
),
Position(
"judge",
"Judge",
"The verdict, formed from the two Witnesses.",
),
),
)
GeomancyEngine ¶
Bases: AbstractEngine
Western geomancy engine.
Four Mother figures are generated from random points, then the Daughters, Nieces, two Witnesses, and the Judge are derived deterministically by geomantic addition. The fifteen figures fill the shield spread.
deck ¶
Return the geomancy figure deck.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ReadingRequest
|
Reading request whose |
required |
Returns:
| Type | Description |
|---|---|
Deck
|
The bundled geomancy deck. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If the request names an unsupported deck. |
Source code in src/fortune_telling_core/traditions/geomancy/engine.py
spread ¶
Return the shield spread.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ReadingRequest
|
Reading request whose |
required |
Returns:
| Type | Description |
|---|---|
Spread
|
The bundled shield spread. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If the spread is not supported. |
Source code in src/fortune_telling_core/traditions/geomancy/engine.py
draw ¶
Cast a geomantic shield for the request.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ReadingRequest
|
Reading request. |
required |
rng
|
Rng
|
Random source; sixteen floats are consumed (one per Mother row). |
required |
Returns:
| Type | Description |
|---|---|
Draw
|
A draw with the fifteen shield selections in reading order. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If the requested deck or spread is unsupported. |
ExhaustedRngError
|
If the supplied RNG cannot provide enough values. |
Source code in src/fortune_telling_core/traditions/geomancy/engine.py
build_engine ¶
Create a Western geomancy engine.
Returns:
| Type | Description |
|---|---|
GeomancyEngine
|
A new |