kerykeion 4.26.1__py3-none-any.whl → 5.0.0a1__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 (50) hide show
  1. kerykeion/__init__.py +8 -5
  2. kerykeion/aspects/aspects_utils.py +14 -8
  3. kerykeion/aspects/natal_aspects.py +26 -17
  4. kerykeion/aspects/synastry_aspects.py +32 -15
  5. kerykeion/aspects/transits_time_range.py +2 -2
  6. kerykeion/astrological_subject_factory.py +1132 -0
  7. kerykeion/charts/charts_utils.py +583 -85
  8. kerykeion/charts/draw_planets.py +9 -8
  9. kerykeion/charts/draw_planets_v2.py +639 -0
  10. kerykeion/charts/kerykeion_chart_svg.py +1289 -592
  11. kerykeion/charts/templates/chart.xml +178 -79
  12. kerykeion/charts/templates/wheel_only.xml +13 -12
  13. kerykeion/charts/themes/classic.css +91 -76
  14. kerykeion/charts/themes/dark-high-contrast.css +129 -107
  15. kerykeion/charts/themes/dark.css +130 -107
  16. kerykeion/charts/themes/light.css +130 -103
  17. kerykeion/charts/themes/strawberry.css +143 -0
  18. kerykeion/composite_subject_factory.py +26 -43
  19. kerykeion/ephemeris_data.py +6 -10
  20. kerykeion/house_comparison/__init__.py +3 -0
  21. kerykeion/house_comparison/house_comparison_factory.py +70 -0
  22. kerykeion/house_comparison/house_comparison_models.py +38 -0
  23. kerykeion/house_comparison/house_comparison_utils.py +98 -0
  24. kerykeion/kr_types/chart_types.py +9 -3
  25. kerykeion/kr_types/kr_literals.py +34 -6
  26. kerykeion/kr_types/kr_models.py +122 -160
  27. kerykeion/kr_types/settings_models.py +107 -143
  28. kerykeion/planetary_return_factory.py +299 -0
  29. kerykeion/relationship_score/relationship_score.py +3 -3
  30. kerykeion/relationship_score/relationship_score_factory.py +9 -12
  31. kerykeion/report.py +4 -4
  32. kerykeion/settings/config_constants.py +35 -6
  33. kerykeion/settings/kerykeion_settings.py +1 -0
  34. kerykeion/settings/kr.config.json +1301 -1255
  35. kerykeion/settings/legacy/__init__.py +0 -0
  36. kerykeion/settings/legacy/legacy_celestial_points_settings.py +299 -0
  37. kerykeion/settings/legacy/legacy_chart_aspects_settings.py +71 -0
  38. kerykeion/settings/legacy/legacy_color_settings.py +42 -0
  39. kerykeion/transits_time_range.py +13 -9
  40. kerykeion/utilities.py +228 -31
  41. {kerykeion-4.26.1.dist-info → kerykeion-5.0.0a1.dist-info}/METADATA +137 -10
  42. kerykeion-5.0.0a1.dist-info/RECORD +56 -0
  43. {kerykeion-4.26.1.dist-info → kerykeion-5.0.0a1.dist-info}/WHEEL +1 -1
  44. kerykeion/.DS_Store +0 -0
  45. kerykeion/astrological_subject.py +0 -841
  46. kerykeion/charts/.DS_Store +0 -0
  47. kerykeion-4.26.1.dist-info/LICENSE +0 -661
  48. kerykeion-4.26.1.dist-info/RECORD +0 -48
  49. /LICENSE → /kerykeion-5.0.0a1.dist-info/LICENSE +0 -0
  50. {kerykeion-4.26.1.dist-info → kerykeion-5.0.0a1.dist-info}/entry_points.txt +0 -0
