kerykeion 5.0.0a11__py3-none-any.whl → 5.0.0b1__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 (56) hide show
  1. kerykeion/__init__.py +32 -9
  2. kerykeion/aspects/__init__.py +2 -4
  3. kerykeion/aspects/aspects_factory.py +530 -0
  4. kerykeion/aspects/aspects_utils.py +75 -6
  5. kerykeion/astrological_subject_factory.py +380 -229
  6. kerykeion/backword.py +680 -0
  7. kerykeion/chart_data_factory.py +484 -0
  8. kerykeion/charts/{kerykeion_chart_svg.py → chart_drawer.py} +612 -439
  9. kerykeion/charts/charts_utils.py +135 -94
  10. kerykeion/charts/draw_planets.py +38 -28
  11. kerykeion/charts/templates/aspect_grid_only.xml +188 -17
  12. kerykeion/charts/templates/chart.xml +104 -28
  13. kerykeion/charts/templates/wheel_only.xml +195 -24
  14. kerykeion/charts/themes/classic.css +11 -0
  15. kerykeion/charts/themes/dark-high-contrast.css +11 -0
  16. kerykeion/charts/themes/dark.css +11 -0
  17. kerykeion/charts/themes/light.css +11 -0
  18. kerykeion/charts/themes/strawberry.css +10 -0
  19. kerykeion/composite_subject_factory.py +4 -4
  20. kerykeion/ephemeris_data_factory.py +12 -9
  21. kerykeion/house_comparison/__init__.py +0 -3
  22. kerykeion/house_comparison/house_comparison_factory.py +51 -18
  23. kerykeion/house_comparison/house_comparison_utils.py +37 -8
  24. kerykeion/planetary_return_factory.py +8 -4
  25. kerykeion/relationship_score_factory.py +5 -5
  26. kerykeion/report.py +748 -67
  27. kerykeion/{kr_types → schemas}/__init__.py +44 -4
  28. kerykeion/schemas/chart_template_model.py +340 -0
  29. kerykeion/{kr_types → schemas}/kr_literals.py +7 -3
  30. kerykeion/{kr_types → schemas}/kr_models.py +247 -21
  31. kerykeion/{kr_types → schemas}/settings_models.py +7 -7
  32. kerykeion/settings/config_constants.py +75 -8
  33. kerykeion/settings/kerykeion_settings.py +1 -1
  34. kerykeion/settings/kr.config.json +130 -40
  35. kerykeion/settings/legacy/legacy_celestial_points_settings.py +8 -8
  36. kerykeion/sweph/ast136/s136108s.se1 +0 -0
  37. kerykeion/sweph/ast136/s136199s.se1 +0 -0
  38. kerykeion/sweph/ast136/s136472s.se1 +0 -0
  39. kerykeion/sweph/ast28/se28978s.se1 +0 -0
  40. kerykeion/sweph/ast50/se50000s.se1 +0 -0
  41. kerykeion/sweph/ast90/se90377s.se1 +0 -0
  42. kerykeion/sweph/ast90/se90482s.se1 +0 -0
  43. kerykeion/sweph/sefstars.txt +1602 -0
  44. kerykeion/transits_time_range_factory.py +11 -11
  45. kerykeion/utilities.py +61 -38
  46. kerykeion-5.0.0b1.dist-info/METADATA +1055 -0
  47. kerykeion-5.0.0b1.dist-info/RECORD +58 -0
  48. kerykeion/aspects/natal_aspects_factory.py +0 -235
  49. kerykeion/aspects/synastry_aspects_factory.py +0 -275
  50. kerykeion/house_comparison/house_comparison_models.py +0 -38
  51. kerykeion/kr_types/chart_types.py +0 -106
  52. kerykeion-5.0.0a11.dist-info/METADATA +0 -641
  53. kerykeion-5.0.0a11.dist-info/RECORD +0 -50
  54. /kerykeion/{kr_types → schemas}/kerykeion_exception.py +0 -0
  55. {kerykeion-5.0.0a11.dist-info → kerykeion-5.0.0b1.dist-info}/WHEEL +0 -0
  56. {kerykeion-5.0.0a11.dist-info → kerykeion-5.0.0b1.dist-info}/licenses/LICENSE +0 -0
@@ -5,15 +5,13 @@
5
5
  # TODO: Better documentation and unit tests
6
6
 
7
7
  from swisseph import difdeg2n
