kerykeion 4.18.3__py3-none-any.whl → 5.1.9__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 (76) hide show
  1. kerykeion/__init__.py +56 -11
  2. kerykeion/aspects/__init__.py +7 -4
  3. kerykeion/aspects/aspects_factory.py +568 -0
  4. kerykeion/aspects/aspects_utils.py +86 -13
  5. kerykeion/astrological_subject_factory.py +1901 -0
  6. kerykeion/backword.py +820 -0
  7. kerykeion/chart_data_factory.py +552 -0
  8. kerykeion/charts/__init__.py +2 -2
  9. kerykeion/charts/chart_drawer.py +2794 -0
  10. kerykeion/charts/charts_utils.py +1066 -309
  11. kerykeion/charts/draw_planets.py +602 -351
  12. kerykeion/charts/templates/aspect_grid_only.xml +337 -193
  13. kerykeion/charts/templates/chart.xml +441 -240
  14. kerykeion/charts/templates/wheel_only.xml +365 -211
  15. kerykeion/charts/themes/black-and-white.css +148 -0
  16. kerykeion/charts/themes/classic.css +107 -76
  17. kerykeion/charts/themes/dark-high-contrast.css +145 -107
  18. kerykeion/charts/themes/dark.css +146 -107
  19. kerykeion/charts/themes/light.css +146 -103
  20. kerykeion/charts/themes/strawberry.css +158 -0
  21. kerykeion/composite_subject_factory.py +408 -0
  22. kerykeion/ephemeris_data_factory.py +443 -0
  23. kerykeion/fetch_geonames.py +81 -21
  24. kerykeion/house_comparison/__init__.py +6 -0
  25. kerykeion/house_comparison/house_comparison_factory.py +103 -0
  26. kerykeion/house_comparison/house_comparison_utils.py +126 -0
  27. kerykeion/kr_types/__init__.py +66 -6
  28. kerykeion/kr_types/chart_template_model.py +20 -0
  29. kerykeion/kr_types/kerykeion_exception.py +15 -9
  30. kerykeion/kr_types/kr_literals.py +14 -106
  31. kerykeion/kr_types/kr_models.py +14 -179
  32. kerykeion/kr_types/settings_models.py +15 -152
  33. kerykeion/planetary_return_factory.py +805 -0
  34. kerykeion/relationship_score_factory.py +301 -0
  35. kerykeion/report.py +750 -65
  36. kerykeion/schemas/__init__.py +106 -0
  37. kerykeion/schemas/chart_template_model.py +367 -0
  38. kerykeion/schemas/kerykeion_exception.py +20 -0
  39. kerykeion/schemas/kr_literals.py +181 -0
  40. kerykeion/schemas/kr_models.py +603 -0
  41. kerykeion/schemas/settings_models.py +188 -0
  42. kerykeion/settings/__init__.py +20 -1
  43. kerykeion/settings/chart_defaults.py +444 -0
  44. kerykeion/settings/config_constants.py +152 -0
  45. kerykeion/settings/kerykeion_settings.py +36 -61
  46. kerykeion/settings/translation_strings.py +1499 -0
  47. kerykeion/settings/translations.py +74 -0
  48. kerykeion/sweph/ast136/s136108s.se1 +0 -0
  49. kerykeion/sweph/ast136/s136199s.se1 +0 -0
  50. kerykeion/sweph/ast136/s136472s.se1 +0 -0
  51. kerykeion/sweph/ast28/se28978s.se1 +0 -0
  52. kerykeion/sweph/ast50/se50000s.se1 +0 -0
  53. kerykeion/sweph/ast90/se90377s.se1 +0 -0
  54. kerykeion/sweph/ast90/se90482s.se1 +0 -0
  55. kerykeion/sweph/sefstars.txt +1602 -0
  56. kerykeion/transits_time_range_factory.py +302 -0
  57. kerykeion/utilities.py +626 -125
  58. kerykeion-5.1.9.dist-info/METADATA +1793 -0
  59. kerykeion-5.1.9.dist-info/RECORD +63 -0
  60. {kerykeion-4.18.3.dist-info → kerykeion-5.1.9.dist-info}/WHEEL +1 -1
  61. kerykeion/aspects/natal_aspects.py +0 -143
  62. kerykeion/aspects/synastry_aspects.py +0 -113
  63. kerykeion/astrological_subject.py +0 -818
  64. kerykeion/charts/kerykeion_chart_svg.py +0 -894
  65. kerykeion/enums.py +0 -51
  66. kerykeion/ephemeris_data.py +0 -178
  67. kerykeion/kr_types/chart_types.py +0 -88
  68. kerykeion/relationship_score/__init__.py +0 -2
  69. kerykeion/relationship_score/relationship_score.py +0 -175
  70. kerykeion/relationship_score/relationship_score_factory.py +0 -275
  71. kerykeion/settings/kr.config.json +0 -721
  72. kerykeion-4.18.3.dist-info/LICENSE +0 -661
  73. kerykeion-4.18.3.dist-info/METADATA +0 -396
  74. kerykeion-4.18.3.dist-info/RECORD +0 -42
  75. kerykeion-4.18.3.dist-info/entry_points.txt +0 -3
  76. /LICENSE → /kerykeion-5.1.9.dist-info/licenses/LICENSE +0 -0
