kerykeion 4.17.2__py3-none-any.whl → 4.18.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 +2 -1
- kerykeion/aspects/aspects_utils.py +32 -117
- kerykeion/aspects/natal_aspects.py +23 -24
- kerykeion/aspects/synastry_aspects.py +21 -26
- kerykeion/charts/kerykeion_chart_svg.py +17 -14
- kerykeion/ephemeris_data.py +16 -16
- kerykeion/kr_types/kr_literals.py +6 -1
- kerykeion/kr_types/kr_models.py +19 -2
- kerykeion/kr_types/settings_models.py +1 -13
- kerykeion/relationship_score/__init__.py +2 -0
- kerykeion/relationship_score/relationship_score.py +175 -0
- kerykeion/relationship_score/relationship_score_factory.py +275 -0
- kerykeion/settings/kr.config.json +44 -30
- kerykeion/utilities.py +4 -1
- {kerykeion-4.17.2.dist-info → kerykeion-4.18.1.dist-info}/METADATA +2 -2
- {kerykeion-4.17.2.dist-info → kerykeion-4.18.1.dist-info}/RECORD +19 -17
- kerykeion/relationship_score.py +0 -206
- {kerykeion-4.17.2.dist-info → kerykeion-4.18.1.dist-info}/LICENSE +0 -0
- {kerykeion-4.17.2.dist-info → kerykeion-4.18.1.dist-info}/WHEEL +0 -0
- {kerykeion-4.17.2.dist-info → kerykeion-4.18.1.dist-info}/entry_points.txt +0 -0
kerykeion/__init__.py
CHANGED
|
@@ -9,7 +9,8 @@ This is part of Kerykeion (C) 2024 Giacomo Battaglia
|
|
|
9
9
|
from .astrological_subject import AstrologicalSubject
|
|
10
10
|
from .charts.kerykeion_chart_svg import KerykeionChartSVG
|
|
11
11
|
from .kr_types import *
|
|
12
|
-
from .relationship_score import RelationshipScore
|
|
12
|
+
from .relationship_score.relationship_score import RelationshipScore
|
|
13
|
+
from .relationship_score.relationship_score_factory import RelationshipScoreFactory
|
|
13
14
|
from .aspects import SynastryAspects, NatalAspects
|
|
14
15
|
from .report import Report
|
|
15
16
|
from .settings import KerykeionSettingsModel, get_settings
|
|
@@ -9,144 +9,55 @@ from kerykeion.settings import KerykeionSettingsModel
|
|
|
9
9
|
from swisseph import difdeg2n
|
|
10
10
|
from typing import Union
|
|
11
11
|
from kerykeion.kr_types.kr_models import AstrologicalSubjectModel
|
|
12
|
+
from kerykeion.kr_types.settings_models import KerykeionSettingsCelestialPointModel, KerykeionSettingsAspectModel
|
|
12
13
|
|
|
13
14
|
|
|
14
|
-
def get_aspect_from_two_points(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
def get_aspect_from_two_points(
|
|
16
|
+
aspects_settings: Union[list[KerykeionSettingsAspectModel], list[dict]],
|
|
17
|
+
point_one: Union[float, int],
|
|
18
|
+
point_two: Union[float, int],
|
|
19
|
+
):
|
|
19
20
|
"""
|
|
21
|
+
Utility function to calculate the aspects between two points.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
aspects_settings (dict): Dictionary containing aspect settings.
|
|
25
|
+
point_one (Union[float, int]): First point.
|
|
26
|
+
point_two (Union[float, int]): Second point.
|
|
20
27
|
|
|
28
|
+
Returns:
|
|
29
|
+
dict: Dictionary containing the aspect details.
|
|
30
|
+
"""
|
|
21
31
|
distance = abs(difdeg2n(point_one, point_two))
|
|
22
32
|
diff = abs(point_one - point_two)
|
|
23
33
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
verdict = True
|
|
28
|
-
aid = 0
|
|
29
|
-
|
|
30
|
-
elif (
|
|
31
|
-
(aspects_settings[1]["degree"] - aspects_settings[1]["orb"])
|
|
32
|
-
<= int(distance)
|
|
33
|
-
<= (aspects_settings[1]["degree"] + aspects_settings[1]["orb"])
|
|
34
|
-
):
|
|
35
|
-
name = aspects_settings[1]["name"]
|
|
36
|
-
aspect_degrees = aspects_settings[1]["degree"]
|
|
37
|
-
verdict = True
|
|
38
|
-
aid = 1
|
|
39
|
-
|
|
40
|
-
elif (
|
|
41
|
-
(aspects_settings[2]["degree"] - aspects_settings[2]["orb"])
|
|
42
|
-
<= int(distance)
|
|
43
|
-
<= (aspects_settings[2]["degree"] + aspects_settings[2]["orb"])
|
|
44
|
-
):
|
|
45
|
-
name = aspects_settings[2]["name"]
|
|
46
|
-
aspect_degrees = aspects_settings[2]["degree"]
|
|
47
|
-
verdict = True
|
|
48
|
-
aid = 2
|
|
49
|
-
|
|
50
|
-
elif (
|
|
51
|
-
(aspects_settings[3]["degree"] - aspects_settings[3]["orb"])
|
|
52
|
-
<= int(distance)
|
|
53
|
-
<= (aspects_settings[3]["degree"] + aspects_settings[3]["orb"])
|
|
54
|
-
):
|
|
55
|
-
name = aspects_settings[3]["name"]
|
|
56
|
-
aspect_degrees = aspects_settings[3]["degree"]
|
|
57
|
-
verdict = True
|
|
58
|
-
aid = 3
|
|
59
|
-
|
|
60
|
-
elif (
|
|
61
|
-
(aspects_settings[4]["degree"] - aspects_settings[4]["orb"])
|
|
62
|
-
<= int(distance)
|
|
63
|
-
<= (aspects_settings[4]["degree"] + aspects_settings[4]["orb"])
|
|
64
|
-
):
|
|
65
|
-
name = aspects_settings[4]["name"]
|
|
66
|
-
aspect_degrees = aspects_settings[4]["degree"]
|
|
67
|
-
verdict = True
|
|
68
|
-
aid = 4
|
|
69
|
-
|
|
70
|
-
elif (
|
|
71
|
-
(aspects_settings[5]["degree"] - aspects_settings[5]["orb"])
|
|
72
|
-
<= int(distance)
|
|
73
|
-
<= (aspects_settings[5]["degree"] + aspects_settings[5]["orb"])
|
|
74
|
-
):
|
|
75
|
-
name = aspects_settings[5]["name"]
|
|
76
|
-
aspect_degrees = aspects_settings[5]["degree"]
|
|
77
|
-
verdict = True
|
|
78
|
-
aid = 5
|
|
79
|
-
|
|
80
|
-
elif (
|
|
81
|
-
(aspects_settings[6]["degree"] - aspects_settings[6]["orb"])
|
|
82
|
-
<= int(distance)
|
|
83
|
-
<= (aspects_settings[6]["degree"] + aspects_settings[6]["orb"])
|
|
84
|
-
):
|
|
85
|
-
name = aspects_settings[6]["name"]
|
|
86
|
-
aspect_degrees = aspects_settings[6]["degree"]
|
|
87
|
-
verdict = True
|
|
88
|
-
aid = 6
|
|
89
|
-
|
|
90
|
-
elif (
|
|
91
|
-
(aspects_settings[7]["degree"] - aspects_settings[7]["orb"])
|
|
92
|
-
<= int(distance)
|
|
93
|
-
<= (aspects_settings[7]["degree"] + aspects_settings[7]["orb"])
|
|
94
|
-
):
|
|
95
|
-
name = aspects_settings[7]["name"]
|
|
96
|
-
aspect_degrees = aspects_settings[7]["degree"]
|
|
97
|
-
verdict = True
|
|
98
|
-
aid = 7
|
|
99
|
-
|
|
100
|
-
elif (
|
|
101
|
-
(aspects_settings[8]["degree"] - aspects_settings[8]["orb"])
|
|
102
|
-
<= int(distance)
|
|
103
|
-
<= (aspects_settings[8]["degree"] + aspects_settings[8]["orb"])
|
|
104
|
-
):
|
|
105
|
-
name = aspects_settings[8]["name"]
|
|
106
|
-
aspect_degrees = aspects_settings[8]["degree"]
|
|
107
|
-
verdict = True
|
|
108
|
-
aid = 8
|
|
109
|
-
|
|
110
|
-
elif (
|
|
111
|
-
(aspects_settings[9]["degree"] - aspects_settings[9]["orb"])
|
|
112
|
-
<= int(distance)
|
|
113
|
-
<= (aspects_settings[9]["degree"] + aspects_settings[9]["orb"])
|
|
114
|
-
):
|
|
115
|
-
name = aspects_settings[9]["name"]
|
|
116
|
-
aspect_degrees = aspects_settings[9]["degree"]
|
|
117
|
-
verdict = True
|
|
118
|
-
aid = 9
|
|
119
|
-
|
|
120
|
-
elif (
|
|
121
|
-
(aspects_settings[10]["degree"] - aspects_settings[10]["orb"])
|
|
122
|
-
<= int(distance)
|
|
123
|
-
<= (aspects_settings[10]["degree"] + aspects_settings[10]["orb"])
|
|
124
|
-
):
|
|
125
|
-
name = aspects_settings[10]["name"]
|
|
126
|
-
aspect_degrees = aspects_settings[10]["degree"]
|
|
127
|
-
verdict = True
|
|
128
|
-
aid = 10
|
|
34
|
+
for aid, aspect in enumerate(aspects_settings):
|
|
35
|
+
aspect_degree = aspect["degree"] # type: ignore
|
|
36
|
+
aspect_orb = aspect["orb"] # type: ignore
|
|
129
37
|
|
|
38
|
+
if (aspect_degree - aspect_orb) <= int(distance) <= (aspect_degree + aspect_orb):
|
|
39
|
+
name = aspect["name"] # type: ignore
|
|
40
|
+
aspect_degrees = aspect_degree
|
|
41
|
+
verdict = True
|
|
42
|
+
break
|
|
130
43
|
else:
|
|
131
44
|
verdict = False
|
|
132
45
|
name = None
|
|
133
|
-
distance = 0
|
|
134
46
|
aspect_degrees = 0
|
|
135
|
-
aid = None
|
|
136
|
-
|
|
47
|
+
aid = None # type: ignore
|
|
137
48
|
|
|
138
49
|
return {
|
|
139
|
-
"verdict": verdict,
|
|
50
|
+
"verdict": verdict,
|
|
140
51
|
"name": name,
|
|
141
52
|
"orbit": distance - aspect_degrees,
|
|
142
53
|
"distance": distance - aspect_degrees,
|
|
143
54
|
"aspect_degrees": aspect_degrees,
|
|
144
55
|
"aid": aid,
|
|
145
|
-
"diff": diff
|
|
56
|
+
"diff": diff,
|
|
146
57
|
}
|
|
147
58
|
|
|
148
59
|
|
|
149
|
-
def planet_id_decoder(planets_settings:
|
|
60
|
+
def planet_id_decoder(planets_settings: list[KerykeionSettingsCelestialPointModel], name: str) -> int:
|
|
150
61
|
"""
|
|
151
62
|
Check if the name of the planet is the same in the settings and return
|
|
152
63
|
the correct id for the planet.
|
|
@@ -157,8 +68,12 @@ def planet_id_decoder(planets_settings: dict, name: str):
|
|
|
157
68
|
result = planet["id"]
|
|
158
69
|
return result
|
|
159
70
|
|
|
71
|
+
raise ValueError(f"Planet {name} not found in the settings")
|
|
72
|
+
|
|
160
73
|
|
|
161
|
-
def get_active_points_list(
|
|
74
|
+
def get_active_points_list(
|
|
75
|
+
subject: Union[AstrologicalSubject, AstrologicalSubjectModel], settings: Union[KerykeionSettingsModel, dict]
|
|
76
|
+
) -> list:
|
|
162
77
|
"""
|
|
163
78
|
Given an astrological subject and the settings, return a list of the active points.
|
|
164
79
|
Args:
|
|
@@ -11,7 +11,7 @@ from kerykeion.settings.kerykeion_settings import get_settings
|
|
|
11
11
|
from dataclasses import dataclass
|
|
12
12
|
from functools import cached_property
|
|
13
13
|
from kerykeion.aspects.aspects_utils import planet_id_decoder, get_aspect_from_two_points, get_active_points_list
|
|
14
|
-
from kerykeion.kr_types.kr_models import AstrologicalSubjectModel
|
|
14
|
+
from kerykeion.kr_types.kr_models import AstrologicalSubjectModel, AspectModel
|
|
15
15
|
from kerykeion.kr_types.settings_models import KerykeionSettingsModel
|
|
16
16
|
|
|
17
17
|
|
|
@@ -35,9 +35,9 @@ class NatalAspects:
|
|
|
35
35
|
def __post_init__(self):
|
|
36
36
|
self.settings = get_settings(self.new_settings_file)
|
|
37
37
|
|
|
38
|
-
self.celestial_points = self.settings
|
|
39
|
-
self.aspects_settings = self.settings
|
|
40
|
-
self.axes_orbit_settings = self.settings
|
|
38
|
+
self.celestial_points = self.settings.celestial_points
|
|
39
|
+
self.aspects_settings = self.settings.aspects
|
|
40
|
+
self.axes_orbit_settings = self.settings.general_settings.axes_orbit
|
|
41
41
|
|
|
42
42
|
@cached_property
|
|
43
43
|
def all_aspects(self):
|
|
@@ -55,7 +55,8 @@ class NatalAspects:
|
|
|
55
55
|
# Generates the aspects list without repetitions
|
|
56
56
|
for second in range(first + 1, len(active_points_list)):
|
|
57
57
|
aspect = get_aspect_from_two_points(
|
|
58
|
-
self.aspects_settings, active_points_list[first]["abs_pos"],
|
|
58
|
+
self.aspects_settings, active_points_list[first]["abs_pos"],
|
|
59
|
+
active_points_list[second]["abs_pos"]
|
|
59
60
|
)
|
|
60
61
|
|
|
61
62
|
verdict = aspect["verdict"]
|
|
@@ -64,27 +65,23 @@ class NatalAspects:
|
|
|
64
65
|
aspect_degrees = aspect["aspect_degrees"]
|
|
65
66
|
aid = aspect["aid"]
|
|
66
67
|
diff = aspect["diff"]
|
|
67
|
-
|
|
68
68
|
|
|
69
69
|
if verdict == True:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
self.all_aspects_list.append(d_asp)
|
|
70
|
+
aspect_model = AspectModel(
|
|
71
|
+
p1_name=active_points_list[first]["name"],
|
|
72
|
+
p1_abs_pos=active_points_list[first]["abs_pos"],
|
|
73
|
+
p2_name=active_points_list[second]["name"],
|
|
74
|
+
p2_abs_pos=active_points_list[second]["abs_pos"],
|
|
75
|
+
aspect=name,
|
|
76
|
+
orbit=orbit,
|
|
77
|
+
aspect_degrees=aspect_degrees,
|
|
78
|
+
aid=aid,
|
|
79
|
+
diff=diff,
|
|
80
|
+
p1=planet_id_decoder(self.celestial_points, active_points_list[first]["name"]),
|
|
81
|
+
p2=planet_id_decoder(self.celestial_points, active_points_list[second]["name"]),
|
|
82
|
+
is_major=self.aspects_settings[aid]["is_major"],
|
|
83
|
+
)
|
|
84
|
+
self.all_aspects_list.append(aspect_model)
|
|
88
85
|
|
|
89
86
|
return self.all_aspects_list
|
|
90
87
|
|
|
@@ -95,6 +92,7 @@ class NatalAspects:
|
|
|
95
92
|
the most important are hardcoded.
|
|
96
93
|
Set the list with set_points and creating a list with the names
|
|
97
94
|
or the numbers of the houses.
|
|
95
|
+
The relevant aspects are the ones that are set as active ("is_active") in the settings.
|
|
98
96
|
"""
|
|
99
97
|
|
|
100
98
|
logging.debug("Relevant aspects not already calculated, calculating now...")
|
|
@@ -129,6 +127,7 @@ class NatalAspects:
|
|
|
129
127
|
|
|
130
128
|
if __name__ == "__main__":
|
|
131
129
|
from kerykeion.utilities import setup_logging
|
|
130
|
+
|
|
132
131
|
setup_logging(level="debug")
|
|
133
132
|
|
|
134
133
|
johnny = AstrologicalSubject("Johnny Depp", 1963, 6, 9, 0, 0, "Owensboro", "US")
|
|
@@ -11,7 +11,7 @@ from functools import cached_property
|
|
|
11
11
|
from kerykeion.aspects.natal_aspects import NatalAspects
|
|
12
12
|
from kerykeion.settings.kerykeion_settings import get_settings
|
|
13
13
|
from kerykeion.aspects.aspects_utils import planet_id_decoder, get_aspect_from_two_points, get_active_points_list
|
|
14
|
-
from kerykeion.kr_types.kr_models import AstrologicalSubjectModel
|
|
14
|
+
from kerykeion.kr_types.kr_models import AstrologicalSubjectModel, AspectModel
|
|
15
15
|
from kerykeion.kr_types.settings_models import KerykeionSettingsModel
|
|
16
16
|
from typing import Union
|
|
17
17
|
|
|
@@ -25,7 +25,7 @@ class SynastryAspects(NatalAspects):
|
|
|
25
25
|
self,
|
|
26
26
|
kr_object_one: Union[AstrologicalSubject, AstrologicalSubjectModel],
|
|
27
27
|
kr_object_two: Union[AstrologicalSubject, AstrologicalSubjectModel],
|
|
28
|
-
new_settings_file: Union[Path, KerykeionSettingsModel, dict, None] = None
|
|
28
|
+
new_settings_file: Union[Path, KerykeionSettingsModel, dict, None] = None,
|
|
29
29
|
):
|
|
30
30
|
# Subjects
|
|
31
31
|
self.first_user = kr_object_one
|
|
@@ -35,9 +35,9 @@ class SynastryAspects(NatalAspects):
|
|
|
35
35
|
self.new_settings_file = new_settings_file
|
|
36
36
|
self.settings = get_settings(self.new_settings_file)
|
|
37
37
|
|
|
38
|
-
self.celestial_points = self.settings
|
|
39
|
-
self.aspects_settings = self.settings
|
|
40
|
-
self.axes_orbit_settings = self.settings
|
|
38
|
+
self.celestial_points = self.settings.celestial_points
|
|
39
|
+
self.aspects_settings = self.settings.aspects
|
|
40
|
+
self.axes_orbit_settings = self.settings.general_settings.axes_orbit
|
|
41
41
|
|
|
42
42
|
# Private variables of the aspects
|
|
43
43
|
self._all_aspects: Union[list, None] = None
|
|
@@ -76,34 +76,29 @@ class SynastryAspects(NatalAspects):
|
|
|
76
76
|
aid = aspect["aid"]
|
|
77
77
|
diff = aspect["diff"]
|
|
78
78
|
|
|
79
|
-
|
|
80
79
|
if verdict == True:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
second_active_points_list[second]["name"],
|
|
97
|
-
),
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
self.all_aspects_list.append(d_asp)
|
|
80
|
+
aspect_model = AspectModel(
|
|
81
|
+
p1_name=first_active_points_list[first]["name"],
|
|
82
|
+
p1_abs_pos=first_active_points_list[first]["abs_pos"],
|
|
83
|
+
p2_name=second_active_points_list[second]["name"],
|
|
84
|
+
p2_abs_pos=second_active_points_list[second]["abs_pos"],
|
|
85
|
+
aspect=name,
|
|
86
|
+
orbit=orbit,
|
|
87
|
+
aspect_degrees=aspect_degrees,
|
|
88
|
+
aid=aid,
|
|
89
|
+
diff=diff,
|
|
90
|
+
p1=planet_id_decoder(self.celestial_points, first_active_points_list[first]["name"]),
|
|
91
|
+
p2=planet_id_decoder(self.celestial_points, second_active_points_list[second]["name"]),
|
|
92
|
+
is_major=self.aspects_settings[aid]["is_major"],
|
|
93
|
+
)
|
|
94
|
+
self.all_aspects_list.append(aspect_model)
|
|
101
95
|
|
|
102
96
|
return self.all_aspects_list
|
|
103
97
|
|
|
104
98
|
|
|
105
99
|
if __name__ == "__main__":
|
|
106
100
|
from kerykeion.utilities import setup_logging
|
|
101
|
+
|
|
107
102
|
setup_logging(level="debug")
|
|
108
103
|
|
|
109
104
|
john = AstrologicalSubject("John", 1940, 10, 9, 18, 30, "Liverpool")
|
|
@@ -15,7 +15,7 @@ from kerykeion.kr_types import KerykeionException, ChartType, KerykeionPointMode
|
|
|
15
15
|
from kerykeion.kr_types import ChartTemplateDictionary
|
|
16
16
|
from kerykeion.kr_types.kr_models import AstrologicalSubjectModel
|
|
17
17
|
from kerykeion.kr_types.settings_models import KerykeionSettingsCelestialPointModel, KerykeionSettingsModel
|
|
18
|
-
from kerykeion.kr_types.kr_literals import KerykeionChartTheme
|
|
18
|
+
from kerykeion.kr_types.kr_literals import KerykeionChartTheme, KerykeionChartLanguage
|
|
19
19
|
from kerykeion.charts.charts_utils import (
|
|
20
20
|
draw_zodiac_slice,
|
|
21
21
|
convert_latitude_coordinate_to_string,
|
|
@@ -64,9 +64,12 @@ class KerykeionChartSVG:
|
|
|
64
64
|
"""
|
|
65
65
|
|
|
66
66
|
# Constants
|
|
67
|
+
_BASIC_CHART_VIEWBOX = "0 0 772.2 546.0"
|
|
68
|
+
_WIDE_CHART_VIEWBOX = "0 0 1060 546.0"
|
|
67
69
|
_DEFAULT_HEIGHT = 546.0
|
|
68
70
|
_DEFAULT_FULL_WIDTH = 1200
|
|
69
71
|
_DEFAULT_NATAL_WIDTH = 772.2
|
|
72
|
+
_PLANET_IN_ZODIAC_EXTRA_POINTS = 10
|
|
70
73
|
|
|
71
74
|
# Set at init
|
|
72
75
|
first_obj: Union[AstrologicalSubject, AstrologicalSubjectModel]
|
|
@@ -85,14 +88,11 @@ class KerykeionChartSVG:
|
|
|
85
88
|
first_circle_radius: float
|
|
86
89
|
second_circle_radius: float
|
|
87
90
|
third_circle_radius: float
|
|
88
|
-
homedir: Path
|
|
89
91
|
width: Union[float, int]
|
|
90
92
|
language_settings: dict
|
|
91
93
|
chart_colors_settings: dict
|
|
92
94
|
planets_settings: dict
|
|
93
95
|
aspects_settings: dict
|
|
94
|
-
planet_in_zodiac_extra_points: int
|
|
95
|
-
chart_settings: dict
|
|
96
96
|
user: Union[AstrologicalSubject, AstrologicalSubjectModel]
|
|
97
97
|
available_planets_setting: List[KerykeionSettingsCelestialPointModel]
|
|
98
98
|
height: float
|
|
@@ -110,17 +110,17 @@ class KerykeionChartSVG:
|
|
|
110
110
|
new_settings_file: Union[Path, None, KerykeionSettingsModel, dict] = None,
|
|
111
111
|
theme: Union[KerykeionChartTheme, None] = "classic",
|
|
112
112
|
double_chart_aspect_grid_type: Literal["list", "table"] = "list",
|
|
113
|
-
chart_language:
|
|
113
|
+
chart_language: KerykeionChartLanguage = "EN",
|
|
114
114
|
):
|
|
115
115
|
# Directories:
|
|
116
|
-
|
|
116
|
+
home_directory = Path.home()
|
|
117
117
|
self.new_settings_file = new_settings_file
|
|
118
118
|
self.chart_language = chart_language
|
|
119
119
|
|
|
120
120
|
if new_output_directory:
|
|
121
121
|
self.output_directory = Path(new_output_directory)
|
|
122
122
|
else:
|
|
123
|
-
self.output_directory =
|
|
123
|
+
self.output_directory = home_directory
|
|
124
124
|
|
|
125
125
|
self.parse_json_settings(new_settings_file)
|
|
126
126
|
self.chart_type = chart_type
|
|
@@ -235,8 +235,6 @@ class KerykeionChartSVG:
|
|
|
235
235
|
self.chart_colors_settings = settings["chart_colors"]
|
|
236
236
|
self.planets_settings = settings["celestial_points"]
|
|
237
237
|
self.aspects_settings = settings["aspects"]
|
|
238
|
-
self.planet_in_zodiac_extra_points = settings["general_settings"]["planet_in_zodiac_extra_points"]
|
|
239
|
-
self.chart_settings = settings["chart_settings"]
|
|
240
238
|
|
|
241
239
|
def _draw_zodiac_circle_slices(self, r):
|
|
242
240
|
"""
|
|
@@ -272,7 +270,7 @@ class KerykeionChartSVG:
|
|
|
272
270
|
The points should include just the standard way of calculating the elements points.
|
|
273
271
|
"""
|
|
274
272
|
|
|
275
|
-
|
|
273
|
+
ZODIAC = (
|
|
276
274
|
{"name": "Ari", "element": "fire"},
|
|
277
275
|
{"name": "Tau", "element": "earth"},
|
|
278
276
|
{"name": "Gem", "element": "air"},
|
|
@@ -305,9 +303,9 @@ class KerykeionChartSVG:
|
|
|
305
303
|
if related_zodiac_signs != []:
|
|
306
304
|
for e in range(len(related_zodiac_signs)):
|
|
307
305
|
if int(related_zodiac_signs[e]) == int(cz):
|
|
308
|
-
extra_points = self.
|
|
306
|
+
extra_points = self._PLANET_IN_ZODIAC_EXTRA_POINTS
|
|
309
307
|
|
|
310
|
-
ele =
|
|
308
|
+
ele = ZODIAC[points_sign[i]]["element"]
|
|
311
309
|
if ele == "fire":
|
|
312
310
|
self.fire = self.fire + self.available_planets_setting[i]["element_points"] + extra_points
|
|
313
311
|
|
|
@@ -366,7 +364,7 @@ class KerykeionChartSVG:
|
|
|
366
364
|
template_dict["stringName"] = f"{self.user.name}:" if self.chart_type in ["Synastry", "Transit"] else f'{self.language_settings["info"]}:'
|
|
367
365
|
|
|
368
366
|
# Set viewbox based on chart type
|
|
369
|
-
template_dict['viewbox'] = self.
|
|
367
|
+
template_dict['viewbox'] = self._BASIC_CHART_VIEWBOX if self.chart_type in ["Natal", "ExternalNatal"] else self._WIDE_CHART_VIEWBOX
|
|
370
368
|
|
|
371
369
|
# Generate rings and circles based on chart type
|
|
372
370
|
if self.chart_type in ["Transit", "Synastry"]:
|
|
@@ -888,4 +886,9 @@ if __name__ == "__main__":
|
|
|
888
886
|
# German Language Chart
|
|
889
887
|
german_subject = AstrologicalSubject("Albert Einstein", 1879, 3, 14, 11, 30, "Ulm", "DE")
|
|
890
888
|
german_chart = KerykeionChartSVG(german_subject, chart_language="DE")
|
|
891
|
-
german_chart.makeSVG()
|
|
889
|
+
german_chart.makeSVG()
|
|
890
|
+
|
|
891
|
+
# Hindi Language Chart
|
|
892
|
+
hindi_subject = AstrologicalSubject("Amitabh Bachchan", 1942, 10, 11, 4, 0, "Allahabad", "IN")
|
|
893
|
+
hindi_chart = KerykeionChartSVG(hindi_subject, chart_language="HI")
|
|
894
|
+
hindi_chart.makeSVG()
|
kerykeion/ephemeris_data.py
CHANGED
|
@@ -99,18 +99,25 @@ class EphemerisDataFactory:
|
|
|
99
99
|
if len(self.dates_list) > 1000:
|
|
100
100
|
logging.warning(f"Large number of dates: {len(self.dates_list)}. The calculation may take a while.")
|
|
101
101
|
|
|
102
|
-
def get_ephemeris_data(self) -> list:
|
|
102
|
+
def get_ephemeris_data(self, as_model: bool = False) -> list:
|
|
103
103
|
"""
|
|
104
104
|
Generate ephemeris data for the specified date range.
|
|
105
105
|
The data is structured as a list of dictionaries, where each dictionary contains the date, planets, and houses data.
|
|
106
|
-
|
|
106
|
+
Example:
|
|
107
|
+
[
|
|
108
|
+
{
|
|
109
|
+
"date": "2020-01-01T00:00:00",
|
|
110
|
+
"planets": [{...}, {...}, ...],
|
|
111
|
+
"houses": [{...}, {...}, ...]
|
|
112
|
+
},
|
|
113
|
+
...
|
|
114
|
+
]
|
|
107
115
|
|
|
108
116
|
Args:
|
|
109
|
-
- as_model:
|
|
110
|
-
- as_dict: boolean representing if the ephemeris data should be returned as dictionaries. Default is False.
|
|
117
|
+
- as_model (bool): If True, the ephemeris data will be returned as model instances. Default is False.
|
|
111
118
|
|
|
112
119
|
Returns:
|
|
113
|
-
- list of dictionaries representing the ephemeris data.
|
|
120
|
+
- list: A list of dictionaries representing the ephemeris data. If as_model is True, a list of EphemerisDictModel instances is returned.
|
|
114
121
|
"""
|
|
115
122
|
ephemeris_data_list = []
|
|
116
123
|
for date in self.dates_list:
|
|
@@ -139,17 +146,10 @@ class EphemerisDataFactory:
|
|
|
139
146
|
|
|
140
147
|
ephemeris_data_list.append({"date": date.isoformat(), "planets": available_planets, "houses": houses_list})
|
|
141
148
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
def get_ephemeris_data_as_model(self) -> list[EphemerisDictModel]:
|
|
145
|
-
"""
|
|
146
|
-
Generate ephemeris data as model instances for the specified date range.
|
|
147
|
-
The data is structured as a list of EphemerisDictModel instances.
|
|
149
|
+
if as_model:
|
|
150
|
+
return [EphemerisDictModel(**data) for data in ephemeris_data_list]
|
|
148
151
|
|
|
149
|
-
|
|
150
|
-
- list of EphemerisDictModel instances representing the ephemeris data.
|
|
151
|
-
"""
|
|
152
|
-
return [EphemerisDictModel(**data) for data in self.get_ephemeris_data()]
|
|
152
|
+
return ephemeris_data_list
|
|
153
153
|
|
|
154
154
|
|
|
155
155
|
if "__main__" == __name__:
|
|
@@ -170,7 +170,7 @@ if "__main__" == __name__:
|
|
|
170
170
|
max_days=None,
|
|
171
171
|
)
|
|
172
172
|
|
|
173
|
-
ephemeris_data = factory.
|
|
173
|
+
ephemeris_data = factory.get_ephemeris_data(as_model=True)
|
|
174
174
|
print(ephemeris_data[0])
|
|
175
175
|
print(len(ephemeris_data))
|
|
176
176
|
|
|
@@ -104,4 +104,9 @@ Usually the standard is "Apparent Geocentric"
|
|
|
104
104
|
SignsEmoji = Literal["♈️", "♉️", "♊️", "♋️", "♌️", "♍️", "♎️", "♏️", "♐️", "♑️", "♒️", "♓️"]
|
|
105
105
|
|
|
106
106
|
|
|
107
|
-
KerykeionChartTheme = Literal["light", "dark", "dark-high-contrast", "classic"]
|
|
107
|
+
KerykeionChartTheme = Literal["light", "dark", "dark-high-contrast", "classic"]
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
KerykeionChartLanguage = Literal["EN", "FR", "PT", "IT", "CN", "ES", "RU", "TR", "DE", "HI"]
|
|
111
|
+
|
|
112
|
+
RelationshipScoreDescription = Literal["Minimal", "Medium", "Important", "Very Important", "Exceptional", "Rare Exceptional"]
|
kerykeion/kr_types/kr_models.py
CHANGED
|
@@ -21,7 +21,8 @@ from kerykeion.kr_types import (
|
|
|
21
21
|
SiderealMode,
|
|
22
22
|
HousesSystemIdentifier,
|
|
23
23
|
Houses,
|
|
24
|
-
SignsEmoji
|
|
24
|
+
SignsEmoji,
|
|
25
|
+
RelationshipScoreDescription
|
|
25
26
|
)
|
|
26
27
|
|
|
27
28
|
|
|
@@ -158,6 +159,7 @@ class AspectModel(SubscriptableBaseModel):
|
|
|
158
159
|
diff: float
|
|
159
160
|
p1: int
|
|
160
161
|
p2: int
|
|
162
|
+
is_major: bool
|
|
161
163
|
|
|
162
164
|
|
|
163
165
|
class ZodiacSignModel(SubscriptableBaseModel):
|
|
@@ -165,4 +167,19 @@ class ZodiacSignModel(SubscriptableBaseModel):
|
|
|
165
167
|
quality: Quality
|
|
166
168
|
element: Element
|
|
167
169
|
emoji: SignsEmoji
|
|
168
|
-
sign_num: SignNumbers
|
|
170
|
+
sign_num: SignNumbers
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
class RelationshipScoreAspectModel(SubscriptableBaseModel):
|
|
174
|
+
p1_name: str
|
|
175
|
+
p2_name: str
|
|
176
|
+
aspect: str
|
|
177
|
+
orbit: float
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
class RelationshipScoreModel(SubscriptableBaseModel):
|
|
181
|
+
score_value: int
|
|
182
|
+
score_description: RelationshipScoreDescription
|
|
183
|
+
is_destiny_sign: bool
|
|
184
|
+
aspects: list[RelationshipScoreAspectModel]
|
|
185
|
+
subjects: list[AstrologicalSubjectModel]
|
|
@@ -80,13 +80,9 @@ class KerykeionSettingsAspectModel(SubscriptableBaseModel):
|
|
|
80
80
|
name: str = Field(title="Aspect Name", description="The name of the aspect")
|
|
81
81
|
is_active: bool = Field(title="Aspect is Active", description="Is the aspect active?")
|
|
82
82
|
is_major: bool = Field(title="Aspect is Major", description="Is the aspect major?")
|
|
83
|
-
is_minor: bool = Field(title="Aspect is Minor", description="Is the aspect minor?")
|
|
84
83
|
orb: int = Field(title="Aspect Orb", description="The orb of the aspect")
|
|
85
84
|
color: str = Field(title="Aspect Color", description="The color of the aspect")
|
|
86
85
|
|
|
87
|
-
# Deprecated: Not used anymore
|
|
88
|
-
visible_grid: bool = Field(title="Aspect Visible Grid", description="Is the aspect visible in the grid?")
|
|
89
|
-
|
|
90
86
|
|
|
91
87
|
# Language Settings
|
|
92
88
|
class KerykeionLanguageCelestialPointModel(SubscriptableBaseModel):
|
|
@@ -146,14 +142,7 @@ class KerykeionLanguageModel(SubscriptableBaseModel):
|
|
|
146
142
|
|
|
147
143
|
class KerykeionGeneralSettingsModel(SubscriptableBaseModel):
|
|
148
144
|
axes_orbit: int = Field(title="Axes Orbit", description="The orbit of the axes in the chart")
|
|
149
|
-
language: str = Field(title="Language", description="The language of the chart")
|
|
150
|
-
|
|
151
|
-
# Deprecated: Should be removed
|
|
152
|
-
planet_in_zodiac_extra_points: int = Field(title="Planet in Zodiac Extra Points", description="The extra points of the planet in the zodiac")
|
|
153
145
|
|
|
154
|
-
class KerykeionChartSettingsModel(SubscriptableBaseModel):
|
|
155
|
-
basic_chart_viewBox: str = Field(title="Basic Chart ViewBox", description="The viewbox of the basic chart")
|
|
156
|
-
wide_chart_viewBox: str = Field(title="Wide Chart ViewBox", description="The viewbox of the wide chart")
|
|
157
146
|
|
|
158
147
|
# Settings Model
|
|
159
148
|
class KerykeionSettingsModel(SubscriptableBaseModel):
|
|
@@ -165,5 +154,4 @@ class KerykeionSettingsModel(SubscriptableBaseModel):
|
|
|
165
154
|
celestial_points: List[KerykeionSettingsCelestialPointModel] = Field(title="Celestial Points", description="The list of the celestial points of the chart")
|
|
166
155
|
aspects: List[KerykeionSettingsAspectModel] = Field(title="Aspects", description="The list of the aspects of the chart")
|
|
167
156
|
language_settings: dict[str, KerykeionLanguageModel] = Field(title="Language Settings", description="The language settings of the chart")
|
|
168
|
-
general_settings: KerykeionGeneralSettingsModel = Field(title="General Settings", description="The general settings of the chart")
|
|
169
|
-
chart_settings: KerykeionChartSettingsModel = Field(title="Chart Settings", description="The chart settings of the chart")
|
|
157
|
+
general_settings: KerykeionGeneralSettingsModel = Field(title="General Settings", description="The general settings of the chart")
|