kerykeion 5.0.0a10__py3-none-any.whl → 5.0.0a11__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 CHANGED
@@ -10,8 +10,7 @@ from .aspects import SynastryAspectsFactory, NatalAspectsFactory
10
10
  from .astrological_subject_factory import AstrologicalSubjectFactory
11
11
  from .charts.kerykeion_chart_svg import KerykeionChartSVG
12
12
  from .composite_subject_factory import CompositeSubjectFactory
13
- from .enums import Planets, Aspects, Signs
14
- from .ephemeris_data import EphemerisDataFactory
13
+ from .ephemeris_data_factory import EphemerisDataFactory
15
14
  from .house_comparison.house_comparison_factory import HouseComparisonFactory
16
15
  from .house_comparison.house_comparison_models import HouseComparisonModel
17
16
  from .kr_types import *
@@ -19,7 +18,7 @@ from .planetary_return_factory import PlanetaryReturnFactory, PlanetReturnModel
19
18
  from .relationship_score_factory import RelationshipScoreFactory
20
19
  from .report import Report
21
20
  from .settings import KerykeionSettingsModel, get_settings
22
- from .transits_time_range import TransitsTimeRangeFactory
21
+ from .transits_time_range_factory import TransitsTimeRangeFactory
23
22
 
24
23
  __all__ = [
25
24
  "SynastryAspectsFactory",
@@ -27,9 +26,6 @@ __all__ = [
27
26
  "AstrologicalSubjectFactory",
28
27
  "KerykeionChartSVG",
29
28
  "CompositeSubjectFactory",
30
- "Planets",
31
- "Aspects",
32
- "Signs",
33
29
  "EphemerisDataFactory",
34
30
  "HouseComparisonFactory",
35
31
  "HouseComparisonModel",
@@ -4,14 +4,12 @@
4
4
  """
5
5
 
6
6
  import logging
7
- from pathlib import Path
8
7
  from typing import Union, List, Optional
9
8
 
10
9
  from kerykeion.astrological_subject_factory import AstrologicalSubjectFactory
11
10
  from kerykeion.aspects.aspects_utils import get_aspect_from_two_points, get_active_points_list
12
11
  from kerykeion.kr_types.kr_models import AstrologicalSubjectModel, AspectModel, ActiveAspect, CompositeSubjectModel, PlanetReturnModel, NatalAspectsModel
13
12
  from kerykeion.kr_types.kr_literals import AstrologicalPoint
14
- from kerykeion.kr_types.settings_models import KerykeionSettingsModel
15
13
  from kerykeion.settings.config_constants import DEFAULT_ACTIVE_ASPECTS, DEFAULT_AXIS_ORBIT
16
14
  from kerykeion.settings.legacy.legacy_celestial_points_settings import DEFAULT_CELESTIAL_POINTS_SETTINGS
17
15
  from kerykeion.settings.legacy.legacy_chart_aspects_settings import DEFAULT_CHART_ASPECTS_SETTINGS
@@ -37,7 +35,7 @@ class NatalAspectsFactory:
37
35
  @staticmethod
38
36
  def from_subject(
39
37
  user: Union[AstrologicalSubjectModel, CompositeSubjectModel, PlanetReturnModel],
40
- new_settings_file: Union[Path, KerykeionSettingsModel, dict, None] = None,
38
+ *,
41
39
  active_points: Optional[List[AstrologicalPoint]] = None,
42
40
  active_aspects: Optional[List[ActiveAspect]] = None,
43
41
  ) -> NatalAspectsModel:
@@ -46,7 +44,8 @@ class NatalAspectsFactory:
46
44
 
47
45
  Args:
48
46
  user: The astrological subject for aspect calculation
49
- new_settings_file: Custom settings file or settings model
47
+
48
+ Kwargs:
50
49
  active_points: List of points to include in calculations
51
50
  active_aspects: List of aspects with their orb settings
52
51
 
@@ -4,13 +4,11 @@
4
4
  """
5
5
 
6
6
  import logging
7
- from pathlib import Path
8
7
  from typing import Union, List, Optional
9
8
 
10
9
  from kerykeion.astrological_subject_factory import AstrologicalSubjectFactory
11
10
  from kerykeion.aspects.aspects_utils import get_aspect_from_two_points, get_active_points_list
12
11
  from kerykeion.kr_types.kr_models import AstrologicalSubjectModel, AspectModel, ActiveAspect, CompositeSubjectModel, PlanetReturnModel, SynastryAspectsModel
13
- from kerykeion.kr_types.settings_models import KerykeionSettingsModel
14
12
  from kerykeion.settings.config_constants import DEFAULT_ACTIVE_ASPECTS, DEFAULT_AXIS_ORBIT
15
13
  from kerykeion.settings.legacy.legacy_celestial_points_settings import DEFAULT_CELESTIAL_POINTS_SETTINGS
16
14
  from kerykeion.settings.legacy.legacy_chart_aspects_settings import DEFAULT_CHART_ASPECTS_SETTINGS
@@ -29,32 +27,60 @@ AXES_LIST = [
29
27
 
30
28
  class SynastryAspectsFactory:
31
29
  """
32
- Factory class for creating synastry aspects analysis between two subjects.
33
-
34
- This factory calculates all aspects between two charts and provides both
35
- comprehensive and filtered aspect lists based on orb settings and relevance.
30
+ Factory class for creating synastry aspects analysis between two astrological subjects.
31
+
32
+ This factory calculates all astrological aspects (angular relationships) between
33
+ planets and points in two different charts. It's primarily used for relationship
34
+ compatibility analysis, transit calculations, and comparative astrology.
35
+
36
+ The factory provides both comprehensive aspect lists and filtered relevant aspects
37
+ based on orb settings and chart axes considerations.
38
+
39
+ Key Features:
40
+ - Calculates all aspects between two subjects
41
+ - Filters aspects based on orb thresholds
42
+ - Applies stricter orb limits for chart axes (ASC, MC, DSC, IC)
43
+ - Supports multiple subject types (natal, composite, planetary returns)
44
+
45
+ Example:
46
+ >>> john = AstrologicalSubjectFactory.from_birth_data("John", 1990, 1, 1, 12, 0, "London", "GB")
47
+ >>> jane = AstrologicalSubjectFactory.from_birth_data("Jane", 1992, 6, 15, 14, 30, "Paris", "FR")
48
+ >>> synastry = SynastryAspectsFactory.from_subjects(john, jane)
49
+ >>> print(f"Found {len(synastry.relevant_aspects)} relevant aspects")
36
50
  """
37
51
 
38
52
  @staticmethod
39
53
  def from_subjects(
40
54
  first_subject: Union[AstrologicalSubjectModel, CompositeSubjectModel, PlanetReturnModel],
41
55
  second_subject: Union[AstrologicalSubjectModel, CompositeSubjectModel, PlanetReturnModel],
42
- new_settings_file: Union[Path, KerykeionSettingsModel, dict, None] = None,
56
+ *,
43
57
  active_points: Optional[List[AstrologicalPoint]] = None,
44
58
  active_aspects: Optional[List[ActiveAspect]] = None,
45
59
  ) -> SynastryAspectsModel:
46
60
  """
47
- Create synastry aspects analysis from two existing astrological subjects.
61
+ Create synastry aspects analysis between two astrological subjects.
62
+
63
+ This method calculates all astrological aspects (angular relationships)
64
+ between planets and points in two different birth charts, commonly used
65
+ for relationship compatibility analysis.
48
66
 
49
67
  Args:
50
- first_subject: The first astrological subject
51
- second_subject: The second astrological subject
52
- new_settings_file: Custom settings file or settings model
53
- active_points: List of points to include in calculations
54
- active_aspects: List of aspects with their orb settings
68
+ first_subject: The first astrological subject (person, composite chart, or planetary return)
69
+ second_subject: The second astrological subject to compare with the first
70
+ active_points: Optional list of celestial points to include in calculations.
71
+ If None, uses common points between both subjects.
72
+ active_aspects: Optional list of aspect types with their orb settings.
73
+ If None, uses default aspect configuration.
55
74
 
56
75
  Returns:
57
- SynastryAspectsModel containing all calculated aspects data
76
+ SynastryAspectsModel: Complete model containing all calculated aspects data,
77
+ including both comprehensive and filtered relevant aspects.
78
+
79
+ Example:
80
+ >>> john = AstrologicalSubjectFactory.from_birth_data("John", 1990, 1, 1, 12, 0, "London", "GB")
81
+ >>> jane = AstrologicalSubjectFactory.from_birth_data("Jane", 1992, 6, 15, 14, 30, "Paris", "FR")
82
+ >>> synastry = SynastryAspectsFactory.from_subjects(john, jane)
83
+ >>> print(f"Found {len(synastry.relevant_aspects)} relevant aspects")
58
84
  """
59
85
  # Initialize settings and configurations
60
86
  celestial_points = DEFAULT_CELESTIAL_POINTS_SETTINGS
@@ -97,8 +123,17 @@ class SynastryAspectsFactory:
97
123
  """
98
124
  Create the complete synastry aspects model with all calculations.
99
125
 
126
+ Args:
127
+ first_subject: First astrological subject
128
+ second_subject: Second astrological subject
129
+ active_points_resolved: Resolved list of active celestial points
130
+ active_aspects_resolved: Resolved list of active aspects with orbs
131
+ aspects_settings: Chart aspect configuration settings
132
+ axes_orbit_settings: Orb threshold for chart axes
133
+ celestial_points: Celestial points configuration
134
+
100
135
  Returns:
101
- SynastryAspectsModel containing all aspects data
136
+ SynastryAspectsModel: Complete model containing all aspects data
102
137
  """
103
138
  all_aspects = SynastryAspectsFactory._calculate_all_aspects(
104
139
  first_subject, second_subject, active_points_resolved, active_aspects_resolved,
@@ -127,16 +162,28 @@ class SynastryAspectsFactory:
127
162
  """
128
163
  Calculate all synastry aspects between two subjects.
129
164
 
130
- This method handles all aspect calculations including settings updates
131
- and planet ID resolution in a single comprehensive method.
165
+ This method performs comprehensive aspect calculations between all active points
166
+ of both subjects, applying the specified orb settings and creating detailed
167
+ aspect models with planet IDs and positional information.
168
+
169
+ Args:
170
+ first_subject: First astrological subject
171
+ second_subject: Second astrological subject
172
+ active_points: List of celestial points to include in calculations
173
+ active_aspects: List of aspect types with their orb settings
174
+ aspects_settings: Base aspect configuration settings
175
+ celestial_points: Celestial points configuration with IDs
132
176
 
133
177
  Returns:
134
- List of all calculated AspectModel instances
178
+ List[AspectModel]: Complete list of all calculated aspect instances
135
179
  """
136
180
  # Get active points lists for both subjects
137
181
  first_active_points_list = get_active_points_list(first_subject, active_points)
138
182
  second_active_points_list = get_active_points_list(second_subject, active_points)
139
183
 
184
+ # Create a lookup dictionary for planet IDs to optimize performance
185
+ planet_id_lookup = {planet["name"]: planet["id"] for planet in celestial_points}
186
+
140
187
  # Update aspects settings with active aspects orbs
141
188
  filtered_settings = []
142
189
  for aspect_setting in aspects_settings:
@@ -158,18 +205,12 @@ class SynastryAspectsFactory:
158
205
  )
159
206
 
160
207
  if aspect["verdict"]:
161
- # Get planet IDs directly from celestial points settings
162
- first_planet_id = 0
163
- second_planet_id = 0
164
-
165
208
  first_name = first_active_points_list[first]["name"]
166
209
  second_name = second_active_points_list[second]["name"]
167
-
168
- for planet in celestial_points:
169
- if planet["name"] == first_name:
170
- first_planet_id = planet["id"]
171
- if planet["name"] == second_name:
172
- second_planet_id = planet["id"]
210
+
211
+ # Get planet IDs using lookup dictionary for better performance
212
+ first_planet_id = planet_id_lookup.get(first_name, 0)
213
+ second_planet_id = planet_id_lookup.get(second_name, 0)
173
214
 
174
215
  aspect_model = AspectModel(
175
216
  p1_name=first_name,