kerykeion 5.0.0a11__py3-none-any.whl → 5.0.0a12__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.

@@ -1,3 +1,14 @@
1
+ """
2
+ House Comparison Factory Module
3
+
4
+ Provides factory class for house comparison analysis between astrological subjects.
5
+ Enables bidirectional analysis of astrological point placements in house systems.
6
+
7
+ Author: Giacomo Battaglia
8
+ Copyright: (C) 2025 Kerykeion Project
9
+ License: AGPL-3.0
10
+ """
11
+
1
12
  from kerykeion.house_comparison.house_comparison_utils import calculate_points_in_reciprocal_houses
2
13
  from typing import Union
3
14
  from kerykeion.settings.config_constants import DEFAULT_ACTIVE_POINTS
@@ -9,22 +20,26 @@ from kerykeion.kr_types.kr_literals import AstrologicalPoint
9
20
 
10
21
  class HouseComparisonFactory:
11
22
  """
12
- Factory class for creating house comparison analyses between two astrological charts.
23
+ Factory for creating house comparison analyses between two astrological subjects.
13
24
 
14
- This class handles the generation of house comparison data, calculating how planets
15
- from one chart interact with the house system of another chart (and vice versa).
16
- This is useful for synastry analysis and other forms of relationship astrology.
25
+ Analyzes placement of astrological points from one subject within the house system
26
+ of another subject, performing bidirectional analysis for synastry studies and
27
+ subject comparisons. Supports both natal subjects and planetary return subjects.
17
28
 
18
29
  Attributes:
19
- first_subject (AstrologicalSubject): The first person's astrological chart
20
- second_subject (AstrologicalSubject): The second person's astrological chart
30
+ first_subject: First astrological subject (natal or return subject)
31
+ second_subject: Second astrological subject (natal or return subject)
32
+ active_points: List of astrological points to include in analysis
21
33
 
22
34
  Example:
23
- >>> natal_chart = AstrologicalSubjectFactory.from_birth_data("Person A", 1990, 5, 15, 10, 30, "Rome", "IT")
24
- >>> partner_chart = AstrologicalSubjectFactory.from_birth_data("Person B", 1992, 8, 23, 14, 45, "Milan", "IT")
35
+ >>> natal_chart = AstrologicalSubjectFactory.from_birth_data(
36
+ ... "Person A", 1990, 5, 15, 10, 30, "Rome", "IT"
37
+ ... )
38
+ >>> partner_chart = AstrologicalSubjectFactory.from_birth_data(
39
+ ... "Person B", 1992, 8, 23, 14, 45, "Milan", "IT"
40
+ ... )
25
41
  >>> factory = HouseComparisonFactory(natal_chart, partner_chart)
26
42
  >>> comparison = factory.get_house_comparison()
27
- >>> print(comparison.model_dump_json(indent=4))
28
43
 
29
44
  """
30
45
  def __init__(self,
@@ -33,21 +48,39 @@ class HouseComparisonFactory:
33
48
  active_points: list[AstrologicalPoint] = DEFAULT_ACTIVE_POINTS,
34
49
 
35
50
  ):
51
+ """
52
+ Initialize the house comparison factory.
53
+
54
+ Args:
55
+ first_subject: First astrological subject for comparison
56
+ second_subject: Second astrological subject for comparison
57
+ active_points: List of astrological points to include in analysis.
58
+ Defaults to standard active points.
59
+
60
+ Note:
61
+ Both subjects must have valid house system data for accurate analysis.
62
+ """
36
63
  self.first_subject = first_subject
37
64
  self.second_subject = second_subject
38
65
  self.active_points = active_points
39
66
 
40
67
  def get_house_comparison(self) -> "HouseComparisonModel":