8
- from typing import Union, TYPE_CHECKING
9
- from kerykeion.kr_types.kr_models import AstrologicalSubjectModel, CompositeSubjectModel, PlanetReturnModel
10
- from kerykeion.kr_types.settings_models import KerykeionSettingsCelestialPointModel
8
+ from typing import Union
9
+ from kerykeion.schemas.kr_models import AstrologicalSubjectModel, CompositeSubjectModel, PlanetReturnModel
10
+ from kerykeion.schemas.kr_literals import AspectMovementType
11
+ from kerykeion.schemas.settings_models import KerykeionSettingsCelestialPointModel
11
12
  from kerykeion.settings.legacy.legacy_celestial_points_settings import DEFAULT_CELESTIAL_POINTS_SETTINGS
12
13
 
13
14
 
14
- if TYPE_CHECKING:
15
- pass
16
-
17
15
  def get_aspect_from_two_points(
18
16
  aspects_settings: Union[list[dict], list[dict]],
19
17
  point_one: Union[float, int],
@@ -58,6 +56,77 @@ def get_aspect_from_two_points(
58
56
  }
59
57
 
60
58
 
59
+ def calculate_aspect_movement(
60
+ point_one_abs_pos: float,
61
+ point_two_abs_pos: float,
62
+ aspect_degrees: int,
63
+ exact_orb_threshold: float = 0.05
64
+ ) -> AspectMovementType:
65
+ """
66
+ Calculate whether an aspect is applying, separating, or exact.
67
+
68
+ An aspect is:
69
+ - "Exact": When the orb is very tight (default < 0.17°)
70
+ - "Applying": When the faster planet is moving toward the exact aspect
71
+ - "Separating": When the faster planet is moving away from the exact aspect
72
+
73
+ For simplicity, we assume the first planet (p1) is faster than the second (p2).
74
+ This is generally true for:
75
+ - Moon vs outer planets
76
+ - Inner planets vs outer planets
77
+ - Transits (transiting planet vs natal planet)
78
+
79
+ Args:
80
+ point_one_abs_pos: Absolute position of first point (0-360°)
81
+ point_two_abs_pos: Absolute position of second point (0-360°)
82
+ aspect_degrees: The exact degree of the aspect (0, 60, 90, 120, 180, etc.)
83
+ exact_orb_threshold: Maximum orb to consider aspect "exact" (default 0.17°)
84
+
85
+ Returns:
86
+ "Applying", "Separating", or "Exact"
87
+
88
+ Example:
89
+ >>> # Moon at 45° applying to Sun at 50° (conjunction at 0°/360°)
90
+ >>> calculate_aspect_movement(45, 50, 0)
91
+ 'Applying'
92
+ >>> # Moon at 55° separating from Sun at 50° (conjunction)
93
+ >>> calculate_aspect_movement(55, 50, 0)
94
+ 'Separating'
95
+ """
96
+
97
+ # Calculate the angular distance
98
+ distance = abs(difdeg2n(point_one_abs_pos, point_two_abs_pos))
99
+ orbit = abs(distance - aspect_degrees)
100
+
101
+ # Check if aspect is exact (within tight orb)
102
+ if orbit <= exact_orb_threshold:
103
+ return "Exact"
104
+
105
+ # Calculate if p1 is ahead or behind p2 relative to the aspect
106
+ # We need to determine the direction of movement
107
+ diff = difdeg2n(point_one_abs_pos, point_two_abs_pos)
108
+
109
+ # For conjunction (0°) or opposition (180°)
110
+ if aspect_degrees == 0 or aspect_degrees == 360:
111
+ # If p1 is behind p2 (negative diff), it's applying
112
+ # If p1 is ahead of p2 (positive diff), it's separating
113
+ return "Applying" if diff < 0 else "Separating"
114
+
115
+ elif aspect_degrees == 180:
116
+ # For opposition, the logic is reversed
117
+ return "Applying" if abs(diff) < 180 else "Separating"
118
+
119
+ else:
120
+ # For other aspects (60°, 90°, 120°, 150°)
121
+ # Check if the distance is increasing or decreasing
122
+ # If distance < aspect_degrees and diff < 0: applying
123
+ # If distance > aspect_degrees or diff > 0: separating
124
+ if abs(diff) < aspect_degrees:
125
+ return "Applying" if diff < 0 else "Separating"
126
+ else:
127
+ return "Separating" if diff > 0 else "Applying"
128
+
129
+
61
130
  def planet_id_decoder(planets_settings: list[KerykeionSettingsCelestialPointModel], name: str) -> int:
62
131
  """
63
132
  Check if the name of the planet is the same in the settings and return