kerykeion/__init__.py CHANGED
@@ -6,15 +6,18 @@ This is part of Kerykeion (C) 2025 Giacomo Battaglia
6
6
  """
7
7
 
8
8
  # Local
9
- from .astrological_subject import AstrologicalSubject
9
+ from .aspects import SynastryAspects, NatalAspects
10
+ from .astrological_subject_factory import AstrologicalSubjectFactory
10
11
  from .charts.kerykeion_chart_svg import KerykeionChartSVG
12
+ from .composite_subject_factory import CompositeSubjectFactory
13
+ from .enums import Planets, Aspects, Signs
14
+ from .ephemeris_data import EphemerisDataFactory
15
+ from .house_comparison.house_comparison_factory import HouseComparisonFactory
16
+ from .house_comparison.house_comparison_models import HouseComparisonModel
11
17
  from .kr_types import *
18
+ from .planetary_return_factory import PlanetaryReturnFactory, PlanetReturnModel
12
19
  from .relationship_score.relationship_score import RelationshipScore
13
20
  from .relationship_score.relationship_score_factory import RelationshipScoreFactory
14
- from .aspects import SynastryAspects, NatalAspects
15
21
  from .report import Report
16
22
  from .settings import KerykeionSettingsModel, get_settings
17
- from .enums import Planets, Aspects, Signs
18
- from .ephemeris_data import EphemerisDataFactory
19
- from .composite_subject_factory import CompositeSubjectFactory
20
23
  from .transits_time_range import TransitsTimeRangeFactory
@@ -4,17 +4,20 @@
4
4
  """
5
5
  # TODO: Better documentation and unit tests
6
6
 
7
- from kerykeion import AstrologicalSubject
8
7
  from kerykeion.settings import KerykeionSettingsModel
9
8
  from swisseph import difdeg2n
10
- from typing import Union
11
- from kerykeion.kr_types.kr_models import AstrologicalSubjectModel
12
- from kerykeion.kr_types.kr_literals import Planet, AxialCusps
13
- from kerykeion.kr_types.settings_models import KerykeionSettingsCelestialPointModel, KerykeionSettingsAspectModel
9
+ from typing import Union, TYPE_CHECKING
10
+ from kerykeion.kr_types.kr_models import AstrologicalSubjectModel, CompositeSubjectModel, PlanetReturnModel
11
+ from kerykeion.kr_types.kr_literals import AstrologicalPoint
12
+ from kerykeion.kr_types.settings_models import KerykeionSettingsCelestialPointModel
13
+ from kerykeion.settings.legacy.legacy_celestial_points_settings import DEFAULT_CELESTIAL_POINTS_SETTINGS
14
14
 
15
15
 
16
+ if TYPE_CHECKING:
17
+ from kerykeion import AstrologicalSubjectFactory
18
+
16
19
  def get_aspect_from_two_points(
17
- aspects_settings: Union[list[KerykeionSettingsAspectModel], list[dict]],
20
+ aspects_settings: Union[list[dict], list[dict]],
18
21
  point_one: Union[float, int],
19
22
  point_two: Union[float, int],
20
23
  ):