41
68
  """
42
- Creates a house comparison model for two astrological subjects.
69
+ Generate bidirectional house comparison analysis between the two subjects.
43
70
 
44
- Args:
45
- chart1: First astrological subject
46
- chart2: Second astrological subject
47
- description: Description of the comparison
71
+ Calculates where each active astrological point from one subject falls within
72
+ the house system of the other subject, and vice versa.
48
73
 
49
74
  Returns:
50
- "HouseComparisonModel": Model containing the comparison data.
75
+ HouseComparisonModel: Model containing:
76
+ - first_subject_name: Name of the first subject
77
+ - second_subject_name: Name of the second subject
78
+ - first_points_in_second_houses: First subject's points in second subject's houses
79
+ - second_points_in_first_houses: Second subject's points in first subject's houses
80
+
81
+ Note:
82
+ Analysis scope is determined by the active_points list. Only specified
83
+ points will be included in the results.
51
84
  """
52
85
  first_points_in_second_houses = calculate_points_in_reciprocal_houses(self.first_subject, self.second_subject, self.active_points)
53
86
  second_points_in_first_houses = calculate_points_in_reciprocal_houses(self.second_subject, self.first_subject, self.active_points)
@@ -1,38 +1,76 @@
1
+ """
2
+ House Comparison Data Models
3
+
4
+ Pydantic models for house comparison analysis results between astrological subjects.
5
+ Structures data output from house comparison calculations.
6
+
7
+ Author: Giacomo Battaglia
8
+ Copyright: (C) 2025 Kerykeion Project
9
+ License: AGPL-3.0
10
+ """
11
+
1
12
  from kerykeion.kr_types import SubscriptableBaseModel
2
13
  from typing import Optional
3
14
 
4
15
 
5
16
  class PointInHouseModel(SubscriptableBaseModel):
6
- """Represents a point from one chart positioned in a house from another chart"""
17
+ """
18
+ Represents an astrological point from one subject positioned within another subject's house.
19
+
20
+ Captures point characteristics and its placement within the target subject's house system
21
+ for house comparison analysis.
22
+
23
+ Attributes:
24
+ point_name: Name of the astrological point
25
+ point_degree: Degree position within its sign
26
+ point_sign: Zodiacal sign containing the point
27
+ point_owner_name: Name of the subject who owns this point
28
+ point_owner_house_number: House number in owner's chart
29
+ point_owner_house_name: House name in owner's chart
30
+ projected_house_number: House number in target subject's chart
31
+ projected_house_name: House name in target subject's chart
32
+ projected_house_owner_name: Name of the target subject
33
+ """
7
34
 
8
35
  point_name: str
9
- """Name of the celestial point"""
36
+ """Name of the astrological point"""
10
37
  point_degree: float
11
- """Degree of the celestial point"""
38
+ """Degree position of the point within its zodiacal sign"""
12
39
  point_sign: str
13
- """Sign of the celestial point"""
40
+ """Zodiacal sign containing the point"""
14
41
  point_owner_name: str
15
- """Name of the owner of the celestial point"""
42
+ """Name of the subject who owns this point"""
16
43
  point_owner_house_number: Optional[int]
17
- """House number of the point of the owner of the celestial point"""
44
+ """House number in owner's chart"""
18
45
  point_owner_house_name: Optional[str]
19
- """House name of the point of the owner of the celestial point"""
46
+ """House name in owner's chart"""
20
47
  projected_house_number: int
21
- """Number of the house where the point is projected"""
48
+ """House number in target subject's chart"""
22
49
  projected_house_name: str
23
- """Name of the house where the point is projected"""
50
+ """House name in target subject's chart"""
24
51
  projected_house_owner_name: str
25
- """Name of the owner of the house where the point is projected"""
52
+ """Name of the target subject"""
26
53
 
27
54
 
28
55
  class HouseComparisonModel(SubscriptableBaseModel):
29
- """Pydantic model for comparing points in houses between two astrological subjects"""
56
+ """
57
+ Bidirectional house comparison analysis between two astrological subjects.
58
+
59
+ Contains results of how astrological points from each subject interact with
60
+ the house system of the other subject.
61
+
62
+ Attributes:
63
+ first_subject_name: Name of the first subject
64
+ second_subject_name: Name of the second subject
65
+ first_points_in_second_houses: First subject's points in second subject's houses
66
+ second_points_in_first_houses: Second subject's points in first subject's houses
67
+ """
30
68
 
