kerykeion 4.0.6__py3-none-any.whl → 4.12.3__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 -96
- kerykeion/aspects/__init__.py +2 -2
- kerykeion/aspects/aspects_utils.py +174 -0
- kerykeion/aspects/natal_aspects.py +51 -222
- kerykeion/aspects/synastry_aspects.py +45 -23
- kerykeion/astrological_subject.py +453 -199
- kerykeion/charts/__init__.py +1 -1
- kerykeion/charts/charts_utils.py +339 -5
- kerykeion/charts/kerykeion_chart_svg.py +441 -500
- kerykeion/charts/templates/chart.xml +362 -330
- kerykeion/enums.py +50 -0
- kerykeion/fetch_geonames.py +16 -25
- kerykeion/kr_types/__init__.py +7 -0
- kerykeion/kr_types/chart_types.py +33 -32
- kerykeion/kr_types/kerykeion_exception.py +1 -1
- kerykeion/kr_types/kr_literals.py +87 -44
- kerykeion/kr_types/kr_models.py +42 -78
- kerykeion/kr_types/settings_models.py +163 -0
- kerykeion/relationship_score.py +7 -13
- kerykeion/report.py +3 -0
- kerykeion/settings/__init__.py +1 -1
- kerykeion/settings/kerykeion_settings.py +13 -183
- kerykeion/settings/kr.config.json +9 -9
- kerykeion/utilities.py +184 -22
- {kerykeion-4.0.6.dist-info → kerykeion-4.12.3.dist-info}/METADATA +142 -32
- kerykeion-4.12.3.dist-info/RECORD +32 -0
- {kerykeion-4.0.6.dist-info → kerykeion-4.12.3.dist-info}/WHEEL +1 -1
- kerykeion-4.0.6.dist-info/RECORD +0 -29
- {kerykeion-4.0.6.dist-info → kerykeion-4.12.3.dist-info}/LICENSE +0 -0
- {kerykeion-4.0.6.dist-info → kerykeion-4.12.3.dist-info}/entry_points.txt +0 -0
kerykeion/__init__.py
CHANGED
|
@@ -1,101 +1,8 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
"""
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Kerykeion is a python library for Astrology.
|
|
6
|
-
It can calculate all the planet and house position,
|
|
7
|
-
also it can calculate the aspects of a single persone or between two, you can set how many planets you
|
|
8
|
-
need in the settings in the utility module.
|
|
9
|
-
It also can generate an SVG of a birthchart, a synastry chart or a transit chart.
|
|
10
|
-
|
|
11
|
-
Here some examples:
|
|
12
|
-
|
|
13
|
-
```python
|
|
14
|
-
|
|
15
|
-
# Import the main class for creating a kerykeion instance:
|
|
16
|
-
>>> from kerykeion import AstrologicalSubject
|
|
17
|
-
|
|
18
|
-
# Create a kerykeion instance:
|
|
19
|
-
# Args: Name, year, month, day, hour, minuts, city, nation(optional)
|
|
20
|
-
>>> kanye = AstrologicalSubject("Kanye", 1977, 6, 8, 8, 45, "Atlanta")
|
|
21
|
-
|
|
22
|
-
# Get the information about the sun in the chart:
|
|
23
|
-
# (The position of the planets always starts at 0)
|
|
24
|
-
>>> kanye.sun
|
|
25
|
-
{'name': 'Sun', 'quality': 'Mutable', 'element': 'Air', 'sign': 'Gem', 'sign_num': 2, 'pos': 17.598992059774275, 'abs_pos': 77.59899205977428, 'emoji': '♊️', 'house': '12th House', 'retrograde': False}
|
|
26
|
-
|
|
27
|
-
# Get informations about the first house:
|
|
28
|
-
>>> kanye.first_house
|
|
29
|
-
{'name': '1', 'quality': 'Cardinal', 'element': 'Water', 'sign': 'Can', 'sign_num': 3, 'pos': 17.995779673209114, 'abs_pos': 107.99577967320911, 'emoji': '♋️'}
|
|
30
|
-
|
|
31
|
-
# Get element of the moon sign:
|
|
32
|
-
>>> kanye.moon.get("element")
|
|
33
|
-
'Water'
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Generate a SVG of the birthchart:
|
|
38
|
-
|
|
39
|
-
```python
|
|
40
|
-
>>> from kerykeion import AstrologicalSubject, KerykeionChartSVG
|
|
41
|
-
|
|
42
|
-
>>> first = AstrologicalSubject("Jack", 1990, 6, 15, 15, 15, "Roma")
|
|
43
|
-
>>> second = AstrologicalSubject("Jane", 1991, 10, 25, 21, 00, "Roma")
|
|
44
|
-
|
|
45
|
-
# Set the type, it can be Natal, Synastry or Transit
|
|
46
|
-
|
|
47
|
-
>>> name = KerykeionChartSVG(first, chart_type="Synastry", second_obj=second)
|
|
48
|
-
>>> name.makeSVG()
|
|
49
|
-
>>> print(len(name.aspects_list))
|
|
50
|
-
>>> Generating kerykeion object for Jack...
|
|
51
|
-
Generating kerykeion object for Jane...
|
|
52
|
-
Jack birth location: Roma, 41.89193, 12.51133
|
|
53
|
-
SVG Generated Correctly
|
|
54
|
-
38
|
|
55
|
-
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-

|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
## Other exeples of possibles usecase
|
|
62
|
-
|
|
63
|
-
```python
|
|
64
|
-
# Get all aspects between two persons:
|
|
65
|
-
|
|
66
|
-
>>> from kerykeion import SynastryAspects, AstrologicalSubject
|
|
67
|
-
>>> first = AstrologicalSubject("Jack", 1990, 6, 15, 15, 15, "Roma")
|
|
68
|
-
>>> second = AstrologicalSubject("Jane", 1991, 10, 25, 21, 00, "Roma")
|
|
69
|
-
|
|
70
|
-
>>> name = SynastryAspects(first, second)
|
|
71
|
-
>>> aspect_list = name.get_relevant_aspects()
|
|
72
|
-
>>> print(aspect_list[0])
|
|
73
|
-
|
|
74
|
-
Generating kerykeion object for Jack...
|
|
75
|
-
Generating kerykeion object for Jane...
|
|
76
|
-
{'p1_name': 'Sun', 'p1_abs_pos': 84.17867971515636, 'p2_name': 'Sun', 'p2_abs_pos': 211.90472999502984, 'aspect': 'trine', 'orbit': 7.726050279873476, 'aspect_degrees': 120, 'color': '#36d100', 'aid': 6, 'diff': 127.72605027987348, 'p1': 0, 'p2': 0}
|
|
77
|
-
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
## Documentation
|
|
81
|
-
|
|
82
|
-
Most of the functions and the classes are self documented by the types and have docstrings.
|
|
83
|
-
An auto-generated documentation [is available here](https://g-battaglia.github.io/kerykeion).
|
|
84
|
-
|
|
85
|
-
Sooner or later I'll try to write an extensive documentation.
|
|
86
|
-
|
|
87
|
-
## Installation
|
|
88
|
-
|
|
89
|
-
Kerykeion is a Python 3 package, make sure you have Python 3 installed on your system.
|
|
90
|
-
|
|
91
|
-
## Development
|
|
92
|
-
|
|
93
|
-
You can clone this repository or download a zip file using the right side buttons.
|
|
94
|
-
|
|
95
|
-
## Contributing
|
|
96
|
-
|
|
97
|
-
Feel free to contribute to the code!
|
|
3
|
+
This is part of Kerykeion (C) 2024 Giacomo Battaglia
|
|
98
4
|
|
|
5
|
+
.. include:: ../README.md
|
|
99
6
|
"""
|
|
100
7
|
|
|
101
8
|
# Local
|
|
@@ -105,4 +12,5 @@ from .kr_types import *
|
|
|
105
12
|
from .relationship_score import RelationshipScore
|
|
106
13
|
from .aspects import SynastryAspects, NatalAspects
|
|
107
14
|
from .report import Report
|
|
108
|
-
from .settings import KerykeionSettingsModel,
|
|
15
|
+
from .settings import KerykeionSettingsModel, get_settings
|
|
16
|
+
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,174 @@
|
|
|
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
|
+
verdict = True
|
|
27
|
+
aid = 0
|
|
28
|
+
|
|
29
|
+
elif (
|
|
30
|
+
(aspects_settings[1]["degree"] - aspects_settings[1]["orb"])
|
|
31
|
+
<= int(distance)
|
|
32
|
+
<= (aspects_settings[1]["degree"] + aspects_settings[1]["orb"])
|
|
33
|
+
):
|
|
34
|
+
name = aspects_settings[1]["name"]
|
|
35
|
+
aspect_degrees = aspects_settings[1]["degree"]
|
|
36
|
+
verdict = True
|
|
37
|
+
aid = 1
|
|
38
|
+
|
|
39
|
+
elif (
|
|
40
|
+
(aspects_settings[2]["degree"] - aspects_settings[2]["orb"])
|
|
41
|
+
<= int(distance)
|
|
42
|
+
<= (aspects_settings[2]["degree"] + aspects_settings[2]["orb"])
|
|
43
|
+
):
|
|
44
|
+
name = aspects_settings[2]["name"]
|
|
45
|
+
aspect_degrees = aspects_settings[2]["degree"]
|
|
46
|
+
verdict = True
|
|
47
|
+
aid = 2
|
|
48
|
+
|
|
49
|
+
elif (
|
|
50
|
+
(aspects_settings[3]["degree"] - aspects_settings[3]["orb"])
|
|
51
|
+
<= int(distance)
|
|
52
|
+
<= (aspects_settings[3]["degree"] + aspects_settings[3]["orb"])
|
|
53
|
+
):
|
|
54
|
+
name = aspects_settings[3]["name"]
|
|
55
|
+
aspect_degrees = aspects_settings[3]["degree"]
|
|
56
|
+
verdict = True
|
|
57
|
+
aid = 3
|
|
58
|
+
|
|
59
|
+
elif (
|
|
60
|
+
(aspects_settings[4]["degree"] - aspects_settings[4]["orb"])
|
|
61
|
+
<= int(distance)
|
|
62
|
+
<= (aspects_settings[4]["degree"] + aspects_settings[4]["orb"])
|
|
63
|
+
):
|
|
64
|
+
name = aspects_settings[4]["name"]
|
|
65
|
+
aspect_degrees = aspects_settings[4]["degree"]
|
|
66
|
+
verdict = True
|
|
67
|
+
aid = 4
|
|
68
|
+
|
|
69
|
+
elif (
|
|
70
|
+
(aspects_settings[5]["degree"] - aspects_settings[5]["orb"])
|
|
71
|
+
<= int(distance)
|
|
72
|
+
<= (aspects_settings[5]["degree"] + aspects_settings[5]["orb"])
|
|
73
|
+
):
|
|
74
|
+
name = aspects_settings[5]["name"]
|
|
75
|
+
aspect_degrees = aspects_settings[5]["degree"]
|
|
76
|
+
verdict = True
|
|
77
|
+
aid = 5
|
|
78
|
+
|
|
79
|
+
elif (
|
|
80
|
+
(aspects_settings[6]["degree"] - aspects_settings[6]["orb"])
|
|
81
|
+
<= int(distance)
|
|
82
|
+
<= (aspects_settings[6]["degree"] + aspects_settings[6]["orb"])
|
|
83
|
+
):
|
|
84
|
+
name = aspects_settings[6]["name"]
|
|
85
|
+
aspect_degrees = aspects_settings[6]["degree"]
|
|
86
|
+
verdict = True
|
|
87
|
+
aid = 6
|
|
88
|
+
|
|
89
|
+
elif (
|
|
90
|
+
(aspects_settings[7]["degree"] - aspects_settings[7]["orb"])
|
|
91
|
+
<= int(distance)
|
|
92
|
+
<= (aspects_settings[7]["degree"] + aspects_settings[7]["orb"])
|
|
93
|
+
):
|
|
94
|
+
name = aspects_settings[7]["name"]
|
|
95
|
+
aspect_degrees = aspects_settings[7]["degree"]
|
|
96
|
+
verdict = True
|
|
97
|
+
aid = 7
|
|
98
|
+
|
|
99
|
+
elif (
|
|
100
|
+
(aspects_settings[8]["degree"] - aspects_settings[8]["orb"])
|
|
101
|
+
<= int(distance)
|
|
102
|
+
<= (aspects_settings[8]["degree"] + aspects_settings[8]["orb"])
|
|
103
|
+
):
|
|
104
|
+
name = aspects_settings[8]["name"]
|
|
105
|
+
aspect_degrees = aspects_settings[8]["degree"]
|
|
106
|
+
verdict = True
|
|
107
|
+
aid = 8
|
|
108
|
+
|
|
109
|
+
elif (
|
|
110
|
+
(aspects_settings[9]["degree"] - aspects_settings[9]["orb"])
|
|
111
|
+
<= int(distance)
|
|
112
|
+
<= (aspects_settings[9]["degree"] + aspects_settings[9]["orb"])
|
|
113
|
+
):
|
|
114
|
+
name = aspects_settings[9]["name"]
|
|
115
|
+
aspect_degrees = aspects_settings[9]["degree"]
|
|
116
|
+
verdict = True
|
|
117
|
+
aid = 9
|
|
118
|
+
|
|
119
|
+
elif (
|
|
120
|
+
(aspects_settings[10]["degree"] - aspects_settings[10]["orb"])
|
|
121
|
+
<= int(distance)
|
|
122
|
+
<= (aspects_settings[10]["degree"] + aspects_settings[10]["orb"])
|
|
123
|
+
):
|
|
124
|
+
name = aspects_settings[10]["name"]
|
|
125
|
+
aspect_degrees = aspects_settings[10]["degree"]
|
|
126
|
+
verdict = True
|
|
127
|
+
aid = 10
|
|
128
|
+
|
|
129
|
+
else:
|
|
130
|
+
verdict = False
|
|
131
|
+
name = None
|
|
132
|
+
distance = 0
|
|
133
|
+
aspect_degrees = 0
|
|
134
|
+
color = None
|
|
135
|
+
aid = None
|
|
136
|
+
|
|
137
|
+
return (
|
|
138
|
+
verdict,
|
|
139
|
+
name,
|
|
140
|
+
distance - aspect_degrees,
|
|
141
|
+
aspect_degrees,
|
|
142
|
+
aid,
|
|
143
|
+
diff,
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def planet_id_decoder(planets_settings: dict, name: str):
|
|
148
|
+
"""
|
|
149
|
+
Check if the name of the planet is the same in the settings and return
|
|
150
|
+
the correct id for the planet.
|
|
151
|
+
"""
|
|
152
|
+
str_name = str(name)
|
|
153
|
+
for planet in planets_settings:
|
|
154
|
+
if planet["name"] == str_name:
|
|
155
|
+
result = planet["id"]
|
|
156
|
+
return result
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def get_active_points_list(subject: AstrologicalSubject, settings: Union[KerykeionSettingsModel, dict]) -> list:
|
|
160
|
+
"""
|
|
161
|
+
Given an astrological subject and the settings, return a list of the active points.
|
|
162
|
+
Args:
|
|
163
|
+
subject (AstrologicalSubject): The astrological subject to get the active points from.
|
|
164
|
+
settings (Union[KerykeionSettingsModel, dict]): Settings model o dictionary.
|
|
165
|
+
|
|
166
|
+
Returns:
|
|
167
|
+
list: List of the active points.
|
|
168
|
+
"""
|
|
169
|
+
point_list = []
|
|
170
|
+
for planet in settings["celestial_points"]:
|
|
171
|
+
if planet["is_active"] == True:
|
|
172
|
+
point_list.append(subject[planet["name"].lower()])
|
|
173
|
+
|
|
174
|
+
return point_list
|
|
@@ -1,246 +1,76 @@
|
|
|
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,
|
|
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, 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
|
-
"color": color,
|
|
239
68
|
"aid": aid,
|
|
240
69
|
"diff": diff,
|
|
241
|
-
"p1": self.
|
|
242
|
-
"p2":
|
|
243
|
-
|
|
70
|
+
"p1": planet_id_decoder(self.celestial_points, active_points_list[first]["name"]),
|
|
71
|
+
"p2": planet_id_decoder(
|
|
72
|
+
self.celestial_points,
|
|
73
|
+
active_points_list[second]["name"],
|
|
244
74
|
),
|
|
245
75
|
}
|
|
246
76
|
|
|
@@ -248,7 +78,8 @@ class NatalAspects:
|
|
|
248
78
|
|
|
249
79
|
return self.all_aspects_list
|
|
250
80
|
|
|
251
|
-
|
|
81
|
+
@cached_property
|
|
82
|
+
def relevant_aspects(self):
|
|
252
83
|
"""
|
|
253
84
|
Filters the aspects list with the desired points, in this case
|
|
254
85
|
the most important are hardcoded.
|
|
@@ -256,19 +87,15 @@ class NatalAspects:
|
|
|
256
87
|
or the numbers of the houses.
|
|
257
88
|
"""
|
|
258
89
|
|
|
259
|
-
|
|
90
|
+
logging.debug("Relevant aspects not already calculated, calculating now...")
|
|
91
|
+
self.all_aspects
|
|
260
92
|
|
|
261
93
|
aspects_filtered = []
|
|
262
94
|
for a in self.all_aspects_list:
|
|
263
95
|
if self.aspects_settings[a["aid"]]["is_active"] == True:
|
|
264
96
|
aspects_filtered.append(a)
|
|
265
97
|
|
|
266
|
-
axes_list =
|
|
267
|
-
"First_House",
|
|
268
|
-
"Tenth_House",
|
|
269
|
-
"Seventh_House",
|
|
270
|
-
"Fourth_House",
|
|
271
|
-
]
|
|
98
|
+
axes_list = AXES_LIST
|
|
272
99
|
counter = 0
|
|
273
100
|
|
|
274
101
|
aspects_list_subtract = []
|
|
@@ -291,15 +118,17 @@ class NatalAspects:
|
|
|
291
118
|
|
|
292
119
|
|
|
293
120
|
if __name__ == "__main__":
|
|
121
|
+
from kerykeion.utilities import setup_logging
|
|
122
|
+
setup_logging(level="debug")
|
|
123
|
+
|
|
294
124
|
johnny = AstrologicalSubject("Johnny Depp", 1963, 6, 9, 0, 0, "Owensboro", "US")
|
|
295
125
|
|
|
296
126
|
# All aspects
|
|
297
|
-
aspects = NatalAspects(johnny)
|
|
298
|
-
print(aspects)
|
|
127
|
+
aspects = NatalAspects(johnny)
|
|
128
|
+
print(aspects.all_aspects)
|
|
299
129
|
|
|
300
130
|
print("\n")
|
|
301
131
|
|
|
302
132
|
# Relevant aspects
|
|
303
|
-
aspects = NatalAspects(johnny)
|
|
304
|
-
print(aspects)
|
|
305
|
-
|
|
133
|
+
aspects = NatalAspects(johnny)
|
|
134
|
+
print(aspects.relevant_aspects)
|