kerykeion 4.0.3__py3-none-any.whl → 4.8.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of kerykeion might be problematic. Click here for more details.
- kerykeion/__init__.py +4 -3
- kerykeion/aspects/__init__.py +2 -2
- kerykeion/aspects/aspects_utils.py +186 -0
- kerykeion/aspects/natal_aspects.py +51 -221
- kerykeion/aspects/synastry_aspects.py +43 -20
- kerykeion/astrological_subject.py +185 -124
- kerykeion/charts/__init__.py +1 -1
- kerykeion/charts/charts_utils.py +339 -5
- kerykeion/charts/kerykeion_chart_svg.py +392 -516
- kerykeion/charts/templates/chart.xml +41 -14
- kerykeion/enums.py +50 -0
- kerykeion/fetch_geonames.py +16 -25
- kerykeion/kr_types/__init__.py +7 -0
- kerykeion/kr_types/chart_types.py +32 -32
- kerykeion/kr_types/kerykeion_exception.py +1 -1
- kerykeion/kr_types/kr_literals.py +11 -1
- kerykeion/kr_types/kr_models.py +14 -8
- kerykeion/kr_types/settings_models.py +180 -0
- kerykeion/relationship_score.py +7 -13
- kerykeion/report.py +3 -0
- kerykeion/settings/__init__.py +1 -1
- kerykeion/settings/kerykeion_settings.py +35 -177
- kerykeion/settings/kr.config.json +13 -9
- kerykeion/utilities.py +153 -4
- {kerykeion-4.0.3.dist-info → kerykeion-4.8.1.dist-info}/METADATA +16 -2
- kerykeion-4.8.1.dist-info/RECORD +32 -0
- {kerykeion-4.0.3.dist-info → kerykeion-4.8.1.dist-info}/WHEEL +1 -1
- kerykeion-4.0.3.dist-info/RECORD +0 -29
- {kerykeion-4.0.3.dist-info → kerykeion-4.8.1.dist-info}/LICENSE +0 -0
- {kerykeion-4.0.3.dist-info → kerykeion-4.8.1.dist-info}/entry_points.txt +0 -0
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
<?xml version='1.0' encoding='UTF-8'?>
|
|
2
|
-
|
|
3
|
-
<!---
|
|
4
|
-
This file is part of Kerykeion and is based on OpenAstro.org -->
|
|
2
|
+
<!--- This file is part of Kerykeion and is based on OpenAstro.org -->
|
|
5
3
|
<svg
|
|
6
4
|
xmlns="http://www.w3.org/2000/svg"
|
|
7
5
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
@@ -10,11 +8,11 @@ This file is part of Kerykeion and is based on OpenAstro.org -->
|
|
|
10
8
|
viewBox="$viewbox"
|
|
11
9
|
preserveAspectRatio="xMidYMid"
|
|
12
10
|
>
|
|
13
|
-
<title
|
|
11
|
+
<title>$stringTitle | Kerykeion</title>
|
|
14
12
|
<g transform="translate($cfgTranslate)">
|
|
15
13
|
<g transform="rotate($cfgRotate)">
|
|
16
14
|
<g transform="scale($cfgZoom)">
|
|
17
|
-
<rect x="0" y="0" width="$chart_width" height="
|
|
15
|
+
<rect class="background-rectangle" x="0" y="0" width="$chart_width" height="$chart_height" style="fill: $paper_color_1" />
|
|
18
16
|
<text x="20" y="30" style="fill: $paper_color_0; font-size: 24px">$stringTitle</text>
|
|
19
17
|
<text x="20" y="50" style="fill: $paper_color_0; font-size: 11px">$stringName</text>
|
|
20
18
|
<text x="20" y="62" style="fill: $paper_color_0; font-size: 11px">$stringLocation</text>
|
|
@@ -469,20 +467,49 @@ This file is part of Kerykeion and is based on OpenAstro.org -->
|
|
|
469
467
|
</symbol>
|
|
470
468
|
<g transform="translate(50,50)">
|
|
471
469
|
<g transform="translate($circleX,$circleY)">
|
|
472
|
-
<!-- Zodiac
|
|
473
|
-
|
|
470
|
+
<!-- Zodiac -->
|
|
471
|
+
$makeZodiac
|
|
472
|
+
|
|
473
|
+
<!-- First Circle -->
|
|
474
|
+
$first_circle
|
|
475
|
+
|
|
474
476
|
<!-- Second Circle -->
|
|
475
|
-
|
|
476
|
-
|
|
477
|
+
$second_circle
|
|
478
|
+
|
|
477
479
|
<!-- Third Circle -->
|
|
478
480
|
<circle $c3 style="$c3style" />
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
481
|
+
|
|
482
|
+
<!-- TransitRing -->
|
|
483
|
+
$transitRing
|
|
484
|
+
|
|
485
|
+
<!-- Degree Ring -->
|
|
486
|
+
$degreeRing
|
|
487
|
+
|
|
488
|
+
<!-- Houses -->
|
|
489
|
+
$makeHouses
|
|
490
|
+
|
|
491
|
+
<!-- Planets -->
|
|
492
|
+
$makePlanets
|
|
493
|
+
|
|
494
|
+
<!-- Aspects -->
|
|
495
|
+
$makeAspects
|
|
496
|
+
</g>
|
|
497
|
+
|
|
498
|
+
<!-- makePatterns -->
|
|
499
|
+
$makePatterns
|
|
500
|
+
|
|
501
|
+
<!-- AspectGrid -->
|
|
483
502
|
$makeAspectGrid
|
|
484
|
-
|
|
503
|
+
|
|
504
|
+
<!-- Elements -->
|
|
505
|
+
$elements_percentages
|
|
506
|
+
|
|
507
|
+
<!-- Planet Grid -->
|
|
508
|
+
$makePlanetGrid
|
|
509
|
+
|
|
510
|
+
<!-- Houses Grid -->
|
|
485
511
|
$makeHousesGrid
|
|
512
|
+
|
|
486
513
|
</g>
|
|
487
514
|
</g>
|
|
488
515
|
</g>
|
kerykeion/enums.py
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Planets(Enum):
|
|
5
|
+
SUN = "Sun"
|
|
6
|
+
MOON = "Moon"
|
|
7
|
+
MERCURY = "Mercury"
|
|
8
|
+
VENUS = "Venus"
|
|
9
|
+
MARS = "Mars"
|
|
10
|
+
JUPITER = "Jupiter"
|
|
11
|
+
SATURN = "Saturn"
|
|
12
|
+
URANUS = "Uranus"
|
|
13
|
+
NEPTUNE = "Neptune"
|
|
14
|
+
PLUTO = "Pluto"
|
|
15
|
+
CHIRON = "Chiron"
|
|
16
|
+
TRUE_NODE = "True_Node"
|
|
17
|
+
MEAN_NODE = "Mean_Node"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class Aspects(Enum):
|
|
21
|
+
CONJUNCTION = "Conjunction"
|
|
22
|
+
SEXTILE = "Sextile"
|
|
23
|
+
SEMI_SEXTILE = "Semi-Sextile"
|
|
24
|
+
SQUARE = "Square"
|
|
25
|
+
TRINE = "Trine"
|
|
26
|
+
OPPOSITION = "Opposition"
|
|
27
|
+
QUINCUNX = "Quincunx"
|
|
28
|
+
NONE = None
|
|
29
|
+
QUINTILE = "Quintile"
|
|
30
|
+
BIQUINTILE = "Biquintile"
|
|
31
|
+
OCTILE = "Octile"
|
|
32
|
+
TRIOCTILE = "Trioctile"
|
|
33
|
+
DECILE = "Decile"
|
|
34
|
+
TRIDECILE = "Tridecile"
|
|
35
|
+
SESQUIQUADRATE = "Sesquiquadrate"
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class Signs(Enum):
|
|
39
|
+
ARI = "Ari"
|
|
40
|
+
TAU = "Tau"
|
|
41
|
+
GEM = "Gem"
|
|
42
|
+
CAN = "Can"
|
|
43
|
+
LEO = "Leo"
|
|
44
|
+
VIR = "Vir"
|
|
45
|
+
LIB = "Lib"
|
|
46
|
+
SCO = "Sco"
|
|
47
|
+
SAG = "Sag"
|
|
48
|
+
CAP = "Cap"
|
|
49
|
+
AQU = "Aqu"
|
|
50
|
+
PIS = "Pis"
|
kerykeion/fetch_geonames.py
CHANGED
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
"""
|
|
3
|
-
This is part of Kerykeion (C)
|
|
3
|
+
This is part of Kerykeion (C) 2024 Giacomo Battaglia
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import logging
|
|
8
8
|
from requests import Request
|
|
9
9
|
from requests_cache import CachedSession
|
|
10
10
|
from typing import Union
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
logger = getLogger(__name__)
|
|
14
|
-
basicConfig(
|
|
15
|
-
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
|
16
|
-
level="INFO"
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
|
|
20
13
|
class FetchGeonames:
|
|
21
14
|
"""
|
|
22
15
|
Class to handle requests to the GeoNames API
|
|
@@ -25,8 +18,6 @@ class FetchGeonames:
|
|
|
25
18
|
city_name (str): Name of the city
|
|
26
19
|
country_code (str): Two letters country code
|
|
27
20
|
username (str, optional): GeoNames username, defaults to "century.boy".
|
|
28
|
-
logger (Union[logging.Logger, None], optional):
|
|
29
|
-
Optional logger, defaults to None. If none provided creates one.
|
|
30
21
|
"""
|
|
31
22
|
|
|
32
23
|
def __init__(
|
|
@@ -57,21 +48,21 @@ class FetchGeonames:
|
|
|
57
48
|
params = {"lat": lat, "lng": lon, "username": self.username}
|
|
58
49
|
|
|
59
50
|
prepared_request = Request("GET", self.timezone_url, params=params).prepare()
|
|
60
|
-
|
|
51
|
+
logging.debug(f"Requesting data from GeoName timezones: {prepared_request.url}")
|
|
61
52
|
|
|
62
53
|
try:
|
|
63
54
|
response = self.session.send(prepared_request)
|
|
64
55
|
response_json = response.json()
|
|
65
56
|
|
|
66
57
|
except Exception as e:
|
|
67
|
-
|
|
58
|
+
logging.error(f"Error fetching {self.timezone_url}: {e}")
|
|
68
59
|
return {}
|
|
69
60
|
|
|
70
61
|
try:
|
|
71
62
|
timezone_data["timezonestr"] = response_json["timezoneId"]
|
|
72
63
|
|
|
73
64
|
except Exception as e:
|
|
74
|
-
|
|
65
|
+
logging.error(f"Error serializing data maybe wrong username? Details: {e}")
|
|
75
66
|
return {}
|
|
76
67
|
|
|
77
68
|
if hasattr(response, "from_cache"):
|
|
@@ -91,18 +82,21 @@ class FetchGeonames:
|
|
|
91
82
|
"contry": country_code,
|
|
92
83
|
"username": self.username,
|
|
93
84
|
"maxRows": 1,
|
|
94
|
-
"style": "
|
|
85
|
+
"style": "SHORT",
|
|
86
|
+
"featureClass": "A",
|
|
87
|
+
"featureClass": "P",
|
|
95
88
|
}
|
|
96
89
|
|
|
97
90
|
prepared_request = Request("GET", self.base_url, params=params).prepare()
|
|
98
|
-
|
|
91
|
+
logging.debug(f"Requesting data from geonames basic: {prepared_request.url}")
|
|
99
92
|
|
|
100
93
|
try:
|
|
101
94
|
response = self.session.send(prepared_request)
|
|
102
95
|
response_json = response.json()
|
|
96
|
+
logging.debug(f"Response from GeoNames: {response_json}")
|
|
103
97
|
|
|
104
98
|
except Exception as e:
|
|
105
|
-
|
|
99
|
+
logging.error(f"Error in fetching {self.base_url}: {e}")
|
|
106
100
|
return {}
|
|
107
101
|
|
|
108
102
|
try:
|
|
@@ -112,7 +106,7 @@ class FetchGeonames:
|
|
|
112
106
|
city_data_whitout_tz["countryCode"] = response_json["geonames"][0]["countryCode"]
|
|
113
107
|
|
|
114
108
|
except Exception as e:
|
|
115
|
-
|
|
109
|
+
logging.error(f"Error serializing data maybe wrong username? Details: {e}")
|
|
116
110
|
return {}
|
|
117
111
|
|
|
118
112
|
if hasattr(response, "from_cache"):
|
|
@@ -132,18 +126,15 @@ class FetchGeonames:
|
|
|
132
126
|
timezone_response = self.__get_timezone(city_data_response["lat"], city_data_response["lng"])
|
|
133
127
|
|
|
134
128
|
except Exception as e:
|
|
135
|
-
|
|
129
|
+
logging.error(f"Error in fetching timezone: {e}")
|
|
136
130
|
return {}
|
|
137
131
|
|
|
138
132
|
return {**timezone_response, **city_data_response}
|
|
139
133
|
|
|
140
134
|
|
|
141
135
|
if __name__ == "__main__":
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
level="DEBUG",
|
|
145
|
-
force=True,
|
|
146
|
-
)
|
|
136
|
+
from kerykeion.utilities import setup_logging
|
|
137
|
+
setup_logging(level="debug")
|
|
147
138
|
|
|
148
|
-
geonames = FetchGeonames("
|
|
139
|
+
geonames = FetchGeonames("Montichiari", "IT")
|
|
149
140
|
print(geonames.get_serialized_data())
|
kerykeion/kr_types/__init__.py
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""
|
|
3
|
+
This is part of Kerykeion (C) 2024 Giacomo Battaglia
|
|
4
|
+
"""
|
|
5
|
+
|
|
1
6
|
from .kerykeion_exception import KerykeionException
|
|
2
7
|
from .kr_literals import *
|
|
3
8
|
from .kr_models import *
|
|
9
|
+
from .chart_types import ChartTemplateDictionary
|
|
10
|
+
from .settings_models import KerykeionSettingsModel
|
|
@@ -1,32 +1,22 @@
|
|
|
1
|
-
from typing import
|
|
2
|
-
from pydantic import BaseModel
|
|
1
|
+
from typing import TypedDict
|
|
3
2
|
|
|
4
3
|
|
|
5
|
-
class
|
|
6
|
-
"""Pydantic model for the chart template."""
|
|
7
|
-
|
|
8
|
-
def __setitem__(self, key, value):
|
|
9
|
-
setattr(self, key, value)
|
|
10
|
-
|
|
11
|
-
def __getitem__(self, key):
|
|
12
|
-
return getattr(self, key)
|
|
13
|
-
|
|
4
|
+
class ChartTemplateDictionary(TypedDict):
|
|
14
5
|
transitRing: str
|
|
15
6
|
degreeRing: str
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
c2: str
|
|
19
|
-
c2style: str
|
|
7
|
+
first_circle: str
|
|
8
|
+
second_circle: str
|
|
20
9
|
c3: str
|
|
21
10
|
c3style: str
|
|
22
|
-
makeAspects:
|
|
23
|
-
makeAspectGrid:
|
|
24
|
-
makePatterns:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
11
|
+
makeAspects: str
|
|
12
|
+
makeAspectGrid: str
|
|
13
|
+
makePatterns: str
|
|
14
|
+
chart_height: float
|
|
15
|
+
chart_width: float
|
|
16
|
+
circleX: str
|
|
17
|
+
circleY: str
|
|
18
|
+
svgWidth: str
|
|
19
|
+
svgHeight: str
|
|
30
20
|
viewbox: str
|
|
31
21
|
stringTitle: str
|
|
32
22
|
stringName: str
|
|
@@ -39,14 +29,19 @@ class ChartTemplateModel(BaseModel):
|
|
|
39
29
|
lunar_phase_cx: int
|
|
40
30
|
lunar_phase_r: int
|
|
41
31
|
lunar_phase_outline: str
|
|
42
|
-
lunar_phase_rotate:
|
|
32
|
+
lunar_phase_rotate: float
|
|
43
33
|
stringLocation: str
|
|
44
34
|
stringDateTime: str
|
|
45
35
|
stringLat: str
|
|
46
36
|
stringLon: str
|
|
47
37
|
stringPosition: str
|
|
38
|
+
|
|
39
|
+
# Font color
|
|
48
40
|
paper_color_0: str
|
|
41
|
+
# Background color of the chart
|
|
49
42
|
paper_color_1: str
|
|
43
|
+
|
|
44
|
+
# Planets colors, from 1 to 15 (0 is the Sun)
|
|
50
45
|
planets_color_0: str
|
|
51
46
|
planets_color_1: str
|
|
52
47
|
planets_color_2: str
|
|
@@ -63,6 +58,8 @@ class ChartTemplateModel(BaseModel):
|
|
|
63
58
|
planets_color_13: str
|
|
64
59
|
planets_color_14: str
|
|
65
60
|
planets_color_15: str
|
|
61
|
+
|
|
62
|
+
# Zodiac colors, from 0 to 11 (0 is Aries)
|
|
66
63
|
zodiac_color_0: str
|
|
67
64
|
zodiac_color_1: str
|
|
68
65
|
zodiac_color_2: str
|
|
@@ -75,6 +72,8 @@ class ChartTemplateModel(BaseModel):
|
|
|
75
72
|
zodiac_color_9: str
|
|
76
73
|
zodiac_color_10: str
|
|
77
74
|
zodiac_color_11: str
|
|
75
|
+
|
|
76
|
+
# Aspects colors, from 0 to 9 (0 is conjunction)
|
|
78
77
|
orb_color_0: str
|
|
79
78
|
orb_color_30: str
|
|
80
79
|
orb_color_45: str
|
|
@@ -86,12 +85,13 @@ class ChartTemplateModel(BaseModel):
|
|
|
86
85
|
orb_color_144: str
|
|
87
86
|
orb_color_150: str
|
|
88
87
|
orb_color_180: str
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
|
|
89
|
+
cfgZoom: str
|
|
90
|
+
cfgRotate: str
|
|
91
91
|
cfgTranslate: str
|
|
92
|
-
makeZodiac:
|
|
93
|
-
makeHouses:
|
|
94
|
-
makePlanets:
|
|
95
|
-
|
|
96
|
-
makePlanetGrid:
|
|
97
|
-
makeHousesGrid:
|
|
92
|
+
makeZodiac: str
|
|
93
|
+
makeHouses: str
|
|
94
|
+
makePlanets: str
|
|
95
|
+
elements_percentages: str
|
|
96
|
+
makePlanetGrid: str
|
|
97
|
+
makeHousesGrid: str
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
"""
|
|
3
|
-
This is part of Kerykeion (C)
|
|
3
|
+
This is part of Kerykeion (C) 2024 Giacomo Battaglia
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
6
|
|
|
@@ -56,3 +56,13 @@ Quality = Literal[
|
|
|
56
56
|
ChartType = Literal["Natal", "ExternalNatal", "Synastry", "Transit"]
|
|
57
57
|
|
|
58
58
|
LunarPhaseEmoji = Literal["🌑", "🌒", "🌓", "🌔", "🌕", "🌖", "🌗", "🌘"]
|
|
59
|
+
LunarPhaseName = Literal[
|
|
60
|
+
"New Moon",
|
|
61
|
+
"Waxing Crescent",
|
|
62
|
+
"First Quarter",
|
|
63
|
+
"Waxing Gibbous",
|
|
64
|
+
"Full Moon",
|
|
65
|
+
"Waning Gibbous",
|
|
66
|
+
"Last Quarter",
|
|
67
|
+
"Waning Crescent"
|
|
68
|
+
]
|
kerykeion/kr_types/kr_models.py
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
"""
|
|
3
|
-
This is part of Kerykeion (C)
|
|
3
|
+
This is part of Kerykeion (C) 2024 Giacomo Battaglia
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
from typing import Literal, Union, Optional
|
|
8
8
|
from pydantic import BaseModel
|
|
9
9
|
|
|
10
|
-
from .
|
|
10
|
+
from kerykeion.kr_types import LunarPhaseEmoji, LunarPhaseName, Planet, Houses, Quality, Element, Sign, ZodiacType
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class LunarPhaseModel(BaseModel):
|
|
14
|
-
degrees_between_s_m: Union[
|
|
14
|
+
degrees_between_s_m: Union[float, int]
|
|
15
15
|
moon_phase: int
|
|
16
16
|
sun_phase: int
|
|
17
17
|
moon_emoji: LunarPhaseEmoji
|
|
18
|
+
moon_phase_name: LunarPhaseName
|
|
18
19
|
|
|
19
20
|
def __str__(self):
|
|
20
21
|
return (
|
|
21
22
|
super()
|
|
22
|
-
.
|
|
23
|
+
.model_dump(
|
|
23
24
|
exclude_none=True,
|
|
24
25
|
exclude_unset=True,
|
|
25
26
|
exclude_defaults=True,
|
|
@@ -31,7 +32,7 @@ class LunarPhaseModel(BaseModel):
|
|
|
31
32
|
def __repr__(self):
|
|
32
33
|
return (
|
|
33
34
|
super()
|
|
34
|
-
.
|
|
35
|
+
.model_dump(
|
|
35
36
|
exclude_none=True,
|
|
36
37
|
exclude_unset=True,
|
|
37
38
|
exclude_defaults=True,
|
|
@@ -73,7 +74,7 @@ class KerykeionPointModel(BaseModel):
|
|
|
73
74
|
def __str__(self):
|
|
74
75
|
return (
|
|
75
76
|
super()
|
|
76
|
-
.
|
|
77
|
+
.model_dump(
|
|
77
78
|
exclude_none=True,
|
|
78
79
|
exclude_unset=True,
|
|
79
80
|
exclude_defaults=True,
|
|
@@ -85,7 +86,7 @@ class KerykeionPointModel(BaseModel):
|
|
|
85
86
|
def __repr__(self):
|
|
86
87
|
return (
|
|
87
88
|
super()
|
|
88
|
-
.
|
|
89
|
+
.model_dump(
|
|
89
90
|
exclude_none=True,
|
|
90
91
|
exclude_unset=True,
|
|
91
92
|
exclude_defaults=True,
|
|
@@ -136,6 +137,7 @@ class AstrologicalSubjectModel(BaseModel):
|
|
|
136
137
|
uranus: KerykeionPointModel
|
|
137
138
|
neptune: KerykeionPointModel
|
|
138
139
|
pluto: KerykeionPointModel
|
|
140
|
+
chiron: Union[KerykeionPointModel, None]
|
|
139
141
|
|
|
140
142
|
# Houses
|
|
141
143
|
first_house: KerykeionPointModel
|
|
@@ -160,6 +162,10 @@ class AstrologicalSubjectModel(BaseModel):
|
|
|
160
162
|
|
|
161
163
|
|
|
162
164
|
if __name__ == "__main__":
|
|
165
|
+
from kerykeion.utilities import setup_logging
|
|
166
|
+
|
|
167
|
+
setup_logging(level="debug")
|
|
168
|
+
|
|
163
169
|
sun = KerykeionPointModel(
|
|
164
170
|
name="Sun",
|
|
165
171
|
element="Air",
|
|
@@ -172,5 +178,5 @@ if __name__ == "__main__":
|
|
|
172
178
|
point_type="Planet",
|
|
173
179
|
)
|
|
174
180
|
|
|
175
|
-
print(sun.
|
|
181
|
+
print(sun.model_dump_json())
|
|
176
182
|
print(sun)
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""
|
|
3
|
+
This is part of Kerykeion (C) 2024 Giacomo Battaglia
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
from pydantic import BaseModel, Field
|
|
8
|
+
from typing import List
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class CustomBaseModel(BaseModel):
|
|
12
|
+
"""
|
|
13
|
+
Extends the BaseModel class of Pydantic to add some useful methods.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
def __init__(self, **data):
|
|
17
|
+
super().__init__(**data)
|
|
18
|
+
|
|
19
|
+
def __getitem__(self, item):
|
|
20
|
+
return getattr(self, item)
|
|
21
|
+
|
|
22
|
+
def __str__(self) -> str:
|
|
23
|
+
return str(self.model_dump())
|
|
24
|
+
|
|
25
|
+
def get(self, item, default=None):
|
|
26
|
+
return getattr(self, item, default)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class KerykeionSettingsCelestialPointModel(CustomBaseModel):
|
|
30
|
+
"""
|
|
31
|
+
Defines the model for a celestial point data.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
id: int = Field(title="Celestial Point ID", description="Celestial Point ID according to Pyswisseph")
|
|
35
|
+
name: str = Field(title="Celestial Point Name", description="Celestial Point Name")
|
|
36
|
+
color: str = Field(title="Celestial Point Color", description="Celestial Point Color, used in the chart")
|
|
37
|
+
is_active: bool = Field(title="Celestial Point is Active", description="Indicates if the celestial point is active in the chart")
|
|
38
|
+
element_points: int = Field(title="Celestial Point Element Points", description="Element Points given to the celestial point")
|
|
39
|
+
related_zodiac_signs: List[int] = Field(title="Celestial Point Related Zodiac Signs", description="Zodiac Signs related to the celestial point")
|
|
40
|
+
label: str = Field(title="Celestial Point Label", description="The name of the celestial point in the chart, it can be different from the name")
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# Chart Colors Settings
|
|
44
|
+
class KerykeionSettingsChartColorsModel(CustomBaseModel):
|
|
45
|
+
"""
|
|
46
|
+
Defines the model for the chart colors.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
paper_0: str = Field(title="Paper Color 0", description="Paper Color 0")
|
|
50
|
+
paper_1: str = Field(title="Paper Color 1", description="Paper Color 1")
|
|
51
|
+
zodiac_bg_0: str = Field(title="Zodiac Background Color 0", description="Zodiac Background Color 0")
|
|
52
|
+
zodiac_bg_1: str = Field(title="Zodiac Background Color 1", description="Zodiac Background Color 1")
|
|
53
|
+
zodiac_bg_2: str = Field(title="Zodiac Background Color 2", description="Zodiac Background Color 2")
|
|
54
|
+
zodiac_bg_3: str = Field(title="Zodiac Background Color 3", description="Zodiac Background Color 3")
|
|
55
|
+
zodiac_bg_4: str = Field(title="Zodiac Background Color 4", description="Zodiac Background Color 4")
|
|
56
|
+
zodiac_bg_5: str = Field(title="Zodiac Background Color 5", description="Zodiac Background Color 5")
|
|
57
|
+
zodiac_bg_6: str = Field(title="Zodiac Background Color 6", description="Zodiac Background Color 6")
|
|
58
|
+
zodiac_bg_7: str = Field(title="Zodiac Background Color 7", description="Zodiac Background Color 7")
|
|
59
|
+
zodiac_bg_8: str = Field(title="Zodiac Background Color 8", description="Zodiac Background Color 8")
|
|
60
|
+
zodiac_bg_9: str = Field(title="Zodiac Background Color 9", description="Zodiac Background Color 9")
|
|
61
|
+
zodiac_bg_10: str = Field(title="Zodiac Background Color 10", description="Zodiac Background Color 10")
|
|
62
|
+
zodiac_bg_11: str = Field(title="Zodiac Background Color 11", description="Zodiac Background Color 11")
|
|
63
|
+
zodiac_icon_0: str = Field(title="Zodiac Icon Color 0", description="Zodiac Icon Color 0")
|
|
64
|
+
zodiac_icon_1: str = Field(title="Zodiac Icon Color 1", description="Zodiac Icon Color 1")
|
|
65
|
+
zodiac_icon_2: str = Field(title="Zodiac Icon Color 2", description="Zodiac Icon Color 2")
|
|
66
|
+
zodiac_icon_3: str = Field(title="Zodiac Icon Color 3", description="Zodiac Icon Color 3")
|
|
67
|
+
zodiac_icon_4: str = Field(title="Zodiac Icon Color 4", description="Zodiac Icon Color 4")
|
|
68
|
+
zodiac_icon_5: str = Field(title="Zodiac Icon Color 5", description="Zodiac Icon Color 5")
|
|
69
|
+
zodiac_icon_6: str = Field(title="Zodiac Icon Color 6", description="Zodiac Icon Color 6")
|
|
70
|
+
zodiac_icon_7: str = Field(title="Zodiac Icon Color 7", description="Zodiac Icon Color 7")
|
|
71
|
+
zodiac_icon_8: str = Field(title="Zodiac Icon Color 8", description="Zodiac Icon Color 8")
|
|
72
|
+
zodiac_icon_9: str = Field(title="Zodiac Icon Color 9", description="Zodiac Icon Color 9")
|
|
73
|
+
zodiac_icon_10: str = Field(title="Zodiac Icon Color 10", description="Zodiac Icon Color 10")
|
|
74
|
+
zodiac_icon_11: str = Field(title="Zodiac Icon Color 11", description="Zodiac Icon Color 11")
|
|
75
|
+
zodiac_radix_ring_0: str = Field(title="Zodiac Radix Ring Color 0", description="Zodiac Radix Ring Color 0")
|
|
76
|
+
zodiac_radix_ring_1: str = Field(title="Zodiac Radix Ring Color 1", description="Zodiac Radix Ring Color 1")
|
|
77
|
+
zodiac_radix_ring_2: str = Field(title="Zodiac Radix Ring Color 2", description="Zodiac Radix Ring Color 2")
|
|
78
|
+
zodiac_transit_ring_0: str = Field(title="Zodiac Transit Ring Color 0", description="Zodiac Transit Ring Color 0")
|
|
79
|
+
zodiac_transit_ring_1: str = Field(title="Zodiac Transit Ring Color 1", description="Zodiac Transit Ring Color 1")
|
|
80
|
+
zodiac_transit_ring_2: str = Field(title="Zodiac Transit Ring Color 2", description="Zodiac Transit Ring Color 2")
|
|
81
|
+
zodiac_transit_ring_3: str = Field(title="Zodiac Transit Ring Color 3", description="Zodiac Transit Ring Color 3")
|
|
82
|
+
houses_radix_line: str = Field(title="Houses Radix Line Color", description="Houses Radix Line Color")
|
|
83
|
+
houses_transit_line: str = Field(title="Houses Transit Line Color", description="Houses Transit Line Color")
|
|
84
|
+
lunar_phase_0: str = Field(title="Lunar Phase Color 0", description="Lunar Phase Color 0")
|
|
85
|
+
lunar_phase_1: str = Field(title="Lunar Phase Color 1", description="Lunar Phase Color 1")
|
|
86
|
+
lunar_phase_2: str = Field(title="Lunar Phase Color 2", description="Lunar Phase Color 2")
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
# Aspect Settings
|
|
90
|
+
class KerykeionSettingsAspectModel(CustomBaseModel):
|
|
91
|
+
"""
|
|
92
|
+
Defines the model for an aspect.
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
degree: int = Field(title="Aspect Degrees", description="The degree of the aspect")
|
|
96
|
+
name: str = Field(title="Aspect Name", description="The name of the aspect")
|
|
97
|
+
is_active: bool = Field(title="Aspect is Active", description="Is the aspect active?")
|
|
98
|
+
visible_grid: bool = Field(title="Aspect Visible Grid", description="Is the aspect visible in the grid?")
|
|
99
|
+
is_major: bool = Field(title="Aspect is Major", description="Is the aspect major?")
|
|
100
|
+
is_minor: bool = Field(title="Aspect is Minor", description="Is the aspect minor?")
|
|
101
|
+
orb: int = Field(title="Aspect Orb", description="The orb of the aspect")
|
|
102
|
+
color: str = Field(title="Aspect Color", description="The color of the aspect")
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
# Language Settings
|
|
106
|
+
class KerykeionLanguageCelestialPointModel(CustomBaseModel):
|
|
107
|
+
"""
|
|
108
|
+
This class is used to define the labels, show in the chart, for the celestial points.
|
|
109
|
+
It is used to translate the celestial points in the language of the chart.
|
|
110
|
+
"""
|
|
111
|
+
|
|
112
|
+
Sun: str = Field(title="Sun", description="The name of the Sun in the chart, in the language")
|
|
113
|
+
Moon: str = Field(title="Moon", description="The name of the Moon in the chart, in the language")
|
|
114
|
+
Mercury: str = Field(title="Mercury", description="The name of Mercury in the chart, in the language")
|
|
115
|
+
Venus: str = Field(title="Venus", description="The name of Venus in the chart, in the language")
|
|
116
|
+
Mars: str = Field(title="Mars", description="The name of Mars in the chart, in the language")
|
|
117
|
+
Jupiter: str = Field(title="Jupiter", description="The name of Jupiter in the chart, in the language")
|
|
118
|
+
Saturn: str = Field(title="Saturn", description="The name of Saturn in the chart, in the language")
|
|
119
|
+
Uranus: str = Field(title="Uranus", description="The name of Uranus in the chart, in the language")
|
|
120
|
+
Neptune: str = Field(title="Neptune", description="The name of Neptune in the chart, in the language")
|
|
121
|
+
Pluto: str = Field(title="Pluto", description="The name of Pluto in the chart, in the language")
|
|
122
|
+
True_Node: str = Field(title="True Node", description="The name of True Node in the chart, in the language")
|
|
123
|
+
Mean_Node: str = Field(title="Mean Node", description="The name of Mean Node in the chart, in the language")
|
|
124
|
+
Chiron: str = Field(title="Chiron", description="The name of Chiron in the chart, in the language")
|
|
125
|
+
Asc: str = Field(title="Ascendant", description="The name of Ascendant in the chart, in the language")
|
|
126
|
+
Mc: str = Field(title="Medium Coeli", description="The name of Medium Coeli in the chart, in the language")
|
|
127
|
+
Dsc: str = Field(title="Descendant", description="The name of Descendant in the chart, in the language")
|
|
128
|
+
Ic: str = Field(title="Imum Coeli", description="The name of Imum Coeli in the chart, in the language")
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
class KerykeionLanguageModel(CustomBaseModel):
|
|
132
|
+
"""
|
|
133
|
+
This model is used to store the language settings for the chart,
|
|
134
|
+
it's used to translate the celestial points and the other labels
|
|
135
|
+
"""
|
|
136
|
+
|
|
137
|
+
info: str = Field(title="Info", description="The name of the Info label in the chart, in the language")
|
|
138
|
+
cusp: str = Field(title="Cusp", description="The name of the Cusp label in the chart, in the language")
|
|
139
|
+
longitude: str = Field(title="Longitude", description="The name of the Longitude label in the chart, in the language")
|
|
140
|
+
latitude: str = Field(title="Latitude", description="The name of the Latitude label in the chart, in the language")
|
|
141
|
+
north: str = Field(title="North", description="The name of the North label in the chart, in the language")
|
|
142
|
+
east: str = Field(title="East", description="The name of the East label in the chart, in the language")
|
|
143
|
+
south: str = Field(title="South", description="The name of the South label in the chart, in the language")
|
|
144
|
+
west: str = Field(title="West", description="The name of the West label in the chart, in the language")
|
|
145
|
+
fire: str = Field(title="Fire", description="The name of the Fire label in the chart, in the language")
|
|
146
|
+
earth: str = Field(title="Earth", description="The name of the Earth label in the chart, in the language")
|
|
147
|
+
air: str = Field(title="Air", description="The name of the Air label in the chart, in the language")
|
|
148
|
+
water: str = Field(title="Water", description="The name of the Water label in the chart, in the language")
|
|
149
|
+
and_word: str = Field(title="And", description="The name of the And word in the chart, in the language")
|
|
150
|
+
transits: str = Field(title="Transits", description="The name of the Transits label in the chart, in the language")
|
|
151
|
+
type: str = Field(title="Type", description="The name of the Type label in the chart, in the language")
|
|
152
|
+
aspects: str = Field(title="Aspects", description="The name of the Aspects label in the chart, in the language")
|
|
153
|
+
planets_and_house: str = Field(title="Planets and Houses", description="The name of the Planets and Houses label in the chart, in the language")
|
|
154
|
+
transit_name: str = Field(title="Transit Name", description="The name of the Transit Name label in the chart, in the language")
|
|
155
|
+
lunar_phase: str = Field(title="Lunar Phase", description="The name of the Lunar Phase label in the chart, in the language")
|
|
156
|
+
day: str = Field(title="Day", description="The name of the Day label in the chart, in the language")
|
|
157
|
+
celestial_points: KerykeionLanguageCelestialPointModel
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
class KerykeionGeneralSettingsModel(CustomBaseModel):
|
|
161
|
+
axes_orbit: int = Field(title="Axes Orbit", description="The orbit of the axes in the chart")
|
|
162
|
+
planet_in_zodiac_extra_points: int = Field(title="Planet in Zodiac Extra Points", description="The extra points of the planet in the zodiac")
|
|
163
|
+
language: str = Field(title="Language", description="The language of the chart")
|
|
164
|
+
|
|
165
|
+
class KerykeionChartSettingsModel(CustomBaseModel):
|
|
166
|
+
basic_chart_viewBox: str = Field(title="Basic Chart ViewBox", description="The viewbox of the basic chart")
|
|
167
|
+
wide_chart_viewBox: str = Field(title="Wide Chart ViewBox", description="The viewbox of the wide chart")
|
|
168
|
+
|
|
169
|
+
# Settings Model
|
|
170
|
+
class KerykeionSettingsModel(CustomBaseModel):
|
|
171
|
+
"""
|
|
172
|
+
This class is used to define the global settings for the Kerykeion.
|
|
173
|
+
"""
|
|
174
|
+
|
|
175
|
+
chart_colors: KerykeionSettingsChartColorsModel = Field(title="Chart Colors", description="The colors of the chart")
|
|
176
|
+
celestial_points: List[KerykeionSettingsCelestialPointModel] = Field(title="Celestial Points", description="The list of the celestial points of the chart")
|
|
177
|
+
aspects: List[KerykeionSettingsAspectModel] = Field(title="Aspects", description="The list of the aspects of the chart")
|
|
178
|
+
language_settings: dict[str, KerykeionLanguageModel] = Field(title="Language Settings", description="The language settings of the chart")
|
|
179
|
+
general_settings: KerykeionGeneralSettingsModel = Field(title="General Settings", description="The general settings of the chart")
|
|
180
|
+
chart_settings: KerykeionChartSettingsModel = Field(title="Chart Settings", description="The chart settings of the chart")
|