Petit Lenormand¶
A Petit Lenormand engine with the 36-card deck and single-card, three-card, and Grand Tableau spreads. Casting is RNG-driven; Lenormand cards are never reversed, and the Grand Tableau lays out the whole deck.
from fortune_telling_core import RandomRng, ReadingRequest
from fortune_telling_core.traditions.lenormand import LENORMAND_DECK, THREE_CARD, build_engine
request = ReadingRequest(deck_id=LENORMAND_DECK.id, spread_id=THREE_CARD.id)
reading = build_engine().read(request, rng=RandomRng(seed=42))
lenormand ¶
LENORMAND_DECK
module-attribute
¶
LENORMAND_DECK = Deck(
id="lenormand.deck.petit.v1",
symbols=tuple(
(
Symbol(
id=f"lenormand.card.{slug}",
name=name,
attributes={
"number": str(number),
"slug": slug,
},
)
)
for number, slug, name in _CARDS
),
)
GRAND_TABLEAU
module-attribute
¶
GRAND_TABLEAU = Spread(
id="lenormand.spread.grand-tableau.v1",
name="Grand Tableau",
positions=tuple(
(
Position(
f"house_{index}",
f"House {index}",
f"Tableau position {index}.",
)
)
for index in (range(1, 37))
),
)
SINGLE_CARD
module-attribute
¶
SINGLE_CARD = Spread(
id="lenormand.spread.single.v1",
name="Single Card",
positions=(
Position(
"focus",
"Focus",
"The card answering the question.",
),
),
)
THREE_CARD
module-attribute
¶
THREE_CARD = Spread(
id="lenormand.spread.three.v1",
name="Three Card Line",
positions=(
Position(
"left",
"Left",
"Background, modifying the center.",
),
Position(
"center", "Center", "The heart of the matter."
),
Position(
"right",
"Right",
"Outcome, modifying the center.",
),
),
)
LenormandEngine ¶
Bases: AbstractEngine
Petit Lenormand engine.
The engine draws from the 36-card deck into a single-card, three-card line, or Grand Tableau spread. Lenormand cards are not read reversed, so draws carry no orientation; the Grand Tableau consumes the entire deck.
deck ¶
Return the Lenormand deck for a request.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ReadingRequest
|
Reading request whose |
required |
Returns:
| Type | Description |
|---|---|
Deck
|
The bundled Lenormand deck. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If the request names an unsupported deck. |
Source code in src/fortune_telling_core/traditions/lenormand/engine.py
spread ¶
Return the Lenormand spread requested by id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ReadingRequest
|
Reading request whose |
required |
Returns:
| Type | Description |
|---|---|
Spread
|
|
Raises:
| Type | Description |
|---|---|
ValidationError
|
If the spread is not supported. |
Source code in src/fortune_telling_core/traditions/lenormand/engine.py
draw ¶
Draw cards for the requested spread.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ReadingRequest
|
Reading request. |
required |
rng
|
Rng
|
Random source used to shuffle the deck. |
required |
Returns:
| Type | Description |
|---|---|
Draw
|
A draw containing one selection per spread position. |
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/lenormand/engine.py
build_engine ¶
Create a Petit Lenormand engine.
Returns:
| Type | Description |
|---|---|
LenormandEngine
|
A new |