Pythagorean Numerology¶
A Pythagorean numerology engine that deterministically reduces a querent's birth date to a Life Path and Birthday number. The Life Path reduction method is a configurable option because the two common methods diverge on master numbers (11, 22, 33).
from fortune_telling_core import Querent, ReadingRequest
from fortune_telling_core.traditions.numerology import (
NUMEROLOGY_DECK,
NUMEROLOGY_SPREAD,
build_engine,
)
request = ReadingRequest(
deck_id=NUMEROLOGY_DECK.id,
spread_id=NUMEROLOGY_SPREAD.id,
querent=Querent(
id="sample",
display_name="Sample",
attributes={"birth_datetime": "1987-08-17T00:00:00+00:00"},
),
)
reading = build_engine().cast(request)
numerology ¶
NUMEROLOGY_DECK
module-attribute
¶
NUMEROLOGY_DECK = Deck(
id="numerology.deck.numbers.v1",
symbols=tuple(
(
Symbol(
id=item.symbol_id,
name=str(item.value),
attributes={
"value": str(item.value),
"keyword": item.keyword,
"master": "true"
if item.master
else "false",
},
)
)
for item in NUMBERS
),
)
NUMEROLOGY_SPREAD
module-attribute
¶
NUMEROLOGY_SPREAD = Spread(
id="numerology.spread.birth.v1",
name="Numerology",
positions=(
Position(
"life_path",
"Life Path",
"Core number reduced from the full birth date.",
),
Position(
"birthday",
"Birthday",
"Number reduced from the day of the month.",
),
),
)
ReductionMethod ¶
Bases: StrEnum
How the Life Path number is reduced from the birth date.
The two widely taught methods diverge only when a master number (11, 22, 33) appears in a component:
COMPONENTreduces the month, day, and year separately — each able to surface a master number — then sums and reduces the result. This is the method most numerologists consider correct, and the default.ITERATIVEsums every digit of the whole date at once, then reduces. Simpler, but it can dissolve a master number thatCOMPONENTpreserves.
NumerologyEngine ¶
Bases: AbstractEngine
Pythagorean numerology engine.
The engine deterministically reduces a querent's birth date to a Life Path number and a Birthday number, preserving the master numbers 11, 22, and 33.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reduction_method
|
ReductionMethod
|
Default Life Path reduction rule used when the request
does not specify |
COMPONENT
|
Source code in src/fortune_telling_core/traditions/numerology/engine.py
deck ¶
Return the numerology number deck.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ReadingRequest
|
Reading request whose |
required |
Returns:
| Type | Description |
|---|---|
Deck
|
The bundled numerology deck. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If the requested deck is unsupported. |
Source code in src/fortune_telling_core/traditions/numerology/engine.py
spread ¶
Return the numerology spread.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ReadingRequest
|
Reading request whose |
required |
Returns:
| Type | Description |
|---|---|
Spread
|
The bundled numerology spread. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If the requested spread is unsupported. |
Source code in src/fortune_telling_core/traditions/numerology/engine.py
draw ¶
Compute the numerology numbers as a deterministic draw.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ReadingRequest
|
Reading request with |
required |
rng
|
Rng
|
Ignored. The argument is present for |
required |
Returns:
| Type | Description |
|---|---|
Draw
|
A draw with the Life Path and Birthday selections. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If required birth data or options are invalid. |
Source code in src/fortune_telling_core/traditions/numerology/engine.py
cast ¶
Compute a numerology reading without a caller RNG.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ReadingRequest
|
Reading request containing birth data and optional configuration. |
required |
Returns:
| Type | Description |
|---|---|
Reading
|
A reading with Life Path and Birthday placements and summary text. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If required birth data or options are invalid. |
Source code in src/fortune_telling_core/traditions/numerology/engine.py
build_engine ¶
build_engine(
*,
reduction_method: ReductionMethod = ReductionMethod.COMPONENT,
) -> NumerologyEngine
Create a numerology engine.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reduction_method
|
ReductionMethod
|
Default Life Path reduction rule. |
COMPONENT
|
Returns:
| Type | Description |
|---|---|
NumerologyEngine
|
A new |