Javanese Weton¶
A Javanese weton (Primbon) engine that deterministically derives a querent's weton (seven saptawara days paired with five pancawara pasaran) and neptu from their birth datetime.
from fortune_telling_core import Querent, ReadingRequest
from fortune_telling_core.traditions.weton import WETON_DECK, WETON_SPREAD, build_engine
request = ReadingRequest(
deck_id=WETON_DECK.id,
spread_id=WETON_SPREAD.id,
querent=Querent(
id="sample",
display_name="Sample",
attributes={"birth_datetime": "1945-08-17T10:00:00+07:00"},
),
)
reading = build_engine().cast(request)
weton ¶
WETON_DECK
module-attribute
¶
WETON_DECK = Deck(
id="weton.deck.javanese.v1",
symbols=(
*(
(
Symbol(
id=day.symbol_id,
name=day.name,
attributes={
"cycle": "saptawara",
"slug": day.slug,
"javanese": day.javanese,
"weekday": str(day.weekday),
"neptu": str(day.neptu),
},
)
)
for day in SAPTAWARA
),
*(
(
Symbol(
id=pasaran.symbol_id,
name=pasaran.name,
attributes={
"cycle": "pancawara",
"slug": pasaran.slug,
"javanese": pasaran.javanese,
"index": str(pasaran.index),
"neptu": str(pasaran.neptu),
},
)
)
for pasaran in PANCAWARA
),
),
)
WETON_SPREAD
module-attribute
¶
WETON_SPREAD = Spread(
id="weton.spread.birth.v1",
name="Weton",
positions=(
Position(
"saptawara",
"Saptawara",
"Day of the seven-day week with its neptu.",
),
Position(
"pancawara",
"Pancawara",
"Pasaran of the five-day market week with its neptu.",
),
),
)
DayBoundary ¶
Bases: StrEnum
When the Javanese day (and therefore the weton) rolls over.
The Javanese day traditionally begins at sunset rather than at midnight, so an evening birth can belong to the following weton. Sunset times depend on location, so this dependency-free engine approximates the sunset boundary with a fixed local-clock threshold of 18:00.
WetonEngine ¶
Bases: AbstractEngine
Javanese weton engine.
The engine deterministically derives the saptawara (seven-day week) and pancawara (five-day pasaran) from a birth datetime, then records both with their neptu values and the combined weton neptu.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
day_boundary
|
DayBoundary
|
Default Javanese day-rollover rule used when the request
does not specify |
MIDNIGHT
|
Source code in src/fortune_telling_core/traditions/weton/engine.py
deck ¶
Return the weton deck.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ReadingRequest
|
Reading request whose |
required |
Returns:
| Type | Description |
|---|---|
Deck
|
The bundled weton deck. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If the requested deck is unsupported. |
Source code in src/fortune_telling_core/traditions/weton/engine.py
spread ¶
Return the weton spread.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ReadingRequest
|
Reading request whose |
required |
Returns:
| Type | Description |
|---|---|
Spread
|
The bundled weton spread. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If the requested spread is unsupported. |
Source code in src/fortune_telling_core/traditions/weton/engine.py
draw ¶
Compute the weton 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 saptawara and pancawara selections. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If required birth data or options are invalid. |
Source code in src/fortune_telling_core/traditions/weton/engine.py
cast ¶
Compute a weton 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 saptawara and pancawara placements and weton summary |
Reading
|
text. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If required birth data or options are invalid. |
Source code in src/fortune_telling_core/traditions/weton/engine.py
build_engine ¶
Create a weton engine.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
day_boundary
|
DayBoundary
|
Default Javanese day-rollover rule. |
MIDNIGHT
|
Returns:
| Type | Description |
|---|---|
WetonEngine
|
A new |