31
69
  first_subject_name: str
32
70
  """Name of the first subject"""
33
71
  second_subject_name: str
34
72
  """Name of the second subject"""
35
73
  first_points_in_second_houses: list[PointInHouseModel]
36
- """List of points from the first subject in the houses of the second subject"""
74
+ """First subject's points positioned in second subject's houses"""
37
75
  second_points_in_first_houses: list[PointInHouseModel]
38
- """List of points from the second subject in the houses of the first subject"""
76
+ """Second subject's points positioned in first subject's houses"""
@@ -1,3 +1,15 @@
1
+ """
2
+ House Comparison Utilities
3
+
4
+ Utility functions for calculating house placement relationships between astrological subjects.
5
+ Provides core calculation logic for determining where points from one subject fall within
6
+ another subject's house system.
7
+
8
+ Author: Giacomo Battaglia
9
+ Copyright: (C) 2025 Kerykeion Project
10
+ License: AGPL-3.0
11
+ """
12
+
1
13
  from kerykeion.kr_types.kr_models import AstrologicalSubjectModel, PlanetReturnModel
2
14
  from kerykeion.kr_types.kr_literals import AstrologicalPoint
3
15
  from kerykeion.settings.config_constants import DEFAULT_ACTIVE_POINTS
@@ -12,15 +24,33 @@ def calculate_points_in_reciprocal_houses(
12
24
  active_points: list[AstrologicalPoint] = DEFAULT_ACTIVE_POINTS,
13
25
  ) -> list[PointInHouseModel]:
14
26
  """
15
- Calculates which houses of the house_subject the points of point_subject fall into.
27
+ Calculate house placements of one subject's points within another subject's house system.
28
+
29
+ Analyzes where each astrological point from the point_subject falls within the
30
+ house structure of the house_subject. Creates detailed mapping including both
31
+ the point's original house position and its projected house placement.
16
32
 
17
33
  Args:
18
- point_subject: Subject whose points are being analyzed
19
- house_subject: Subject whose houses are being considered
20
- active_points: Optional list of point names to process. If None, all points are processed.
34
+ point_subject: Subject whose astrological points are being analyzed
35
+ house_subject: Subject whose house system provides the projection framework
36
+ active_points: List of astrological points to include in the analysis.
37
+ Defaults to standard active points configuration.
21
38
 
22
39
  Returns:
23
- List of PointInHouseModel objects
40
+ list[PointInHouseModel]: List of point placement models containing detailed
41
+ information about each point's house relationships,
42
+ including original and projected house positions.
43
+
44
+ Note:
45
+ Only processes points that exist in both the point_subject's active_points
46
+ and the provided active_points list. Points with None values are skipped.
47
+
48
+ Example:
49
+ >>> points_in_houses = calculate_points_in_reciprocal_houses(
50
+ ... natal_chart, partner_chart, [AstrologicalPoint.SUN, AstrologicalPoint.MOON]
51
+ ... )
52
+ >>> sun_placement = points_in_houses[0] # Assuming Sun is first
53
+ >>> print(f"Sun falls in house: {sun_placement.projected_house_name}")
24
54
  """
25
55
  points_in_houses: list[PointInHouseModel] = []
26
56
 
@@ -338,35 +338,52 @@ class TransitMomentModel(SubscriptableBaseModel):
338
338
  aspects: List[AspectModel] = Field(description="List of aspects active at this specific moment.")
339
339
 
340
340
 
341
- class NatalAspectsModel(SubscriptableBaseModel):
341
+ class SingleChartAspectsModel(SubscriptableBaseModel):
342
342
  """
343
- Model representing all aspects in a natal chart.
343
+ Model representing all aspects within a single astrological chart.
344
+
345
+ This model can be used for any type of single chart analysis including:
346
+ - Natal charts
347
+ - Planetary return charts
348
+ - Composite charts
349
+ - Any other single chart type
344
350
 
345
351
  Contains both all calculated aspects and the filtered relevant aspects
346
- for an astrological subject.
352
+ for the astrological subject.
347
353
  """
