kerykeion 5.0.0a9__py3-none-any.whl → 5.1.8__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.

Files changed (79) hide show
  1. kerykeion/__init__.py +50 -9
  2. kerykeion/aspects/__init__.py +5 -2
  3. kerykeion/aspects/aspects_factory.py +568 -0
  4. kerykeion/aspects/aspects_utils.py +78 -11
  5. kerykeion/astrological_subject_factory.py +1032 -275
  6. kerykeion/backword.py +820 -0
  7. kerykeion/chart_data_factory.py +552 -0
  8. kerykeion/charts/chart_drawer.py +2661 -0
  9. kerykeion/charts/charts_utils.py +652 -399
  10. kerykeion/charts/draw_planets.py +603 -353
  11. kerykeion/charts/templates/aspect_grid_only.xml +326 -198
  12. kerykeion/charts/templates/chart.xml +306 -256
  13. kerykeion/charts/templates/wheel_only.xml +330 -200
  14. kerykeion/charts/themes/black-and-white.css +148 -0
  15. kerykeion/charts/themes/classic.css +11 -0
  16. kerykeion/charts/themes/dark-high-contrast.css +11 -0
  17. kerykeion/charts/themes/dark.css +11 -0
  18. kerykeion/charts/themes/light.css +11 -0
  19. kerykeion/charts/themes/strawberry.css +10 -0
  20. kerykeion/composite_subject_factory.py +232 -13
  21. kerykeion/ephemeris_data_factory.py +443 -0
  22. kerykeion/fetch_geonames.py +78 -21
  23. kerykeion/house_comparison/__init__.py +4 -1
  24. kerykeion/house_comparison/house_comparison_factory.py +52 -19
  25. kerykeion/house_comparison/house_comparison_utils.py +37 -9
  26. kerykeion/kr_types/__init__.py +66 -6
  27. kerykeion/kr_types/chart_template_model.py +20 -0
  28. kerykeion/kr_types/kerykeion_exception.py +15 -9
  29. kerykeion/kr_types/kr_literals.py +14 -160
  30. kerykeion/kr_types/kr_models.py +14 -291
  31. kerykeion/kr_types/settings_models.py +15 -167
  32. kerykeion/planetary_return_factory.py +545 -40
  33. kerykeion/relationship_score_factory.py +137 -63
  34. kerykeion/report.py +749 -64
  35. kerykeion/schemas/__init__.py +106 -0
  36. kerykeion/schemas/chart_template_model.py +367 -0
  37. kerykeion/schemas/kerykeion_exception.py +20 -0
  38. kerykeion/schemas/kr_literals.py +181 -0
  39. kerykeion/schemas/kr_models.py +603 -0
  40. kerykeion/schemas/settings_models.py +188 -0
  41. kerykeion/settings/__init__.py +20 -1
  42. kerykeion/settings/chart_defaults.py +444 -0
  43. kerykeion/settings/config_constants.py +88 -12
  44. kerykeion/settings/kerykeion_settings.py +32 -75
  45. kerykeion/settings/translation_strings.py +1499 -0
  46. kerykeion/settings/translations.py +74 -0
  47. kerykeion/sweph/ast136/s136108s.se1 +0 -0
  48. kerykeion/sweph/ast136/s136199s.se1 +0 -0
  49. kerykeion/sweph/ast136/s136472s.se1 +0 -0
  50. kerykeion/sweph/ast28/se28978s.se1 +0 -0
  51. kerykeion/sweph/ast50/se50000s.se1 +0 -0
  52. kerykeion/sweph/ast90/se90377s.se1 +0 -0
  53. kerykeion/sweph/ast90/se90482s.se1 +0 -0
  54. kerykeion/sweph/sefstars.txt +1602 -0
  55. kerykeion/transits_time_range_factory.py +302 -0
  56. kerykeion/utilities.py +289 -204
  57. kerykeion-5.1.8.dist-info/METADATA +1793 -0
  58. kerykeion-5.1.8.dist-info/RECORD +63 -0
  59. kerykeion/aspects/natal_aspects.py +0 -181
  60. kerykeion/aspects/synastry_aspects.py +0 -141
  61. kerykeion/aspects/transits_time_range.py +0 -41
  62. kerykeion/charts/draw_planets_v2.py +0 -649
  63. kerykeion/charts/draw_planets_v3.py +0 -679
  64. kerykeion/charts/kerykeion_chart_svg.py +0 -2038
  65. kerykeion/enums.py +0 -57
  66. kerykeion/ephemeris_data.py +0 -238
  67. kerykeion/house_comparison/house_comparison_models.py +0 -38
  68. kerykeion/kr_types/chart_types.py +0 -106
  69. kerykeion/settings/kr.config.json +0 -1304
  70. kerykeion/settings/legacy/__init__.py +0 -0
  71. kerykeion/settings/legacy/legacy_celestial_points_settings.py +0 -299
  72. kerykeion/settings/legacy/legacy_chart_aspects_settings.py +0 -71
  73. kerykeion/settings/legacy/legacy_color_settings.py +0 -42
  74. kerykeion/transits_time_range.py +0 -128
  75. kerykeion-5.0.0a9.dist-info/METADATA +0 -636
  76. kerykeion-5.0.0a9.dist-info/RECORD +0 -55
  77. kerykeion-5.0.0a9.dist-info/entry_points.txt +0 -2
  78. {kerykeion-5.0.0a9.dist-info → kerykeion-5.1.8.dist-info}/WHEEL +0 -0
  79. {kerykeion-5.0.0a9.dist-info → kerykeion-5.1.8.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,63 @@
1
+ kerykeion/__init__.py,sha256=7gI_kWXhsmEK4SvNV6CkRmI0yjA3r7EO8UfQc_44UZU,1963
2
+ kerykeion/astrological_subject_factory.py,sha256=qR6dWULcF4J2ym2oTI4CQ-zfQfMgAFNyLwhGXhJkg-A,94740
3
+ kerykeion/backword.py,sha256=aZrC6gRhLuewv3PvpHWlPvqrDGxspCEN2mMAh8tLtfM,34500
4
+ kerykeion/chart_data_factory.py,sha256=gtAlZs_IjPMUJUitLjkRFCESmAj-wEOlYdCPQ2b8XwA,25123
5
+ kerykeion/composite_subject_factory.py,sha256=eUtjThDlYr6SQsEi02_CgO1kEMUMYgQGzR5rX91GEwY,17120
6
+ kerykeion/ephemeris_data_factory.py,sha256=UKgoJQSqiyy4U0jNw23NI_BP0kbZblJU5mtBnNZtnb0,20417
7
+ kerykeion/fetch_geonames.py,sha256=37q5SwLEEvz7UMtmwk4dsH5QOQXfY5MCbnRO0u0ZKtE,6881
8
+ kerykeion/planetary_return_factory.py,sha256=bIVPqa2gs7hYHi8aaMfVr4U99xWZk3LmYqZI9KG6ACo,37572
9
+ kerykeion/relationship_score_factory.py,sha256=pVrsRlFs__bfVe8K3cOirsnRtdBOW2DbnKqPa7jCWF0,11396
10
+ kerykeion/report.py,sha256=fHGzPh9vhDIWzT_Gr4V5KrfLjiDWLlSlBgOk6-DeH80,31463
11
+ kerykeion/transits_time_range_factory.py,sha256=YRSFVa2MIZFQMPbEL2njKd-P7p431zoAsINrddZz5Yw,13934
12
+ kerykeion/utilities.py,sha256=AqcJ9zmVEcwiurMfN63MDSeegJ1dJ4L1sQVJeoNIGOE,24016
13
+ kerykeion/aspects/__init__.py,sha256=csJmxvLdBu-bHuW676f3dpY__Qyc6LwRyrpWVTh3n1A,287
14
+ kerykeion/aspects/aspects_factory.py,sha256=XCuOOpo0ZW7sihYT2f50bLVpebEk19b9EtEjXonwte0,24156
15
+ kerykeion/aspects/aspects_utils.py,sha256=2YloOKOmN0h2d6J8A1vCe-y4A2mWNoOUYCGDVwGl4gA,5794
16
+ kerykeion/charts/__init__.py,sha256=i9NMZ7LdkllPlqQSi1or9gTobHbROGDKmJhBDO4R0mA,128
17
+ kerykeion/charts/chart_drawer.py,sha256=C3NI-_2UugD9YWnakq3asICJolX9gsQLM2aP3n6hOq4,124658
18
+ kerykeion/charts/charts_utils.py,sha256=iwgDhVc_GwKuQBZ6JNmn6RWVILD5KIcjbrnDTR3wrAc,70911
19
+ kerykeion/charts/draw_planets.py,sha256=tIj3FeLLomVSbCaZUxfw_qBEB3pxi4EIEhqaeTgTyTY,29061
20
+ kerykeion/charts/templates/aspect_grid_only.xml,sha256=v3QtNMjk-kBdUTfB0r6thg--Ta_tNFdRQCzdk5PAycY,86429
21
+ kerykeion/charts/templates/chart.xml,sha256=oUI9hV--4rdsVFqZJ8ChpgC2ZgfnqlL2Tl2vco1vlOc,92095
22
+ kerykeion/charts/templates/wheel_only.xml,sha256=05k2KiVMP-5NW0e8PZrTX-VPn5x-SaNzEYPgU1_OKa0,87775
23
+ kerykeion/charts/themes/black-and-white.css,sha256=IIoy9wyB4znrvPvmallKmgDW4HMJPywTv5IZsolaEp4,6543
24
+ kerykeion/charts/themes/classic.css,sha256=xvBiI4DtY5fMaA7ilxGl26VEDY1VzkOTWm1XOs9n-ec,5158
25
+ kerykeion/charts/themes/dark-high-contrast.css,sha256=EbmK9sM_ksJ5Fx36cb91nSvSsqC6mzjkRXCpwNTHfCE,8260
26
+ kerykeion/charts/themes/dark.css,sha256=gub44WABpHseNNaWu4lVmtvDthgrRCvEVaobcd-UrMY,8335
27
+ kerykeion/charts/themes/light.css,sha256=WEX_uKPArTjignVwvuAHqqWIbNiCheQ9Y7MgK0HJjAM,8344
28
+ kerykeion/charts/themes/strawberry.css,sha256=pFrST9xDRiej-YXh7P_snOr46DUcKjw--5d2MrlashY,9001
29
+ kerykeion/house_comparison/__init__.py,sha256=dnSVpx_pKylYUeaTGxHsSlN15HqQS6eJHpDQOrIvrpY,107
30
+ kerykeion/house_comparison/house_comparison_factory.py,sha256=YkA7itvkyIcKEf8Ffi53on-gGhsHi_Oeu9Gm4N9aHQs,4588
31
+ kerykeion/house_comparison/house_comparison_utils.py,sha256=vzME6Aw5njCXu6BmPLuhgfEVDI00qfQI7MPH-YujO1g,5071
32
+ kerykeion/kr_types/__init__.py,sha256=qu6A0wjQEkBgCGAyTRl2srHvq6LOiBlNsrlEcVomx78,1990
33
+ kerykeion/kr_types/chart_template_model.py,sha256=k4WhL3sKAa8iCTsvlH4dFdOBByLIkgT7Y1MHBuYem1Q,733
34
+ kerykeion/kr_types/kerykeion_exception.py,sha256=_Jjd-5DuBA4qBG58ob5Lhe9HANrXCaihMagD0icPZc0,726
35
+ kerykeion/kr_types/kr_literals.py,sha256=_yZ-mtuomVxa1sMpxemA6T30PGVPMdGxbF_K2jmWfTo,670
36
+ kerykeion/kr_types/kr_models.py,sha256=-cesGCN8-CjmPSqCH6CMnc0hDA_87g4zflEHxiKi1QY,656
37
+ kerykeion/kr_types/settings_models.py,sha256=xtpsrhjmhdowDSBeQ7TEMR53-uEEspCoXKCLnq18nDo,698
38
+ kerykeion/schemas/__init__.py,sha256=EcwbnoYPKLq3m7n5s2cEZ8UyWpxdmHXbvM23hLNBNBI,2376
39
+ kerykeion/schemas/chart_template_model.py,sha256=fQ_EZ8ccOgNd4gXu5KilF1dUH9B2RVCDLHc09YkYLyY,8978
40
+ kerykeion/schemas/kerykeion_exception.py,sha256=vTYdwj_mL-Q-MqHJvEzzBXxQ5YI2kAwUC6ImoWxMKXc,454
41
+ kerykeion/schemas/kr_literals.py,sha256=mvPH3_TyuF5GTYKfIGk9SpxbuW7uYhSlp20SZJ7l6BY,5658
42
+ kerykeion/schemas/kr_models.py,sha256=e1PQxUqC437IWIVKrOi71NVR5bEV7KGhF_JAaxs9zN0,21945
43
+ kerykeion/schemas/settings_models.py,sha256=NBbtT7s0GzpWxLVygSszaCmefKP8yQyAIPxgr2Y-93Y,17927
44
+ kerykeion/settings/__init__.py,sha256=IJUqkYTpvmbKecVeCbsiL1qU_4xWc78u4OrvN_T3ZAI,624
45
+ kerykeion/settings/chart_defaults.py,sha256=TSm2hXCxym3I7XpIqIMBLWM253Z0dCGbhPi2MpWbD_0,12490
46
+ kerykeion/settings/config_constants.py,sha256=D1PApNT7Zldlv8QINmaKnyLovY5UJ2FsAqHNTTPd5ps,3717
47
+ kerykeion/settings/kerykeion_settings.py,sha256=aeRlxvy2GwC-mxoD_DFMXMoO4yPQp1XQbEAGVQat0Wo,1947
48
+ kerykeion/settings/translation_strings.py,sha256=HoavTMRKsjmNDv97YJg4wWumPA8iLURhFJpudUPdhWc,57354
49
+ kerykeion/settings/translations.py,sha256=A_Zwr-ujvxBLvE4a87-28pM3KifdUaAvsR3XvMZNg0s,2377
50
+ kerykeion/sweph/README.md,sha256=L7FtNAJTWtrZNGKa8MX87SjduFYPYxwWhaI5fmtzNZo,73
51
+ kerykeion/sweph/seas_18.se1,sha256=X9nCqhZU43wJpq61WAdueVQJt9xL2UjrwPqn1Kdoa1s,223002
52
+ kerykeion/sweph/sefstars.txt,sha256=GLDcr75bckB3PauiwDijJfWz_EFj9h4Kf06Sq9T1F8Y,136618
53
+ kerykeion/sweph/ast136/s136108s.se1,sha256=eSDfBurMBVnawSnZZgwHUrwqeAZYlKPLH1NNtq0ep7I,19489
54
+ kerykeion/sweph/ast136/s136199s.se1,sha256=eNBaQGxAmnqeAgE_C-cpsX4BTgPYR4_H9HRkI9QHMPA,14514
55
+ kerykeion/sweph/ast136/s136472s.se1,sha256=TjBnDMtPWdBzbOHn9Mju5C2i-Kfg1dT7kQaeVuGOoi8,19454
56
+ kerykeion/sweph/ast28/se28978s.se1,sha256=nU2Qp-ELc_tzFnRc1QT6uVueWXEipvhYDgfQRX1TAC4,16227
57
+ kerykeion/sweph/ast50/se50000s.se1,sha256=9jTrPlIrZMOBWC9cNgwzcfz0KBHdXFZoY9-NZ_HtECo,15748
58
+ kerykeion/sweph/ast90/se90377s.se1,sha256=bto2x4LtBv8b1ej1XhVFYq-kfHO9cczbKV9U1f9UVu4,10288
59
+ kerykeion/sweph/ast90/se90482s.se1,sha256=uHxz6bP4K8zgtQFrlWFwxrYfmqm5kXxsg6OYhAIUbAA,16173
60
+ kerykeion-5.1.8.dist-info/METADATA,sha256=l4rJD4aLJrCesNRr_LmF9RDRMSQP7uKrV6hA6DxLvAs,61802
61
+ kerykeion-5.1.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
62
+ kerykeion-5.1.8.dist-info/licenses/LICENSE,sha256=UTLH8EdbAsgQei4PA2PnBCPGLSZkq5J-dhkyJuXgWQU,34273
63
+ kerykeion-5.1.8.dist-info/RECORD,,
@@ -1,181 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- """
3
- This is part of Kerykeion (C) 2025 Giacomo Battaglia
4
- """
5
-
6
- import logging
7
- from dataclasses import dataclass, field
8
- from functools import cached_property
9
- from kerykeion.astrological_subject_factory import AstrologicalSubjectFactory
10
- from kerykeion.settings.kerykeion_settings import get_settings
11
- from kerykeion.aspects.aspects_utils import planet_id_decoder, get_aspect_from_two_points, get_active_points_list
12
- from kerykeion.kr_types.kr_models import AstrologicalSubjectModel, AspectModel, ActiveAspect, CompositeSubjectModel, PlanetReturnModel
13
- from kerykeion.kr_types.kr_literals import AstrologicalPoint
14
- from kerykeion.kr_types.settings_models import KerykeionSettingsModel
15
- from kerykeion.settings.config_constants import DEFAULT_ACTIVE_POINTS, DEFAULT_ACTIVE_ASPECTS, DEFAULT_AXIS_ORBIT
16
- from kerykeion.settings.legacy.legacy_celestial_points_settings import DEFAULT_CELESTIAL_POINTS_SETTINGS
17
- from kerykeion.settings.legacy.legacy_chart_aspects_settings import DEFAULT_CHART_ASPECTS_SETTINGS
18
- from kerykeion.utilities import find_common_active_points
19
- from pathlib import Path
20
- from typing import Union, List, Optional
21
-
22
-
23
- AXES_LIST = [
24
- "Ascendant",
25
- "Medium_Coeli",
26
- "Descendant",
27
- "Imum_Coeli",
28
- ]
29
-
30
-
31
- @dataclass
32
- class NatalAspects:
33
- """
34
- Generates an object with all the aspects of a birthcart.
35
- """
36
-
37
- user: Union[AstrologicalSubjectModel, CompositeSubjectModel, PlanetReturnModel]
38
- new_settings_file: Union[Path, KerykeionSettingsModel, dict, None] = None
39
- active_points: Optional[List[AstrologicalPoint]] = field(default_factory=lambda: None)
40
- active_aspects: List[ActiveAspect] = field(default_factory=lambda: DEFAULT_ACTIVE_ASPECTS)
41
-
42
- def __post_init__(self):
43
- self.settings = get_settings(self.new_settings_file)
44
-
45
- self.celestial_points = DEFAULT_CELESTIAL_POINTS_SETTINGS
46
- self.aspects_settings = DEFAULT_CHART_ASPECTS_SETTINGS
47
- self.axes_orbit_settings = DEFAULT_AXIS_ORBIT
48
-
49
- if not self.active_points:
50
- self.active_points = self.user.active_points
51
- else:
52
- self.active_points = find_common_active_points(
53
- self.user.active_points,
54
- self.active_points,
55
- )
56
-
57
-
58
- @cached_property
59
- def all_aspects(self):
60
- """
61
- Return all the aspects of the points in the natal chart in a dictionary,
62
- first all the individual aspects of each planet, second the aspects
63
- without repetitions.
64
- """
65
-
66
- active_points_list = get_active_points_list(self.user, self.active_points)
67
-
68
- # ---> TODO: Clean this up
69
- filtered_settings = []
70
- for a in self.aspects_settings:
71
- for aspect in self.active_aspects:
72
- if a["name"] == aspect["name"]:
73
- a["orb"] = aspect["orb"] # Assign the aspect's orb
74
- filtered_settings.append(a)
75
- break # Exit the inner loop once a match is found
76
- self.aspects_settings = filtered_settings
77
- # <--- TODO: Clean this up
78
-
79
- self.all_aspects_list = []
80
- for first in range(len(active_points_list)):
81
- # Generates the aspects list without repetitions
82
- for second in range(first + 1, len(active_points_list)):
83
- # AC/DC, MC/IC and North/South nodes are always in opposition
84
- opposite_pairs = {
85
- ("Ascendant", "Descendant"),
86
- ("Descendant", "Ascendant"),
87
- ("Medium_Coeli", "Imum_Coeli"),
88
- ("Imum_Coeli", "Medium_Coeli"),
89
- ("True_Node", "True_South_Node"),
90
- ("Mean_Node", "Mean_South_Node"),
91
- ("True_South_Node", "True_Node"),
92
- ("Mean_South_Node", "Mean_Node"),
93
- }
94
- if (active_points_list[first]["name"], active_points_list[second]["name"]) in opposite_pairs:
95
- continue
96
-
97
- aspect = get_aspect_from_two_points(
98
- self.aspects_settings,
99
- active_points_list[first]["abs_pos"],
100
- active_points_list[second]["abs_pos"]
101
- )
102
-
103
- verdict = aspect["verdict"]
104
- name = aspect["name"]
105
- orbit = aspect["orbit"]
106
- aspect_degrees = aspect["aspect_degrees"]
107
- diff = aspect["diff"]
108
-
109
- if verdict == True:
110
- aspect_model = AspectModel(
111
- p1_name=active_points_list[first]["name"],
112
- p1_owner=self.user.name,
113
- p1_abs_pos=active_points_list[first]["abs_pos"],
114
- p2_name=active_points_list[second]["name"],
115
- p2_owner=self.user.name,
116
- p2_abs_pos=active_points_list[second]["abs_pos"],
117
- aspect=name,
118
- orbit=orbit,
119
- aspect_degrees=aspect_degrees,
120
- diff=diff,
121
- p1=planet_id_decoder(self.celestial_points, active_points_list[first]["name"]),
122
- p2=planet_id_decoder(self.celestial_points, active_points_list[second]["name"]),
123
- )
124
- self.all_aspects_list.append(aspect_model)
125
-
126
- return self.all_aspects_list
127
-
128
- @cached_property
129
- def relevant_aspects(self):
130
- """
131
- Filters the aspects list with the desired points, in this case
132
- the most important are hardcoded.
133
- Set the list with set_points and creating a list with the names
134
- or the numbers of the houses.
135
- The relevant aspects are the ones that are set as looping in the available_aspects list.
136
- """
137
-
138
- logging.debug("Relevant aspects not already calculated, calculating now...")
139
- self.all_aspects
140
-
141
- axes_list = AXES_LIST
142
- counter = 0
143
-
144
- # Remove aspects where the orbits exceed the maximum orb thresholds specified in the settings
145
- # (specified usually in kr.config.json file)
146
- aspects_filtered = self.all_aspects
147
- aspects_list_subtract = []
148
- for a in aspects_filtered:
149
- counter += 1
150
- name_p1 = str(a["p1_name"])
151
- name_p2 = str(a["p2_name"])
152
-
153
- if name_p1 in axes_list:
154
- if abs(a["orbit"]) >= self.axes_orbit_settings:
155
- aspects_list_subtract.append(a)
156
-
157
- elif name_p2 in axes_list:
158
- if abs(a["orbit"]) >= self.axes_orbit_settings:
159
- aspects_list_subtract.append(a)
160
-
161
- self.aspects = [item for item in aspects_filtered if item not in aspects_list_subtract]
162
-
163
- return self.aspects
164
-
165
-
166
- if __name__ == "__main__":
167
- from kerykeion.utilities import setup_logging
168
-
169
- setup_logging(level="debug")
170
-
171
- johnny = AstrologicalSubjectFactory.from_birth_data("Johnny Depp", 1963, 6, 9, 0, 0, 0, "Owensboro", "US")
172
-
173
- # All aspects as a list of dictionaries
174
- aspects = NatalAspects(johnny)
175
- #print([a.model_dump() for a in aspects.all_aspects])
176
-
177
- print("\n")
178
-
179
- # Relevant aspects as a list of dictionaries
180
- aspects = NatalAspects(johnny)
181
- print([a.model_dump() for a in aspects.relevant_aspects])
@@ -1,141 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- """
3
- This is part of Kerykeion (C) 2025 Giacomo Battaglia
4
- """
5
-
6
- from pathlib import Path
7
- from typing import Union
8
- from functools import cached_property
9
- from typing import TYPE_CHECKING
10
-
11
- from kerykeion.astrological_subject_factory import AstrologicalSubjectFactory
12
- from kerykeion.aspects.natal_aspects import NatalAspects
13
- from kerykeion.settings.kerykeion_settings import get_settings
14
- from kerykeion.aspects.aspects_utils import planet_id_decoder, get_aspect_from_two_points, get_active_points_list
15
- from kerykeion.kr_types.kr_models import AstrologicalSubjectModel, AspectModel, ActiveAspect, CompositeSubjectModel, PlanetReturnModel
16
- from kerykeion.kr_types.settings_models import KerykeionSettingsModel
17
- from kerykeion.settings.config_constants import DEFAULT_ACTIVE_ASPECTS, DEFAULT_AXIS_ORBIT
18
- from kerykeion.settings.legacy.legacy_celestial_points_settings import DEFAULT_CELESTIAL_POINTS_SETTINGS
19
- from kerykeion.settings.legacy.legacy_chart_aspects_settings import DEFAULT_CHART_ASPECTS_SETTINGS
20
- from kerykeion.kr_types.kr_literals import AstrologicalPoint
21
- from kerykeion.utilities import find_common_active_points
22
- from typing import Union, List, Optional
23
-
24
-
25
- class SynastryAspects(NatalAspects):
26
- """
27
- Generates an object with all the aspects between two persons.
28
- """
29
-
30
- def __init__(
31
- self,
32
- kr_object_one: Union[AstrologicalSubjectModel, CompositeSubjectModel, PlanetReturnModel],
33
- kr_object_two: Union[AstrologicalSubjectModel, CompositeSubjectModel, PlanetReturnModel],
34
- new_settings_file: Union[Path, KerykeionSettingsModel, dict, None] = None,
35
- active_points: Optional[list[AstrologicalPoint]] = None,
36
- active_aspects: List[ActiveAspect] = DEFAULT_ACTIVE_ASPECTS,
37
- ):
38
- # Subjects
39
- self.first_user = kr_object_one
40
- self.second_user = kr_object_two
41
-
42
- # Settings
43
- self.new_settings_file = new_settings_file
44
- self.settings = get_settings(self.new_settings_file)
45
-
46
- self.celestial_points = DEFAULT_CELESTIAL_POINTS_SETTINGS
47
- self.aspects_settings = DEFAULT_CHART_ASPECTS_SETTINGS
48
- self.axes_orbit_settings = DEFAULT_AXIS_ORBIT
49
- self.active_points = active_points
50
- self.active_aspects = active_aspects
51
-
52
- # Private variables of the aspects
53
- self._all_aspects: Union[list, None] = None
54
- self._relevant_aspects: Union[list, None] = None
55
-
56
- if not self.active_points:
57
- self.active_points = self.first_user.active_points
58
- else:
59
- self.active_points = find_common_active_points(
60
- self.first_user.active_points,
61
- self.active_points,
62
- )
63
-
64
- self.active_points = find_common_active_points(
65
- self.second_user.active_points,
66
- self.active_points,
67
- )
68
-
69
- @cached_property
70
- def all_aspects(self):
71
- """
72
- Return all the aspects of the points in the natal chart in a dictionary,
73
- first all the individual aspects of each planet, second the aspects
74
- whiteout repetitions.
75
- """
76
-
77
- if self._all_aspects is not None:
78
- return self._all_aspects
79
-
80
- # Celestial Points Lists
81
- first_active_points_list = get_active_points_list(self.first_user, self.active_points)
82
- second_active_points_list = get_active_points_list(self.second_user, self.active_points)
83
-
84
- # ---> TODO: Clean this up
85
- filtered_settings = []
86
- for a in self.aspects_settings:
87
- for aspect in self.active_aspects:
88
- if a["name"] == aspect["name"]:
89
- a["orb"] = aspect["orb"] # Assign the aspect's orb
90
- filtered_settings.append(a)
91
- self.aspects_settings = filtered_settings
92
- # <--- TODO: Clean this up
93
-
94
- self.all_aspects_list = []
95
- for first in range(len(first_active_points_list)):
96
- # Generates the aspects list whitout repetitions
97
- for second in range(len(second_active_points_list)):
98
- aspect = get_aspect_from_two_points(
99
- self.aspects_settings,
100
- first_active_points_list[first]["abs_pos"],
101
- second_active_points_list[second]["abs_pos"],
102
- )
103
-
104
- verdict = aspect["verdict"]
105
- name = aspect["name"]
106
- orbit = aspect["orbit"]
107
- aspect_degrees = aspect["aspect_degrees"]
108
- diff = aspect["diff"]
109
-
110
- if verdict == True:
111
- aspect_model = AspectModel(
112
- p1_name=first_active_points_list[first]["name"],
113
- p1_owner=self.first_user.name,
114
- p1_abs_pos=first_active_points_list[first]["abs_pos"],
115
- p2_name=second_active_points_list[second]["name"],
116
- p2_owner=self.second_user.name,
117
- p2_abs_pos=second_active_points_list[second]["abs_pos"],
118
- aspect=name,
119
- orbit=orbit,
120
- aspect_degrees=aspect_degrees,
121
- diff=diff,
122
- p1=planet_id_decoder(self.celestial_points, first_active_points_list[first]["name"]),
123
- p2=planet_id_decoder(self.celestial_points, second_active_points_list[second]["name"]),
124
- )
125
- self.all_aspects_list.append(aspect_model)
126
-
127
- return self.all_aspects_list
128
-
129
-
130
- if __name__ == "__main__":
131
- from kerykeion.utilities import setup_logging
132
-
133
- setup_logging(level="debug")
134
-
135
- john = AstrologicalSubjectFactory.from_birth_data("John", 1940, 10, 9, 10, 30, "Liverpool", "GB")
136
- yoko = AstrologicalSubjectFactory.from_birth_data("Yoko", 1933, 2, 18, 10, 30, "Tokyo", "JP")
137
-
138
- synastry_aspects = SynastryAspects(john, yoko)
139
-
140
- # All aspects as a list of dictionaries
141
- print([aspect.dict() for aspect in synastry_aspects.all_aspects])
@@ -1,41 +0,0 @@
1
- from datetime import datetime, timedelta
2
- from kerykeion import (
3
- TransitsTimeRangeFactory,
4
- EphemerisDataFactory,
5
- AstrologicalSubject,
6
- )
7
-
8
- # Create a natal chart for the subject
9
- person = AstrologicalSubjectFactory.from_birth_data(
10
- "Johnny Depp", 1963, 6, 9, 20, 15, 0, "Owensboro", "US"
11
- )
12
-
13
- # Define the time period for transit calculation
14
- start_date = datetime.now()
15
- end_date = datetime.now() + timedelta(days=30)
16
-
17
- # Create ephemeris data for the specified time period
18
- ephemeris_factory = EphemerisDataFactory(
19
- start_datetime=start_date,
20
- end_datetime=end_date,
21
- step_type="days",
22
- step=1,
23
- lat=person.lat,
24
- lng=person.lng,
25
- tz_str=person.tz_str,
26
- )
27
-
28
- ephemeris_data_points = ephemeris_factory.get_ephemeris_data_as_astrological_subjects()
29
-
30
- # Calculate transits for the subject
31
- transit_factory = TransitsTimeRangeFactory(
32
- natal_chart=person,
33
- ephemeris_data_points=ephemeris_data_points,
34
- )
35
-
36
- transit_results = transit_factory.get_transit_moments()
37
-
38
- # Print example data
39
- print(transit_results.model_dump()["dates"][2])
40
- print(transit_results.model_dump()["transits"][2]['date'])
41
- print(transit_results.model_dump()["transits"][2]['aspects'][0])