@@ -1,19 +1,19 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  """
3
- This is part of Kerykeion (C) 2024 Giacomo Battaglia
3
+ This is part of Kerykeion (C) 2025 Giacomo Battaglia
4
4
  """
5
5
  # TODO: Better documentation and unit tests
6
6
 
7
- from kerykeion import AstrologicalSubject
8
- from kerykeion.settings import KerykeionSettingsModel
9
7
  from swisseph import difdeg2n
10
8
  from typing import Union
11
- from kerykeion.kr_types.kr_models import AstrologicalSubjectModel
12
- from kerykeion.kr_types.settings_models import KerykeionSettingsCelestialPointModel, KerykeionSettingsAspectModel
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
12
+ from kerykeion.settings.chart_defaults import DEFAULT_CELESTIAL_POINTS_SETTINGS
13
13
 
14
14
 
15
15
  def get_aspect_from_two_points(
16
- aspects_settings: Union[list[KerykeionSettingsAspectModel], list[dict]],
16
+ aspects_settings: Union[list[dict], list[dict]],
17
17
  point_one: Union[float, int],
18
18
  point_two: Union[float, int],
19
19
  ):
@@ -32,6 +32,7 @@ def get_aspect_from_two_points(
32
32
  diff = abs(point_one - point_two)
33
33
 
34
34
  for aid, aspect in enumerate(aspects_settings):
35
+ # TODO: Remove the "degree" element EVERYWHERE!
35
36
  aspect_degree = aspect["degree"] # type: ignore
36
37
  aspect_orb = aspect["orb"] # type: ignore
37
38
 
@@ -44,19 +45,88 @@ def get_aspect_from_two_points(
44
45
  verdict = False
45
46
  name = None
46
47
  aspect_degrees = 0
47
- aid = None # type: ignore
48
48
 
49
49
  return {
50
50
  "verdict": verdict,
51
51
  "name": name,
52
- "orbit": distance - aspect_degrees,
53
- "distance": distance - aspect_degrees,
52
+ "orbit": abs(distance - aspect_degrees),
53
+ "distance": abs(distance - aspect_degrees),
54
54
  "aspect_degrees": aspect_degrees,
55
- "aid": aid,
56
55
  "diff": diff,
57
56
  }
58
57
 
59
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
+
60
130
  def planet_id_decoder(planets_settings: list[KerykeionSettingsCelestialPointModel], name: str) -> int:
61
131
  """
62
132
  Check if the name of the planet is the same in the settings and return
@@ -72,7 +142,10 @@ def planet_id_decoder(planets_settings: list[KerykeionSettingsCelestialPointMode
72
142
 
73
143
 
74
144
  def get_active_points_list(
75
- subject: Union[AstrologicalSubject, AstrologicalSubjectModel], settings: Union[KerykeionSettingsModel, dict]
145
+ subject: Union[AstrologicalSubjectModel, CompositeSubjectModel, PlanetReturnModel],
146
+ active_points: list = [],
147
+ *,
148
+ celestial_points: list[dict] = DEFAULT_CELESTIAL_POINTS_SETTINGS,
76
149
  ) -> list:
77
150
  """
78
151
  Given an astrological subject and the settings, return a list of the active points.
@@ -84,8 +157,8 @@ def get_active_points_list(
84
157
  list: List of the active points.
85
158
  """
86
159
  point_list = []
87
- for planet in settings["celestial_points"]:
88
- if planet["is_active"] == True:
160
+ for planet in celestial_points:
161
+ if planet["name"] in active_points:
89
162
  point_list.append(subject[planet["name"].lower()])
90
163
 
91
164
  return point_list