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
kerykeion/__init__.py
CHANGED
|
@@ -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
|
Kerykeion is a python library for Astrology.
|
|
6
6
|
It can calculate all the planet and house position,
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
>>> second = AstrologicalSubject("Jane", 1991, 10, 25, 21, 00, "Roma")
|
|
69
69
|
|
|
70
70
|
>>> name = SynastryAspects(first, second)
|
|
71
|
-
>>> aspect_list = name.
|
|
71
|
+
>>> aspect_list = name.relevant_aspects
|
|
72
72
|
>>> print(aspect_list[0])
|
|
73
73
|
|
|
74
74
|
Generating kerykeion object for Jack...
|
|
@@ -105,4 +105,5 @@ from .kr_types import *
|
|
|
105
105
|
from .relationship_score import RelationshipScore
|
|
106
106
|
from .aspects import SynastryAspects, NatalAspects
|
|
107
107
|
from .report import Report
|
|
108
|
-
from .settings import KerykeionSettingsModel,
|
|
108
|
+
from .settings import KerykeionSettingsModel, get_settings
|
|
109
|
+
from .enums import Planets, Aspects, Signs
|
kerykeion/aspects/__init__.py
CHANGED
|
@@ -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
|
The aspects module contains the classes and functions for calculating
|
|
6
6
|
aspects between planets and points in a chart.
|
|
@@ -8,4 +8,4 @@ The aspects module contains the classes and functions for calculating
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
from .synastry_aspects import SynastryAspects
|
|
11
|
-
from .natal_aspects import NatalAspects
|
|
11
|
+
from .natal_aspects import NatalAspects
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""
|
|
3
|
+
This is part of Kerykeion (C) 2024 Giacomo Battaglia
|
|
4
|
+
"""
|
|
5
|
+
# TODO: Better documentation and unit tests
|
|
6
|
+
|
|
7
|
+
from kerykeion import AstrologicalSubject
|
|
8
|
+
from kerykeion.settings import KerykeionSettingsModel
|
|
9
|
+
from swisseph import difdeg2n
|
|
10
|
+
from typing import Union
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def get_aspect_from_two_points(aspects_settings: dict, point_one: Union[float, int], point_two: Union[float, int]):
|
|
14
|
+
"""
|
|
15
|
+
Utility function.
|
|
16
|
+
It calculates the aspects between the 2 points.
|
|
17
|
+
Args: first point, second point.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
distance = abs(difdeg2n(point_one, point_two))
|
|
21
|
+
diff = abs(point_one - point_two)
|
|
22
|
+
|
|
23
|
+
if int(distance) <= aspects_settings[0]["orb"]:
|
|
24
|
+
name = aspects_settings[0]["name"]
|
|
25
|
+
aspect_degrees = aspects_settings[0]["degree"]
|
|
26
|
+
color = aspects_settings[0]["color"]
|
|
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
|
+
color = aspects_settings[1]["color"]
|
|
38
|
+
verdict = True
|
|
39
|
+
aid = 1
|
|
40
|
+
|
|
41
|
+
elif (
|
|
42
|
+
(aspects_settings[2]["degree"] - aspects_settings[2]["orb"])
|
|
43
|
+
<= int(distance)
|
|
44
|
+
<= (aspects_settings[2]["degree"] + aspects_settings[2]["orb"])
|
|
45
|
+
):
|
|
46
|
+
name = aspects_settings[2]["name"]
|
|
47
|
+
aspect_degrees = aspects_settings[2]["degree"]
|
|
48
|
+
color = aspects_settings[2]["color"]
|
|
49
|
+
verdict = True
|
|
50
|
+
aid = 2
|
|
51
|
+
|
|
52
|
+
elif (
|
|
53
|
+
(aspects_settings[3]["degree"] - aspects_settings[3]["orb"])
|
|
54
|
+
<= int(distance)
|
|
55
|
+
<= (aspects_settings[3]["degree"] + aspects_settings[3]["orb"])
|
|
56
|
+
):
|
|
57
|
+
name = aspects_settings[3]["name"]
|
|
58
|
+
aspect_degrees = aspects_settings[3]["degree"]
|
|
59
|
+
color = aspects_settings[3]["color"]
|
|
60
|
+
verdict = True
|
|
61
|
+
aid = 3
|
|
62
|
+
|
|
63
|
+
elif (
|
|
64
|
+
(aspects_settings[4]["degree"] - aspects_settings[4]["orb"])
|
|
65
|
+
<= int(distance)
|
|
66
|
+
<= (aspects_settings[4]["degree"] + aspects_settings[4]["orb"])
|
|
67
|
+
):
|
|
68
|
+
name = aspects_settings[4]["name"]
|
|
69
|
+
aspect_degrees = aspects_settings[4]["degree"]
|
|
70
|
+
color = aspects_settings[4]["color"]
|
|
71
|
+
verdict = True
|
|
72
|
+
aid = 4
|
|
73
|
+
|
|
74
|
+
elif (
|
|
75
|
+
(aspects_settings[5]["degree"] - aspects_settings[5]["orb"])
|
|
76
|
+
<= int(distance)
|
|
77
|
+
<= (aspects_settings[5]["degree"] + aspects_settings[5]["orb"])
|
|
78
|
+
):
|
|
79
|
+
name = aspects_settings[5]["name"]
|
|
80
|
+
aspect_degrees = aspects_settings[5]["degree"]
|
|
81
|
+
color = aspects_settings[5]["color"]
|
|
82
|
+
verdict = True
|
|
83
|
+
aid = 5
|
|
84
|
+
|
|
85
|
+
elif (
|
|
86
|
+
(aspects_settings[6]["degree"] - aspects_settings[6]["orb"])
|
|
87
|
+
<= int(distance)
|
|
88
|
+
<= (aspects_settings[6]["degree"] + aspects_settings[6]["orb"])
|
|
89
|
+
):
|
|
90
|
+
name = aspects_settings[6]["name"]
|
|
91
|
+
aspect_degrees = aspects_settings[6]["degree"]
|
|
92
|
+
color = aspects_settings[6]["color"]
|
|
93
|
+
verdict = True
|
|
94
|
+
aid = 6
|
|
95
|
+
|
|
96
|
+
elif (
|
|
97
|
+
(aspects_settings[7]["degree"] - aspects_settings[7]["orb"])
|
|
98
|
+
<= int(distance)
|
|
99
|
+
<= (aspects_settings[7]["degree"] + aspects_settings[7]["orb"])
|
|
100
|
+
):
|
|
101
|
+
name = aspects_settings[7]["name"]
|
|
102
|
+
aspect_degrees = aspects_settings[7]["degree"]
|
|
103
|
+
color = aspects_settings[7]["color"]
|
|
104
|
+
verdict = True
|
|
105
|
+
aid = 7
|
|
106
|
+
|
|
107
|
+
elif (
|
|
108
|
+
(aspects_settings[8]["degree"] - aspects_settings[8]["orb"])
|
|
109
|
+
<= int(distance)
|
|
110
|
+
<= (aspects_settings[8]["degree"] + aspects_settings[8]["orb"])
|
|
111
|
+
):
|
|
112
|
+
name = aspects_settings[8]["name"]
|
|
113
|
+
aspect_degrees = aspects_settings[8]["degree"]
|
|
114
|
+
color = aspects_settings[8]["color"]
|
|
115
|
+
verdict = True
|
|
116
|
+
aid = 8
|
|
117
|
+
|
|
118
|
+
elif (
|
|
119
|
+
(aspects_settings[9]["degree"] - aspects_settings[9]["orb"])
|
|
120
|
+
<= int(distance)
|
|
121
|
+
<= (aspects_settings[9]["degree"] + aspects_settings[9]["orb"])
|
|
122
|
+
):
|
|
123
|
+
name = aspects_settings[9]["name"]
|
|
124
|
+
aspect_degrees = aspects_settings[9]["degree"]
|
|
125
|
+
color = aspects_settings[9]["color"]
|
|
126
|
+
verdict = True
|
|
127
|
+
aid = 9
|
|
128
|
+
|
|
129
|
+
elif (
|
|
130
|
+
(aspects_settings[10]["degree"] - aspects_settings[10]["orb"])
|
|
131
|
+
<= int(distance)
|
|
132
|
+
<= (aspects_settings[10]["degree"] + aspects_settings[10]["orb"])
|
|
133
|
+
):
|
|
134
|
+
name = aspects_settings[10]["name"]
|
|
135
|
+
aspect_degrees = aspects_settings[10]["degree"]
|
|
136
|
+
color = aspects_settings[10]["color"]
|
|
137
|
+
verdict = True
|
|
138
|
+
aid = 10
|
|
139
|
+
|
|
140
|
+
else:
|
|
141
|
+
verdict = False
|
|
142
|
+
name = None
|
|
143
|
+
distance = 0
|
|
144
|
+
aspect_degrees = 0
|
|
145
|
+
color = None
|
|
146
|
+
aid = None
|
|
147
|
+
|
|
148
|
+
return (
|
|
149
|
+
verdict,
|
|
150
|
+
name,
|
|
151
|
+
distance - aspect_degrees,
|
|
152
|
+
aspect_degrees,
|
|
153
|
+
color,
|
|
154
|
+
aid,
|
|
155
|
+
diff,
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def planet_id_decoder(planets_settings: dict, name: str):
|
|
160
|
+
"""
|
|
161
|
+
Check if the name of the planet is the same in the settings and return
|
|
162
|
+
the correct id for the planet.
|
|
163
|
+
"""
|
|
164
|
+
str_name = str(name)
|
|
165
|
+
for planet in planets_settings:
|
|
166
|
+
if planet["name"] == str_name:
|
|
167
|
+
result = planet["id"]
|
|
168
|
+
return result
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def get_active_points_list(subject: AstrologicalSubject, settings: Union[KerykeionSettingsModel, dict]) -> list:
|
|
172
|
+
"""
|
|
173
|
+
Given an astrological subject and the settings, return a list of the active points.
|
|
174
|
+
Args:
|
|
175
|
+
subject (AstrologicalSubject): The astrological subject to get the active points from.
|
|
176
|
+
settings (Union[KerykeionSettingsModel, dict]): Settings model o dictionary.
|
|
177
|
+
|
|
178
|
+
Returns:
|
|
179
|
+
list: List of the active points.
|
|
180
|
+
"""
|
|
181
|
+
point_list = []
|
|
182
|
+
for planet in settings["celestial_points"]:
|
|
183
|
+
if planet["is_active"] == True:
|
|
184
|
+
point_list.append(subject[planet["name"].lower()])
|
|
185
|
+
|
|
186
|
+
return point_list
|
|
@@ -1,246 +1,77 @@
|
|
|
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
|
-
import json
|
|
7
6
|
from pathlib import Path
|
|
8
7
|
from kerykeion import AstrologicalSubject
|
|
9
|
-
|
|
8
|
+
import logging
|
|
10
9
|
from typing import Union
|
|
11
|
-
from kerykeion.settings.kerykeion_settings import
|
|
10
|
+
from kerykeion.settings.kerykeion_settings import get_settings
|
|
11
|
+
from dataclasses import dataclass
|
|
12
|
+
from functools import cached_property
|
|
13
|
+
from kerykeion.aspects.aspects_utils import planet_id_decoder, get_aspect_from_two_points, get_active_points_list
|
|
12
14
|
|
|
13
15
|
|
|
16
|
+
AXES_LIST = [
|
|
17
|
+
"First_House",
|
|
18
|
+
"Tenth_House",
|
|
19
|
+
"Seventh_House",
|
|
20
|
+
"Fourth_House",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@dataclass
|
|
14
25
|
class NatalAspects:
|
|
15
26
|
"""
|
|
16
27
|
Generates an object with all the aspects of a birthcart.
|
|
17
28
|
"""
|
|
18
29
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
self.new_settings_file = new_settings_file
|
|
22
|
-
self._parse_json_settings()
|
|
23
|
-
|
|
24
|
-
self.init_point_list = self.user.planets_list + self.user.houses_list
|
|
25
|
-
|
|
26
|
-
def _parse_json_settings(self):
|
|
27
|
-
# Load settings file
|
|
28
|
-
|
|
29
|
-
settings = get_settings_dict(
|
|
30
|
-
self.new_settings_file,
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
self.planets_settings = settings["celestial_points"]
|
|
34
|
-
self.aspects_settings = settings["aspects"]
|
|
35
|
-
self.axes_orbit_settings = settings["general_settings"]["axes_orbit"]
|
|
36
|
-
|
|
37
|
-
def asp_calc(self, point_one, point_two):
|
|
38
|
-
"""
|
|
39
|
-
Utility function.
|
|
40
|
-
It calculates the aspects between the 2 points.
|
|
41
|
-
Args: first point, second point.
|
|
42
|
-
"""
|
|
43
|
-
|
|
44
|
-
distance = abs(difdeg2n(point_one, point_two))
|
|
45
|
-
diff = abs(point_one - point_two)
|
|
46
|
-
|
|
47
|
-
if int(distance) <= self.aspects_settings[0]["orb"]:
|
|
48
|
-
name = self.aspects_settings[0]["name"]
|
|
49
|
-
aspect_degrees = self.aspects_settings[0]["degree"]
|
|
50
|
-
color = self.aspects_settings[0]["color"]
|
|
51
|
-
verdict = True
|
|
52
|
-
aid = 0
|
|
53
|
-
|
|
54
|
-
elif (
|
|
55
|
-
(self.aspects_settings[1]["degree"] - self.aspects_settings[1]["orb"])
|
|
56
|
-
<= int(distance)
|
|
57
|
-
<= (self.aspects_settings[1]["degree"] + self.aspects_settings[1]["orb"])
|
|
58
|
-
):
|
|
59
|
-
name = self.aspects_settings[1]["name"]
|
|
60
|
-
aspect_degrees = self.aspects_settings[1]["degree"]
|
|
61
|
-
color = self.aspects_settings[1]["color"]
|
|
62
|
-
verdict = True
|
|
63
|
-
aid = 1
|
|
64
|
-
|
|
65
|
-
elif (
|
|
66
|
-
(self.aspects_settings[2]["degree"] - self.aspects_settings[2]["orb"])
|
|
67
|
-
<= int(distance)
|
|
68
|
-
<= (self.aspects_settings[2]["degree"] + self.aspects_settings[2]["orb"])
|
|
69
|
-
):
|
|
70
|
-
name = self.aspects_settings[2]["name"]
|
|
71
|
-
aspect_degrees = self.aspects_settings[2]["degree"]
|
|
72
|
-
color = self.aspects_settings[2]["color"]
|
|
73
|
-
verdict = True
|
|
74
|
-
aid = 2
|
|
75
|
-
|
|
76
|
-
elif (
|
|
77
|
-
(self.aspects_settings[3]["degree"] - self.aspects_settings[3]["orb"])
|
|
78
|
-
<= int(distance)
|
|
79
|
-
<= (self.aspects_settings[3]["degree"] + self.aspects_settings[3]["orb"])
|
|
80
|
-
):
|
|
81
|
-
name = self.aspects_settings[3]["name"]
|
|
82
|
-
aspect_degrees = self.aspects_settings[3]["degree"]
|
|
83
|
-
color = self.aspects_settings[3]["color"]
|
|
84
|
-
verdict = True
|
|
85
|
-
aid = 3
|
|
86
|
-
|
|
87
|
-
elif (
|
|
88
|
-
(self.aspects_settings[4]["degree"] - self.aspects_settings[4]["orb"])
|
|
89
|
-
<= int(distance)
|
|
90
|
-
<= (self.aspects_settings[4]["degree"] + self.aspects_settings[4]["orb"])
|
|
91
|
-
):
|
|
92
|
-
name = self.aspects_settings[4]["name"]
|
|
93
|
-
aspect_degrees = self.aspects_settings[4]["degree"]
|
|
94
|
-
color = self.aspects_settings[4]["color"]
|
|
95
|
-
verdict = True
|
|
96
|
-
aid = 4
|
|
97
|
-
|
|
98
|
-
elif (
|
|
99
|
-
(self.aspects_settings[5]["degree"] - self.aspects_settings[5]["orb"])
|
|
100
|
-
<= int(distance)
|
|
101
|
-
<= (self.aspects_settings[5]["degree"] + self.aspects_settings[5]["orb"])
|
|
102
|
-
):
|
|
103
|
-
name = self.aspects_settings[5]["name"]
|
|
104
|
-
aspect_degrees = self.aspects_settings[5]["degree"]
|
|
105
|
-
color = self.aspects_settings[5]["color"]
|
|
106
|
-
verdict = True
|
|
107
|
-
aid = 5
|
|
30
|
+
user: AstrologicalSubject
|
|
31
|
+
new_settings_file: Union[Path, None] = None
|
|
108
32
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
<= int(distance)
|
|
112
|
-
<= (self.aspects_settings[6]["degree"] + self.aspects_settings[6]["orb"])
|
|
113
|
-
):
|
|
114
|
-
name = self.aspects_settings[6]["name"]
|
|
115
|
-
aspect_degrees = self.aspects_settings[6]["degree"]
|
|
116
|
-
color = self.aspects_settings[6]["color"]
|
|
117
|
-
verdict = True
|
|
118
|
-
aid = 6
|
|
33
|
+
def __post_init__(self):
|
|
34
|
+
self.settings = get_settings(self.new_settings_file)
|
|
119
35
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
<= (self.aspects_settings[7]["degree"] + self.aspects_settings[7]["orb"])
|
|
124
|
-
):
|
|
125
|
-
name = self.aspects_settings[7]["name"]
|
|
126
|
-
aspect_degrees = self.aspects_settings[7]["degree"]
|
|
127
|
-
color = self.aspects_settings[7]["color"]
|
|
128
|
-
verdict = True
|
|
129
|
-
aid = 7
|
|
36
|
+
self.celestial_points = self.settings["celestial_points"]
|
|
37
|
+
self.aspects_settings = self.settings["aspects"]
|
|
38
|
+
self.axes_orbit_settings = self.settings["general_settings"]["axes_orbit"]
|
|
130
39
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
<= int(distance)
|
|
134
|
-
<= (self.aspects_settings[8]["degree"] + self.aspects_settings[8]["orb"])
|
|
135
|
-
):
|
|
136
|
-
name = self.aspects_settings[8]["name"]
|
|
137
|
-
aspect_degrees = self.aspects_settings[8]["degree"]
|
|
138
|
-
color = self.aspects_settings[8]["color"]
|
|
139
|
-
verdict = True
|
|
140
|
-
aid = 8
|
|
141
|
-
|
|
142
|
-
elif (
|
|
143
|
-
(self.aspects_settings[9]["degree"] - self.aspects_settings[9]["orb"])
|
|
144
|
-
<= int(distance)
|
|
145
|
-
<= (self.aspects_settings[9]["degree"] + self.aspects_settings[9]["orb"])
|
|
146
|
-
):
|
|
147
|
-
name = self.aspects_settings[9]["name"]
|
|
148
|
-
aspect_degrees = self.aspects_settings[9]["degree"]
|
|
149
|
-
color = self.aspects_settings[9]["color"]
|
|
150
|
-
verdict = True
|
|
151
|
-
aid = 9
|
|
152
|
-
|
|
153
|
-
elif (
|
|
154
|
-
(self.aspects_settings[10]["degree"] - self.aspects_settings[10]["orb"])
|
|
155
|
-
<= int(distance)
|
|
156
|
-
<= (self.aspects_settings[10]["degree"] + self.aspects_settings[10]["orb"])
|
|
157
|
-
):
|
|
158
|
-
name = self.aspects_settings[10]["name"]
|
|
159
|
-
aspect_degrees = self.aspects_settings[10]["degree"]
|
|
160
|
-
color = self.aspects_settings[10]["color"]
|
|
161
|
-
verdict = True
|
|
162
|
-
aid = 10
|
|
163
|
-
|
|
164
|
-
else:
|
|
165
|
-
verdict = False
|
|
166
|
-
name = None
|
|
167
|
-
distance = 0
|
|
168
|
-
aspect_degrees = 0
|
|
169
|
-
color = None
|
|
170
|
-
aid = None
|
|
171
|
-
|
|
172
|
-
return (
|
|
173
|
-
verdict,
|
|
174
|
-
name,
|
|
175
|
-
distance - aspect_degrees,
|
|
176
|
-
aspect_degrees,
|
|
177
|
-
color,
|
|
178
|
-
aid,
|
|
179
|
-
diff,
|
|
180
|
-
)
|
|
181
|
-
|
|
182
|
-
def p_id_decoder(self, name):
|
|
183
|
-
"""
|
|
184
|
-
Check if the name of the planet is the same in the settings and return
|
|
185
|
-
the correct id for the planet.
|
|
186
|
-
"""
|
|
187
|
-
str_name = str(name)
|
|
188
|
-
for planet in self.planets_settings:
|
|
189
|
-
if planet["name"] == str_name:
|
|
190
|
-
result = planet["id"]
|
|
191
|
-
return result
|
|
192
|
-
|
|
193
|
-
def filter_by_settings(self, init_point_list):
|
|
194
|
-
"""
|
|
195
|
-
Creates a list of all the desired
|
|
196
|
-
points filtering by the settings.
|
|
197
|
-
"""
|
|
198
|
-
|
|
199
|
-
set_points_name = []
|
|
200
|
-
for p in self.planets_settings:
|
|
201
|
-
if p["is_active"]:
|
|
202
|
-
set_points_name.append(p["name"])
|
|
203
|
-
|
|
204
|
-
point_list = []
|
|
205
|
-
for l in init_point_list:
|
|
206
|
-
if l["name"] in set_points_name:
|
|
207
|
-
point_list.append(l)
|
|
208
|
-
|
|
209
|
-
return point_list
|
|
210
|
-
|
|
211
|
-
def get_all_aspects(self):
|
|
40
|
+
@cached_property
|
|
41
|
+
def all_aspects(self):
|
|
212
42
|
"""
|
|
213
43
|
Return all the aspects of the points in the natal chart in a dictionary,
|
|
214
44
|
first all the individual aspects of each planet, second the aspects
|
|
215
|
-
|
|
45
|
+
without repetitions.
|
|
216
46
|
"""
|
|
217
47
|
|
|
218
|
-
|
|
48
|
+
active_points_list = get_active_points_list(self.user, self.settings)
|
|
219
49
|
|
|
220
50
|
self.all_aspects_list = []
|
|
221
51
|
|
|
222
|
-
for first in range(len(
|
|
223
|
-
# Generates the aspects list
|
|
224
|
-
for second in range(first + 1, len(
|
|
225
|
-
verdict, name, orbit, aspect_degrees, color, aid, diff =
|
|
226
|
-
|
|
52
|
+
for first in range(len(active_points_list)):
|
|
53
|
+
# Generates the aspects list without repetitions
|
|
54
|
+
for second in range(first + 1, len(active_points_list)):
|
|
55
|
+
verdict, name, orbit, aspect_degrees, color, aid, diff = get_aspect_from_two_points(
|
|
56
|
+
self.aspects_settings, active_points_list[first]["abs_pos"], active_points_list[second]["abs_pos"]
|
|
227
57
|
)
|
|
228
58
|
|
|
229
59
|
if verdict == True:
|
|
230
60
|
d_asp = {
|
|
231
|
-
"p1_name":
|
|
232
|
-
"p1_abs_pos":
|
|
233
|
-
"p2_name":
|
|
234
|
-
"p2_abs_pos":
|
|
61
|
+
"p1_name": active_points_list[first]["name"],
|
|
62
|
+
"p1_abs_pos": active_points_list[first]["abs_pos"],
|
|
63
|
+
"p2_name": active_points_list[second]["name"],
|
|
64
|
+
"p2_abs_pos": active_points_list[second]["abs_pos"],
|
|
235
65
|
"aspect": name,
|
|
236
66
|
"orbit": orbit,
|
|
237
67
|
"aspect_degrees": aspect_degrees,
|
|
238
68
|
"color": color,
|
|
239
69
|
"aid": aid,
|
|
240
70
|
"diff": diff,
|
|
241
|
-
"p1": self.
|
|
242
|
-
"p2":
|
|
243
|
-
|
|
71
|
+
"p1": planet_id_decoder(self.celestial_points, active_points_list[first]["name"]),
|
|
72
|
+
"p2": planet_id_decoder(
|
|
73
|
+
self.celestial_points,
|
|
74
|
+
active_points_list[second]["name"],
|
|
244
75
|
),
|
|
245
76
|
}
|
|
246
77
|
|
|
@@ -248,7 +79,8 @@ class NatalAspects:
|
|
|
248
79
|
|
|
249
80
|
return self.all_aspects_list
|
|
250
81
|
|
|
251
|
-
|
|
82
|
+
@cached_property
|
|
83
|
+
def relevant_aspects(self):
|
|
252
84
|
"""
|
|
253
85
|
Filters the aspects list with the desired points, in this case
|
|
254
86
|
the most important are hardcoded.
|
|
@@ -256,19 +88,15 @@ class NatalAspects:
|
|
|
256
88
|
or the numbers of the houses.
|
|
257
89
|
"""
|
|
258
90
|
|
|
259
|
-
|
|
91
|
+
logging.debug("Relevant aspects not already calculated, calculating now...")
|
|
92
|
+
self.all_aspects
|
|
260
93
|
|
|
261
94
|
aspects_filtered = []
|
|
262
95
|
for a in self.all_aspects_list:
|
|
263
96
|
if self.aspects_settings[a["aid"]]["is_active"] == True:
|
|
264
97
|
aspects_filtered.append(a)
|
|
265
98
|
|
|
266
|
-
axes_list =
|
|
267
|
-
"First_House",
|
|
268
|
-
"Tenth_House",
|
|
269
|
-
"Seventh_House",
|
|
270
|
-
"Fourth_House",
|
|
271
|
-
]
|
|
99
|
+
axes_list = AXES_LIST
|
|
272
100
|
counter = 0
|
|
273
101
|
|
|
274
102
|
aspects_list_subtract = []
|
|
@@ -291,15 +119,17 @@ class NatalAspects:
|
|
|
291
119
|
|
|
292
120
|
|
|
293
121
|
if __name__ == "__main__":
|
|
122
|
+
from kerykeion.utilities import setup_logging
|
|
123
|
+
setup_logging(level="debug")
|
|
124
|
+
|
|
294
125
|
johnny = AstrologicalSubject("Johnny Depp", 1963, 6, 9, 0, 0, "Owensboro", "US")
|
|
295
126
|
|
|
296
127
|
# All aspects
|
|
297
|
-
aspects = NatalAspects(johnny)
|
|
298
|
-
print(aspects)
|
|
128
|
+
aspects = NatalAspects(johnny)
|
|
129
|
+
print(aspects.all_aspects)
|
|
299
130
|
|
|
300
131
|
print("\n")
|
|
301
132
|
|
|
302
133
|
# Relevant aspects
|
|
303
|
-
aspects = NatalAspects(johnny)
|
|
304
|
-
print(aspects)
|
|
305
|
-
|
|
134
|
+
aspects = NatalAspects(johnny)
|
|
135
|
+
print(aspects.relevant_aspects)
|
|
@@ -1,13 +1,16 @@
|
|
|
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
|
from kerykeion import AstrologicalSubject
|
|
7
7
|
from pathlib import Path
|
|
8
8
|
from typing import Union
|
|
9
|
+
from functools import cached_property
|
|
9
10
|
|
|
10
11
|
from kerykeion.aspects.natal_aspects import NatalAspects
|
|
12
|
+
from kerykeion.settings.kerykeion_settings import get_settings
|
|
13
|
+
from kerykeion.aspects.aspects_utils import planet_id_decoder, get_aspect_from_two_points, get_active_points_list
|
|
11
14
|
|
|
12
15
|
|
|
13
16
|
class SynastryAspects(NatalAspects):
|
|
@@ -21,49 +24,66 @@ class SynastryAspects(NatalAspects):
|
|
|
21
24
|
kr_object_two: AstrologicalSubject,
|
|
22
25
|
new_settings_file: Union[Path, None] = None,
|
|
23
26
|
):
|
|
27
|
+
# Subjects
|
|
24
28
|
self.first_user = kr_object_one
|
|
25
29
|
self.second_user = kr_object_two
|
|
26
30
|
|
|
31
|
+
# Settings
|
|
27
32
|
self.new_settings_file = new_settings_file
|
|
28
|
-
self.
|
|
33
|
+
self.settings = get_settings(self.new_settings_file)
|
|
29
34
|
|
|
30
|
-
self.
|
|
31
|
-
self.
|
|
35
|
+
self.celestial_points = self.settings["celestial_points"]
|
|
36
|
+
self.aspects_settings = self.settings["aspects"]
|
|
37
|
+
self.axes_orbit_settings = self.settings["general_settings"]["axes_orbit"]
|
|
32
38
|
|
|
33
|
-
|
|
39
|
+
# Private variables of the aspects
|
|
40
|
+
self._all_aspects: Union[list, None] = None
|
|
41
|
+
self._relevant_aspects: Union[list, None] = None
|
|
42
|
+
|
|
43
|
+
@cached_property
|
|
44
|
+
def all_aspects(self):
|
|
34
45
|
"""
|
|
35
46
|
Return all the aspects of the points in the natal chart in a dictionary,
|
|
36
47
|
first all the individual aspects of each planet, second the aspects
|
|
37
48
|
whiteout repetitions.
|
|
38
49
|
"""
|
|
39
50
|
|
|
40
|
-
|
|
41
|
-
|
|
51
|
+
if self._all_aspects is not None:
|
|
52
|
+
return self._all_aspects
|
|
53
|
+
|
|
54
|
+
# Celestial Points Lists
|
|
55
|
+
first_active_points_list = get_active_points_list(self.first_user, self.settings)
|
|
56
|
+
second_active_points_list = get_active_points_list(self.second_user, self.settings)
|
|
42
57
|
|
|
43
58
|
self.all_aspects_list = []
|
|
44
59
|
|
|
45
|
-
for first in range(len(
|
|
60
|
+
for first in range(len(first_active_points_list)):
|
|
46
61
|
# Generates the aspects list whitout repetitions
|
|
47
|
-
for second in range(len(
|
|
48
|
-
verdict, name, orbit, aspect_degrees, color, aid, diff =
|
|
49
|
-
|
|
62
|
+
for second in range(len(second_active_points_list)):
|
|
63
|
+
verdict, name, orbit, aspect_degrees, color, aid, diff = get_aspect_from_two_points(
|
|
64
|
+
self.aspects_settings,
|
|
65
|
+
first_active_points_list[first]["abs_pos"],
|
|
66
|
+
second_active_points_list[second]["abs_pos"],
|
|
50
67
|
)
|
|
51
68
|
|
|
52
69
|
if verdict == True:
|
|
53
70
|
d_asp = {
|
|
54
|
-
"p1_name":
|
|
55
|
-
"p1_abs_pos":
|
|
56
|
-
"p2_name":
|
|
57
|
-
"p2_abs_pos":
|
|
71
|
+
"p1_name": first_active_points_list[first]["name"],
|
|
72
|
+
"p1_abs_pos": first_active_points_list[first]["abs_pos"],
|
|
73
|
+
"p2_name": second_active_points_list[second]["name"],
|
|
74
|
+
"p2_abs_pos": second_active_points_list[second]["abs_pos"],
|
|
58
75
|
"aspect": name,
|
|
59
76
|
"orbit": orbit,
|
|
60
77
|
"aspect_degrees": aspect_degrees,
|
|
61
78
|
"color": color,
|
|
62
79
|
"aid": aid,
|
|
63
80
|
"diff": diff,
|
|
64
|
-
"p1":
|
|
65
|
-
|
|
66
|
-
|
|
81
|
+
"p1": planet_id_decoder(
|
|
82
|
+
self.settings.celestial_points, first_active_points_list[first]["name"]
|
|
83
|
+
),
|
|
84
|
+
"p2": planet_id_decoder(
|
|
85
|
+
self.settings.celestial_points,
|
|
86
|
+
second_active_points_list[second]["name"],
|
|
67
87
|
),
|
|
68
88
|
}
|
|
69
89
|
|
|
@@ -73,13 +93,16 @@ class SynastryAspects(NatalAspects):
|
|
|
73
93
|
|
|
74
94
|
|
|
75
95
|
if __name__ == "__main__":
|
|
96
|
+
from kerykeion.utilities import setup_logging
|
|
97
|
+
setup_logging(level="debug")
|
|
98
|
+
|
|
76
99
|
john = AstrologicalSubject("John", 1940, 10, 9, 10, 30, "Liverpool")
|
|
77
100
|
yoko = AstrologicalSubject("Yoko", 1933, 2, 18, 10, 30, "Tokyo")
|
|
78
101
|
|
|
79
102
|
synastry_aspects = SynastryAspects(john, yoko)
|
|
80
103
|
|
|
81
104
|
# All aspects
|
|
82
|
-
print(synastry_aspects.
|
|
105
|
+
print(synastry_aspects.all_aspects)
|
|
83
106
|
|
|
84
107
|
# Relevant aspects
|
|
85
|
-
print(synastry_aspects.
|
|
108
|
+
print(synastry_aspects.relevant_aspects)
|