@@ -72,7 +75,10 @@ def planet_id_decoder(planets_settings: list[KerykeionSettingsCelestialPointMode
72
75
 
73
76
 
74
77
  def get_active_points_list(
75
- subject: Union[AstrologicalSubject, AstrologicalSubjectModel], settings: Union[KerykeionSettingsModel, dict], active_points: list = []
78
+ subject: Union[AstrologicalSubjectModel, CompositeSubjectModel, PlanetReturnModel],
79
+ active_points: list = [],
80
+ *,
81
+ celestial_points: list[dict] = DEFAULT_CELESTIAL_POINTS_SETTINGS,
76
82
  ) -> list:
77
83
  """
78
84
  Given an astrological subject and the settings, return a list of the active points.
@@ -84,7 +90,7 @@ def get_active_points_list(
84
90
  list: List of the active points.
85
91
  """
86
92
  point_list = []
87
- for planet in settings["celestial_points"]:
93
+ for planet in celestial_points:
88
94
  if planet["name"] in active_points:
89
95
  point_list.append(subject[planet["name"].lower()])
90
96
 
@@ -3,20 +3,21 @@
3
3
  This is part of Kerykeion (C) 2025 Giacomo Battaglia
4
4
  """
5
5
 
6
- from pathlib import Path
7
- from kerykeion import AstrologicalSubject
8
- from kerykeion.kr_types import CompositeSubjectModel
9
6
  import logging
10
- from typing import Union, List
11
- from kerykeion.settings.kerykeion_settings import get_settings
12
7
  from dataclasses import dataclass, field
13
8
  from functools import cached_property
9
+ from kerykeion.astrological_subject_factory import AstrologicalSubjectFactory
10
+ from kerykeion.settings.kerykeion_settings import get_settings
14
11
  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
16
- from kerykeion.kr_types.kr_literals import AxialCusps, Planet
12
+ from kerykeion.kr_types.kr_models import AstrologicalSubjectModel, AspectModel, ActiveAspect, CompositeSubjectModel, PlanetReturnModel
13
+ from kerykeion.kr_types.kr_literals import AstrologicalPoint
17
14
  from kerykeion.kr_types.settings_models import KerykeionSettingsModel
18
- from kerykeion.settings.config_constants import DEFAULT_ACTIVE_POINTS, DEFAULT_ACTIVE_ASPECTS
19
-
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
20
21
 
21
22
 
22
23
  AXES_LIST = [
@@ -33,18 +34,26 @@ class NatalAspects:
33
34
  Generates an object with all the aspects of a birthcart.
34
35
  """
35
36
 
36
- user: Union[AstrologicalSubject, AstrologicalSubjectModel, CompositeSubjectModel]
37
+ user: Union[AstrologicalSubjectModel, CompositeSubjectModel, PlanetReturnModel]
37
38
  new_settings_file: Union[Path, KerykeionSettingsModel, dict, None] = None
38
- active_points: List[Union[AxialCusps, Planet]] = field(default_factory=lambda: DEFAULT_ACTIVE_POINTS)
39
+ active_points: Optional[List[AstrologicalPoint]] = field(default_factory=lambda: None)
39
40
  active_aspects: List[ActiveAspect] = field(default_factory=lambda: DEFAULT_ACTIVE_ASPECTS)
40
41
 
41
42
  def __post_init__(self):
42
43
  self.settings = get_settings(self.new_settings_file)
43
44
 
44
- self.celestial_points = self.settings.celestial_points
45
- self.aspects_settings = self.settings.aspects
46
- self.axes_orbit_settings = self.settings.general_settings.axes_orbit
47
- self.active_points = self.active_points
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
+
48
57
 
49
58
  @cached_property
50
59
  def all_aspects(self):
@@ -54,7 +63,7 @@ class NatalAspects:
54
63
  without repetitions.
55
64
  """
56
65
 
57
- active_points_list = get_active_points_list(self.user, self.settings, self.active_points)
66
+ active_points_list = get_active_points_list(self.user, self.active_points)
58
67
 
59
68
  # ---> TODO: Clean this up
60
69
  filtered_settings = []
@@ -159,7 +168,7 @@ if __name__ == "__main__":
159
168
 
160
169
  setup_logging(level="debug")
161
170
 
162
- johnny = AstrologicalSubject("Johnny Depp", 1963, 6, 9, 0, 0, "Owensboro", "US")
171
+ johnny = AstrologicalSubjectFactory.from_birth_data("Johnny Depp", 1963, 6, 9, 0, 0, 0, "Owensboro", "US")
163
172
 
164
173
  # All aspects as a list of dictionaries
165
174
  aspects = NatalAspects(johnny)
@@ -3,19 +3,23 @@
3
3
  This is part of Kerykeion (C) 2025 Giacomo Battaglia
4
4
  """
5
5
 
6
- from kerykeion import AstrologicalSubject
7
6
  from pathlib import Path
8
7
  from typing import Union
9
8
  from functools import cached_property
9
+ from typing import TYPE_CHECKING
10
10
 
11
+ from kerykeion.astrological_subject_factory import AstrologicalSubjectFactory
11
12
  from kerykeion.aspects.natal_aspects import NatalAspects
12
13
  from kerykeion.settings.kerykeion_settings import get_settings
13
14
  from kerykeion.aspects.aspects_utils import planet_id_decoder, get_aspect_from_two_points, get_active_points_list
14
- from kerykeion.kr_types.kr_models import AstrologicalSubjectModel, AspectModel, ActiveAspect
15
+ from kerykeion.kr_types.kr_models import AstrologicalSubjectModel, AspectModel, ActiveAspect, CompositeSubjectModel, PlanetReturnModel
15
16
  from kerykeion.kr_types.settings_models import KerykeionSettingsModel
16
- from kerykeion.settings.config_constants import DEFAULT_ACTIVE_POINTS, DEFAULT_ACTIVE_ASPECTS
17
- from kerykeion.kr_types.kr_literals import AxialCusps, Planet
18
- from typing import Union, List
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
19
23
 
20
24
 
21
25
  class SynastryAspects(NatalAspects):
@@ -25,10 +29,10 @@ class SynastryAspects(NatalAspects):
25
29
 
26
30
  def __init__(
27
31
  self,
28
- kr_object_one: Union[AstrologicalSubject, AstrologicalSubjectModel],
29
- kr_object_two: Union[AstrologicalSubject, AstrologicalSubjectModel],
32
+ kr_object_one: Union[AstrologicalSubjectModel, CompositeSubjectModel, PlanetReturnModel],
33
+ kr_object_two: Union[AstrologicalSubjectModel, CompositeSubjectModel, PlanetReturnModel],
30
34
  new_settings_file: Union[Path, KerykeionSettingsModel, dict, None] = None,
31
- active_points: list[Union[AxialCusps, Planet]] = DEFAULT_ACTIVE_POINTS,
35
+ active_points: Optional[list[AstrologicalPoint]] = None,
32
36
  active_aspects: List[ActiveAspect] = DEFAULT_ACTIVE_ASPECTS,
33
37
  ):
34
38
  # Subjects
@@ -39,9 +43,9 @@ class SynastryAspects(NatalAspects):
39
43
  self.new_settings_file = new_settings_file
40
44
  self.settings = get_settings(self.new_settings_file)
41
45
 
42
- self.celestial_points = self.settings.celestial_points
43
- self.aspects_settings = self.settings.aspects
44
- self.axes_orbit_settings = self.settings.general_settings.axes_orbit
46
+ self.celestial_points = DEFAULT_CELESTIAL_POINTS_SETTINGS
47
+ self.aspects_settings = DEFAULT_CHART_ASPECTS_SETTINGS
48
+ self.axes_orbit_settings = DEFAULT_AXIS_ORBIT
45
49
  self.active_points = active_points
46
50
  self.active_aspects = active_aspects
47
51
 
@@ -49,6 +53,19 @@ class SynastryAspects(NatalAspects):
49
53
  self._all_aspects: Union[list, None] = None
50
54
  self._relevant_aspects: Union[list, None] = None
51
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
+
52
69
  @cached_property
53
70
  def all_aspects(self):
54
71
  """
@@ -61,8 +78,8 @@ class SynastryAspects(NatalAspects):
61
78
  return self._all_aspects
62
79
 
63
80
  # Celestial Points Lists
64
- first_active_points_list = get_active_points_list(self.first_user, self.settings, self.active_points)
65
- second_active_points_list = get_active_points_list(self.second_user, self.settings, self.active_points)
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)
66
83
 
67
84
  # ---> TODO: Clean this up
68
85
  filtered_settings = []
@@ -115,8 +132,8 @@ if __name__ == "__main__":
115
132
 
116
133
  setup_logging(level="debug")
117
134
 
118
- john = AstrologicalSubject("John", 1940, 10, 9, 10, 30, "Liverpool", "GB")
119
- yoko = AstrologicalSubject("Yoko", 1933, 2, 18, 10, 30, "Tokyo", "JP")
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")
120
137
 
121
138
  synastry_aspects = SynastryAspects(john, yoko)
122
139
 
@@ -6,8 +6,8 @@ from kerykeion import (
6
6
  )
7
7
 
8
8
  # Create a natal chart for the subject
9
- person = AstrologicalSubject(
10
- "Johnny Depp", 1963, 6, 9, 20, 15, "Owensboro", "US"
9
+ person = AstrologicalSubjectFactory.from_birth_data(
10
+ "Johnny Depp", 1963, 6, 9, 20, 15, 0, "Owensboro", "US"
11
11
  )
12
12
 
13
13
  # Define the time period for transit calculation