348
354
  subject: Union["AstrologicalSubjectModel", "CompositeSubjectModel", "PlanetReturnModel"] = Field(description="The astrological subject for which aspects were calculated.")
349
- all_aspects: List[AspectModel] = Field(description="Complete list of all calculated aspects.")
355
+ all_aspects: List[AspectModel] = Field(description="Complete list of all calculated aspects within the chart.")
350
356
  relevant_aspects: List[AspectModel] = Field(description="Filtered list of relevant aspects based on orb settings.")
351
357
  active_points: List[AstrologicalPoint] = Field(description="List of active points used in the calculation.")
352
358
  active_aspects: List["ActiveAspect"] = Field(description="List of active aspects with their orb settings.")
353
359
 
354
360
 
355
- class SynastryAspectsModel(SubscriptableBaseModel):
361
+ class DualChartAspectsModel(SubscriptableBaseModel):
356
362
  """
357
- Model representing all aspects between two astrological subjects.
363
+ Model representing all aspects between two astrological charts.
364
+
365
+ This model can be used for any type of dual chart analysis including:
366
+ - Synastry (relationship compatibility)
367
+ - Transit comparisons
368
+ - Composite vs natal comparisons
369
+ - Any other dual chart comparison
358
370
 
359
- Contains both all calculated synastry aspects and the filtered relevant aspects
360
- between two charts.
371
+ Contains both all calculated aspects and the filtered relevant aspects
372
+ between the two charts.
361
373
  """
362
374
  first_subject: Union["AstrologicalSubjectModel", "CompositeSubjectModel", "PlanetReturnModel"] = Field(description="The first astrological subject.")
363
375
  second_subject: Union["AstrologicalSubjectModel", "CompositeSubjectModel", "PlanetReturnModel"] = Field(description="The second astrological subject.")
364
- all_aspects: List[AspectModel] = Field(description="Complete list of all calculated synastry aspects.")
365
- relevant_aspects: List[AspectModel] = Field(description="Filtered list of relevant synastry aspects based on orb settings.")
376
+ all_aspects: List[AspectModel] = Field(description="Complete list of all calculated aspects between the two charts.")
377
+ relevant_aspects: List[AspectModel] = Field(description="Filtered list of relevant aspects based on orb settings.")
366
378
  active_points: List[AstrologicalPoint] = Field(description="List of active points used in the calculation.")
367
379
  active_aspects: List["ActiveAspect"] = Field(description="List of active aspects with their orb settings.")
368
380
 
369
381
 
382
+ # Legacy aliases for backward compatibility
383
+ NatalAspectsModel = SingleChartAspectsModel
384
+ SynastryAspectsModel = DualChartAspectsModel
385
+
386
+
370
387
  class TransitsTimeRangeModel(SubscriptableBaseModel):
371
388
  """
372
389
  Model representing a collection of transit moments for an astrological subject.
@@ -42,7 +42,7 @@ License: AGPL-3.0
42
42
  """
43
43
 
44
44
  from kerykeion import AstrologicalSubjectFactory
45
- from kerykeion.aspects.synastry_aspects_factory import SynastryAspectsFactory
45
+ from kerykeion.aspects import AspectsFactory
46
46
  import logging
47
47
  from kerykeion.kr_types.kr_models import AstrologicalSubjectModel, RelationshipScoreAspectModel, RelationshipScoreModel
48
48
  from kerykeion.kr_types.kr_literals import RelationshipScoreDescription
@@ -107,7 +107,7 @@ class RelationshipScoreFactory:
107
107
  self.relationship_score_description: RelationshipScoreDescription = "Minimal"
108
108
  self.is_destiny_sign = True
109
109
  self.relationship_score_aspects: list[RelationshipScoreAspectModel] = []
110
- self._synastry_aspects = SynastryAspectsFactory.from_subjects(self.first_subject, self.second_subject).all_aspects
110
+ self._synastry_aspects = AspectsFactory.dual_chart_aspects(self.first_subject, self.second_subject).all_aspects
111
111
 
112
112
  def _evaluate_destiny_sign(self):
113
113
  """