kerykeion 4.0.6__py3-none-any.whl → 4.12.3__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.

@@ -0,0 +1,163 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ This is part of Kerykeion (C) 2024 Giacomo Battaglia
4
+ """
5
+
6
+
7
+ from pydantic import Field
8
+ from typing import List
9
+ from kerykeion.kr_types.kr_models import SubscriptableBaseModel
10
+
11
+
12
+ class KerykeionSettingsCelestialPointModel(SubscriptableBaseModel):
13
+ """
14
+ Defines the model for a celestial point data.
15
+ """
16
+
17
+ id: int = Field(title="Celestial Point ID", description="Celestial Point ID according to Pyswisseph")
18
+ name: str = Field(title="Celestial Point Name", description="Celestial Point Name")
19
+ color: str = Field(title="Celestial Point Color", description="Celestial Point Color, used in the chart")
20
+ is_active: bool = Field(title="Celestial Point is Active", description="Indicates if the celestial point is active in the chart")
21
+ element_points: int = Field(title="Celestial Point Element Points", description="Element Points given to the celestial point")
22
+ related_zodiac_signs: List[int] = Field(title="Celestial Point Related Zodiac Signs", description="Zodiac Signs related to the celestial point")
23
+ label: str = Field(title="Celestial Point Label", description="The name of the celestial point in the chart, it can be different from the name")
24
+
25
+
26
+ # Chart Colors Settings
27
+ class KerykeionSettingsChartColorsModel(SubscriptableBaseModel):
28
+ """
29
+ Defines the model for the chart colors.
30
+ """
31
+
32
+ paper_0: str = Field(title="Paper Color 0", description="Paper Color 0")
33
+ paper_1: str = Field(title="Paper Color 1", description="Paper Color 1")
34
+ zodiac_bg_0: str = Field(title="Zodiac Background Color 0", description="Zodiac Background Color 0")
35
+ zodiac_bg_1: str = Field(title="Zodiac Background Color 1", description="Zodiac Background Color 1")
36
+ zodiac_bg_2: str = Field(title="Zodiac Background Color 2", description="Zodiac Background Color 2")
37
+ zodiac_bg_3: str = Field(title="Zodiac Background Color 3", description="Zodiac Background Color 3")
38
+ zodiac_bg_4: str = Field(title="Zodiac Background Color 4", description="Zodiac Background Color 4")
39
+ zodiac_bg_5: str = Field(title="Zodiac Background Color 5", description="Zodiac Background Color 5")
40
+ zodiac_bg_6: str = Field(title="Zodiac Background Color 6", description="Zodiac Background Color 6")
41
+ zodiac_bg_7: str = Field(title="Zodiac Background Color 7", description="Zodiac Background Color 7")
42
+ zodiac_bg_8: str = Field(title="Zodiac Background Color 8", description="Zodiac Background Color 8")
43
+ zodiac_bg_9: str = Field(title="Zodiac Background Color 9", description="Zodiac Background Color 9")
44
+ zodiac_bg_10: str = Field(title="Zodiac Background Color 10", description="Zodiac Background Color 10")
45
+ zodiac_bg_11: str = Field(title="Zodiac Background Color 11", description="Zodiac Background Color 11")
46
+ zodiac_icon_0: str = Field(title="Zodiac Icon Color 0", description="Zodiac Icon Color 0")
47
+ zodiac_icon_1: str = Field(title="Zodiac Icon Color 1", description="Zodiac Icon Color 1")
48
+ zodiac_icon_2: str = Field(title="Zodiac Icon Color 2", description="Zodiac Icon Color 2")
49
+ zodiac_icon_3: str = Field(title="Zodiac Icon Color 3", description="Zodiac Icon Color 3")
50
+ zodiac_icon_4: str = Field(title="Zodiac Icon Color 4", description="Zodiac Icon Color 4")
51
+ zodiac_icon_5: str = Field(title="Zodiac Icon Color 5", description="Zodiac Icon Color 5")
52
+ zodiac_icon_6: str = Field(title="Zodiac Icon Color 6", description="Zodiac Icon Color 6")
53
+ zodiac_icon_7: str = Field(title="Zodiac Icon Color 7", description="Zodiac Icon Color 7")
54
+ zodiac_icon_8: str = Field(title="Zodiac Icon Color 8", description="Zodiac Icon Color 8")
55
+ zodiac_icon_9: str = Field(title="Zodiac Icon Color 9", description="Zodiac Icon Color 9")
56
+ zodiac_icon_10: str = Field(title="Zodiac Icon Color 10", description="Zodiac Icon Color 10")
57
+ zodiac_icon_11: str = Field(title="Zodiac Icon Color 11", description="Zodiac Icon Color 11")
58
+ zodiac_radix_ring_0: str = Field(title="Zodiac Radix Ring Color 0", description="Zodiac Radix Ring Color 0")
59
+ zodiac_radix_ring_1: str = Field(title="Zodiac Radix Ring Color 1", description="Zodiac Radix Ring Color 1")
60
+ zodiac_radix_ring_2: str = Field(title="Zodiac Radix Ring Color 2", description="Zodiac Radix Ring Color 2")
61
+ zodiac_transit_ring_0: str = Field(title="Zodiac Transit Ring Color 0", description="Zodiac Transit Ring Color 0")
62
+ zodiac_transit_ring_1: str = Field(title="Zodiac Transit Ring Color 1", description="Zodiac Transit Ring Color 1")
63
+ zodiac_transit_ring_2: str = Field(title="Zodiac Transit Ring Color 2", description="Zodiac Transit Ring Color 2")
64
+ zodiac_transit_ring_3: str = Field(title="Zodiac Transit Ring Color 3", description="Zodiac Transit Ring Color 3")
65
+ houses_radix_line: str = Field(title="Houses Radix Line Color", description="Houses Radix Line Color")
66
+ houses_transit_line: str = Field(title="Houses Transit Line Color", description="Houses Transit Line Color")
67
+ lunar_phase_0: str = Field(title="Lunar Phase Color 0", description="Lunar Phase Color 0")
68
+ lunar_phase_1: str = Field(title="Lunar Phase Color 1", description="Lunar Phase Color 1")
69
+ lunar_phase_2: str = Field(title="Lunar Phase Color 2", description="Lunar Phase Color 2")
70
+
71
+
72
+ # Aspect Settings
73
+ class KerykeionSettingsAspectModel(SubscriptableBaseModel):
74
+ """
75
+ Defines the model for an aspect.
76
+ """
77
+
78
+ degree: int = Field(title="Aspect Degrees", description="The degree of the aspect")
79
+ name: str = Field(title="Aspect Name", description="The name of the aspect")
80
+ is_active: bool = Field(title="Aspect is Active", description="Is the aspect active?")
81
+ visible_grid: bool = Field(title="Aspect Visible Grid", description="Is the aspect visible in the grid?")
82
+ is_major: bool = Field(title="Aspect is Major", description="Is the aspect major?")
83
+ is_minor: bool = Field(title="Aspect is Minor", description="Is the aspect minor?")
84
+ orb: int = Field(title="Aspect Orb", description="The orb of the aspect")
85
+ color: str = Field(title="Aspect Color", description="The color of the aspect")
86
+
87
+
88
+ # Language Settings
89
+ class KerykeionLanguageCelestialPointModel(SubscriptableBaseModel):
90
+ """
91
+ This class is used to define the labels, show in the chart, for the celestial points.
92
+ It is used to translate the celestial points in the language of the chart.
93
+ """
94
+
95
+ Sun: str = Field(title="Sun", description="The name of the Sun in the chart, in the language")
96
+ Moon: str = Field(title="Moon", description="The name of the Moon in the chart, in the language")
97
+ Mercury: str = Field(title="Mercury", description="The name of Mercury in the chart, in the language")
98
+ Venus: str = Field(title="Venus", description="The name of Venus in the chart, in the language")
99
+ Mars: str = Field(title="Mars", description="The name of Mars in the chart, in the language")
100
+ Jupiter: str = Field(title="Jupiter", description="The name of Jupiter in the chart, in the language")
101
+ Saturn: str = Field(title="Saturn", description="The name of Saturn in the chart, in the language")
102
+ Uranus: str = Field(title="Uranus", description="The name of Uranus in the chart, in the language")
103
+ Neptune: str = Field(title="Neptune", description="The name of Neptune in the chart, in the language")
104
+ Pluto: str = Field(title="Pluto", description="The name of Pluto in the chart, in the language")
105
+ True_Node: str = Field(title="True Node", description="The name of True Node in the chart, in the language")
106
+ Mean_Node: str = Field(title="Mean Node", description="The name of Mean Node in the chart, in the language")
107
+ Chiron: str = Field(title="Chiron", description="The name of Chiron in the chart, in the language")
108
+ Asc: str = Field(title="Ascendant", description="The name of Ascendant in the chart, in the language")
109
+ Mc: str = Field(title="Medium Coeli", description="The name of Medium Coeli in the chart, in the language")
110
+ Dsc: str = Field(title="Descendant", description="The name of Descendant in the chart, in the language")
111
+ Ic: str = Field(title="Imum Coeli", description="The name of Imum Coeli in the chart, in the language")
112
+
113
+
114
+ class KerykeionLanguageModel(SubscriptableBaseModel):
115
+ """
116
+ This model is used to store the language settings for the chart,
117
+ it's used to translate the celestial points and the other labels
118
+ """
119
+
120
+ info: str = Field(title="Info", description="The name of the Info label in the chart, in the language")
121
+ cusp: str = Field(title="Cusp", description="The name of the Cusp label in the chart, in the language")
122
+ longitude: str = Field(title="Longitude", description="The name of the Longitude label in the chart, in the language")
123
+ latitude: str = Field(title="Latitude", description="The name of the Latitude label in the chart, in the language")
124
+ north: str = Field(title="North", description="The name of the North label in the chart, in the language")
125
+ east: str = Field(title="East", description="The name of the East label in the chart, in the language")
126
+ south: str = Field(title="South", description="The name of the South label in the chart, in the language")
127
+ west: str = Field(title="West", description="The name of the West label in the chart, in the language")
128
+ fire: str = Field(title="Fire", description="The name of the Fire label in the chart, in the language")
129
+ earth: str = Field(title="Earth", description="The name of the Earth label in the chart, in the language")
130
+ air: str = Field(title="Air", description="The name of the Air label in the chart, in the language")
131
+ water: str = Field(title="Water", description="The name of the Water label in the chart, in the language")
132
+ and_word: str = Field(title="And", description="The name of the And word in the chart, in the language")
133
+ transits: str = Field(title="Transits", description="The name of the Transits label in the chart, in the language")
134
+ type: str = Field(title="Type", description="The name of the Type label in the chart, in the language")
135
+ aspects: str = Field(title="Aspects", description="The name of the Aspects label in the chart, in the language")
136
+ planets_and_house: str = Field(title="Planets and Houses", description="The name of the Planets and Houses label in the chart, in the language")
137
+ transit_name: str = Field(title="Transit Name", description="The name of the Transit Name label in the chart, in the language")
138
+ lunar_phase: str = Field(title="Lunar Phase", description="The name of the Lunar Phase label in the chart, in the language")
139
+ day: str = Field(title="Day", description="The name of the Day label in the chart, in the language")
140
+ celestial_points: KerykeionLanguageCelestialPointModel
141
+
142
+
143
+ class KerykeionGeneralSettingsModel(SubscriptableBaseModel):
144
+ axes_orbit: int = Field(title="Axes Orbit", description="The orbit of the axes in the chart")
145
+ planet_in_zodiac_extra_points: int = Field(title="Planet in Zodiac Extra Points", description="The extra points of the planet in the zodiac")
146
+ language: str = Field(title="Language", description="The language of the chart")
147
+
148
+ class KerykeionChartSettingsModel(SubscriptableBaseModel):
149
+ basic_chart_viewBox: str = Field(title="Basic Chart ViewBox", description="The viewbox of the basic chart")
150
+ wide_chart_viewBox: str = Field(title="Wide Chart ViewBox", description="The viewbox of the wide chart")
151
+
152
+ # Settings Model
153
+ class KerykeionSettingsModel(SubscriptableBaseModel):
154
+ """
155
+ This class is used to define the global settings for the Kerykeion.
156
+ """
157
+
158
+ chart_colors: KerykeionSettingsChartColorsModel = Field(title="Chart Colors", description="The colors of the chart")
159
+ celestial_points: List[KerykeionSettingsCelestialPointModel] = Field(title="Celestial Points", description="The list of the celestial points of the chart")
160
+ aspects: List[KerykeionSettingsAspectModel] = Field(title="Aspects", description="The list of the aspects of the chart")
161
+ language_settings: dict[str, KerykeionLanguageModel] = Field(title="Language Settings", description="The language settings of the chart")
162
+ general_settings: KerykeionGeneralSettingsModel = Field(title="General Settings", description="The general settings of the chart")
163
+ chart_settings: KerykeionChartSettingsModel = Field(title="Chart Settings", description="The chart settings of the chart")
@@ -1,22 +1,15 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  """
3
- This is part of Kerykeion (C) 2023 Giacomo Battaglia
3
+ This is part of Kerykeion (C) 2024 Giacomo Battaglia
4
4
  """
5
5
 
6
6
  from kerykeion import AstrologicalSubject
7
7
  from kerykeion.aspects.synastry_aspects import SynastryAspects
8
- from logging import basicConfig, getLogger
8
+ import logging
9
9
  from pathlib import Path
10
10
  from typing import Union
11
11
 
12
12
 
13
- logger = getLogger(__name__)
14
- basicConfig(
15
- format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
16
- level="INFO"
17
- )
18
-
19
-
20
13
  class RelationshipScore:
21
14
  """
22
15
  Calculates the relevance of the relationship of the two subjects according to
@@ -59,7 +52,7 @@ class RelationshipScore:
59
52
  self.relevant_default_aspects = []
60
53
  self.__all_synastry_aspects = SynastryAspects(
61
54
  first_subject, second_subject, new_settings_file=new_settings_file
62
- ).get_all_aspects()
55
+ ).all_aspects
63
56
 
64
57
  # Calculates all at initialization
65
58
  self._get_all()
@@ -78,7 +71,7 @@ class RelationshipScore:
78
71
  }
79
72
 
80
73
  def _log_aspect(self, aspect: dict, points: int) -> None:
81
- logger.debug(
74
+ logging.debug(
82
75
  f"{points} Points: {aspect['p1_name']} {aspect['aspect']} {aspect['p2_name']}, rounded orbit: {int(aspect['orbit'])}"
83
76
  )
84
77
 
@@ -87,7 +80,7 @@ class RelationshipScore:
87
80
  5 points if is a destiny sign:
88
81
  """
89
82
  if self.first_subject.sun["quality"] == self.second_subject.sun["quality"]:
90
- logger.debug(
83
+ logging.debug(
91
84
  f'5 points: Destiny sign, {self.first_subject.sun["sign"]} and {self.second_subject.sun["sign"]}'
92
85
  )
93
86
  self.is_destiny_sign = True
@@ -200,7 +193,8 @@ class RelationshipScore:
200
193
 
201
194
 
202
195
  if __name__ == "__main__":
203
- basicConfig(level="DEBUG", force=True)
196
+ from kerykeion.utilities import setup_logging
197
+ setup_logging(level="debug")
204
198
 
205
199
  lui = AstrologicalSubject("John", 1975, 10, 10, 21, 15, "Roma", "IT")
206
200
  lei = AstrologicalSubject("Sarah", 1978, 2, 9, 15, 50, "Roma", "IT")
kerykeion/report.py CHANGED
@@ -83,6 +83,9 @@ class Report:
83
83
 
84
84
 
85
85
  if __name__ == "__main__":
86
+ from kerykeion.utilities import setup_logging
87
+ setup_logging(level="debug")
88
+
86
89
  john = AstrologicalSubject("John", 1975, 10, 10, 21, 15, "Roma", "IT")
87
90
  report = Report(john)
88
91
  report.print_report()
@@ -1 +1 @@
1
- from .kerykeion_settings import KerykeionSettingsModel, get_settings_dict
1
+ from .kerykeion_settings import KerykeionSettingsModel, get_settings
@@ -1,190 +1,17 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  """
3
- This is part of Kerykeion (C) 2023 Giacomo Battaglia
3
+ This is part of Kerykeion (C) 2024 Giacomo Battaglia
4
4
  """
5
5
 
6
6
 
7
7
  from json import load
8
- from logging import getLogger, basicConfig
9
- from pydantic import BaseModel, Field
8
+ import logging
10
9
  from pathlib import Path
11
- from typing import Dict, List, Union
10
+ from typing import Dict, Union
11
+ from kerykeion.kr_types import KerykeionSettingsModel
12
12
 
13
13
 
14
- logger = getLogger(__name__)
15
- basicConfig(format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level="INFO")
16
-
17
-
18
- class CustomBaseModel(BaseModel):
19
- """
20
- Extends the BaseModel class of Pydantic to add some useful methods.
21
- """
22
-
23
- def __init__(self, **data):
24
- super().__init__(**data)
25
-
26
- def __getitem__(self, item):
27
- return getattr(self, item)
28
-
29
- def get(self, item, default=None):
30
- return getattr(self, item, default)
31
-
32
-
33
- class KerykeionSettingsCelestialPointModel(CustomBaseModel):
34
- """
35
- Defines the model for a celestial point data.
36
- """
37
-
38
- id: int = Field(title="Celestial Point ID", description="Celestial Point ID according to Pyswisseph")
39
- name: str = Field(title="Celestial Point Name", description="Celestial Point Name")
40
- color: str = Field(title="Celestial Point Color", description="Celestial Point Color, used in the chart")
41
- is_active: bool = Field(title="Celestial Point is Active", description="Indicates if the celestial point is active in the chart")
42
- element_points: int = Field(title="Celestial Point Element Points", description="Element Points given to the celestial point")
43
- related_zodiac_signs: List[int] = Field(title="Celestial Point Related Zodiac Signs", description="Zodiac Signs related to the celestial point")
44
- label: str = Field(title="Celestial Point Label", description="The name of the celestial point in the chart, it can be different from the name")
45
-
46
-
47
- # Chart Colors Settings
48
- class KerykeionSettingsChartColorsModel(CustomBaseModel):
49
- """
50
- Defines the model for the chart colors.
51
- """
52
-
53
- paper_0: str = Field(title="Paper Color 0", description="Paper Color 0")
54
- paper_1: str = Field(title="Paper Color 1", description="Paper Color 1")
55
- zodiac_bg_0: str = Field(title="Zodiac Background Color 0", description="Zodiac Background Color 0")
56
- zodiac_bg_1: str = Field(title="Zodiac Background Color 1", description="Zodiac Background Color 1")
57
- zodiac_bg_2: str = Field(title="Zodiac Background Color 2", description="Zodiac Background Color 2")
58
- zodiac_bg_3: str = Field(title="Zodiac Background Color 3", description="Zodiac Background Color 3")
59
- zodiac_bg_4: str = Field(title="Zodiac Background Color 4", description="Zodiac Background Color 4")
60
- zodiac_bg_5: str = Field(title="Zodiac Background Color 5", description="Zodiac Background Color 5")
61
- zodiac_bg_6: str = Field(title="Zodiac Background Color 6", description="Zodiac Background Color 6")
62
- zodiac_bg_7: str = Field(title="Zodiac Background Color 7", description="Zodiac Background Color 7")
63
- zodiac_bg_8: str = Field(title="Zodiac Background Color 8", description="Zodiac Background Color 8")
64
- zodiac_bg_9: str = Field(title="Zodiac Background Color 9", description="Zodiac Background Color 9")
65
- zodiac_bg_10: str = Field(title="Zodiac Background Color 10", description="Zodiac Background Color 10")
66
- zodiac_bg_11: str = Field(title="Zodiac Background Color 11", description="Zodiac Background Color 11")
67
- zodiac_icon_0: str = Field(title="Zodiac Icon Color 0", description="Zodiac Icon Color 0")
68
- zodiac_icon_1: str = Field(title="Zodiac Icon Color 1", description="Zodiac Icon Color 1")
69
- zodiac_icon_2: str = Field(title="Zodiac Icon Color 2", description="Zodiac Icon Color 2")
70
- zodiac_icon_3: str = Field(title="Zodiac Icon Color 3", description="Zodiac Icon Color 3")
71
- zodiac_icon_4: str = Field(title="Zodiac Icon Color 4", description="Zodiac Icon Color 4")
72
- zodiac_icon_5: str = Field(title="Zodiac Icon Color 5", description="Zodiac Icon Color 5")
73
- zodiac_icon_6: str = Field(title="Zodiac Icon Color 6", description="Zodiac Icon Color 6")
74
- zodiac_icon_7: str = Field(title="Zodiac Icon Color 7", description="Zodiac Icon Color 7")
75
- zodiac_icon_8: str = Field(title="Zodiac Icon Color 8", description="Zodiac Icon Color 8")
76
- zodiac_icon_9: str = Field(title="Zodiac Icon Color 9", description="Zodiac Icon Color 9")
77
- zodiac_icon_10: str = Field(title="Zodiac Icon Color 10", description="Zodiac Icon Color 10")
78
- zodiac_icon_11: str = Field(title="Zodiac Icon Color 11", description="Zodiac Icon Color 11")
79
- zodiac_radix_ring_0: str = Field(title="Zodiac Radix Ring Color 0", description="Zodiac Radix Ring Color 0")
80
- zodiac_radix_ring_1: str = Field(title="Zodiac Radix Ring Color 1", description="Zodiac Radix Ring Color 1")
81
- zodiac_radix_ring_2: str = Field(title="Zodiac Radix Ring Color 2", description="Zodiac Radix Ring Color 2")
82
- zodiac_transit_ring_0: str = Field(title="Zodiac Transit Ring Color 0", description="Zodiac Transit Ring Color 0")
83
- zodiac_transit_ring_1: str = Field(title="Zodiac Transit Ring Color 1", description="Zodiac Transit Ring Color 1")
84
- zodiac_transit_ring_2: str = Field(title="Zodiac Transit Ring Color 2", description="Zodiac Transit Ring Color 2")
85
- zodiac_transit_ring_3: str = Field(title="Zodiac Transit Ring Color 3", description="Zodiac Transit Ring Color 3")
86
- houses_radix_line: str = Field(title="Houses Radix Line Color", description="Houses Radix Line Color")
87
- houses_transit_line: str = Field(title="Houses Transit Line Color", description="Houses Transit Line Color")
88
- lunar_phase_0: str = Field(title="Lunar Phase Color 0", description="Lunar Phase Color 0")
89
- lunar_phase_1: str = Field(title="Lunar Phase Color 1", description="Lunar Phase Color 1")
90
- lunar_phase_2: str = Field(title="Lunar Phase Color 2", description="Lunar Phase Color 2")
91
-
92
-
93
- # Aspect Settings
94
- class KerykeionSettingsAspectModel(CustomBaseModel):
95
- """
96
- Defines the model for an aspect.
97
- """
98
-
99
- degree: int = Field(title="Aspect Degrees", description="The degree of the aspect")
100
- name: str = Field(title="Aspect Name", description="The name of the aspect")
101
- is_active: bool = Field(title="Aspect is Active", description="Is the aspect active?")
102
- visible_grid: bool = Field(title="Aspect Visible Grid", description="Is the aspect visible in the grid?")
103
- is_major: bool = Field(title="Aspect is Major", description="Is the aspect major?")
104
- is_minor: bool = Field(title="Aspect is Minor", description="Is the aspect minor?")
105
- orb: int = Field(title="Aspect Orb", description="The orb of the aspect")
106
- color: str = Field(title="Aspect Color", description="The color of the aspect")
107
-
108
-
109
- # Language Settings
110
- class KerykeionLanguageCelestialPointModel(CustomBaseModel):
111
- """
112
- This class is used to define the labels, show in the chart, for the celestial points.
113
- It is used to translate the celestial points in the language of the chart.
114
- """
115
-
116
- Sun: str = Field(title="Sun", description="The name of the Sun in the chart, in the language")
117
- Moon: str = Field(title="Moon", description="The name of the Moon in the chart, in the language")
118
- Mercury: str = Field(title="Mercury", description="The name of Mercury in the chart, in the language")
119
- Venus: str = Field(title="Venus", description="The name of Venus in the chart, in the language")
120
- Mars: str = Field(title="Mars", description="The name of Mars in the chart, in the language")
121
- Jupiter: str = Field(title="Jupiter", description="The name of Jupiter in the chart, in the language")
122
- Saturn: str = Field(title="Saturn", description="The name of Saturn in the chart, in the language")
123
- Uranus: str = Field(title="Uranus", description="The name of Uranus in the chart, in the language")
124
- Neptune: str = Field(title="Neptune", description="The name of Neptune in the chart, in the language")
125
- Pluto: str = Field(title="Pluto", description="The name of Pluto in the chart, in the language")
126
- True_Node: str = Field(title="True Node", description="The name of True Node in the chart, in the language")
127
- Mean_Node: str = Field(title="Mean Node", description="The name of Mean Node in the chart, in the language")
128
- Chiron: str = Field(title="Chiron", description="The name of Chiron in the chart, in the language")
129
- Asc: str = Field(title="Ascendant", description="The name of Ascendant in the chart, in the language")
130
- Mc: str = Field(title="Medium Coeli", description="The name of Medium Coeli in the chart, in the language")
131
- Dsc: str = Field(title="Descendant", description="The name of Descendant in the chart, in the language")
132
- Ic: str = Field(title="Imum Coeli", description="The name of Imum Coeli in the chart, in the language")
133
-
134
-
135
- class KerykeionLanguageModel(CustomBaseModel):
136
- """
137
- This model is used to store the language settings for the chart,
138
- it's used to translate the celestial points and the other labels
139
- """
140
-
141
- info: str = Field(title="Info", description="The name of the Info label in the chart, in the language")
142
- cusp: str = Field(title="Cusp", description="The name of the Cusp label in the chart, in the language")
143
- longitude: str = Field(title="Longitude", description="The name of the Longitude label in the chart, in the language")
144
- latitude: str = Field(title="Latitude", description="The name of the Latitude label in the chart, in the language")
145
- north: str = Field(title="North", description="The name of the North label in the chart, in the language")
146
- east: str = Field(title="East", description="The name of the East label in the chart, in the language")
147
- south: str = Field(title="South", description="The name of the South label in the chart, in the language")
148
- west: str = Field(title="West", description="The name of the West label in the chart, in the language")
149
- fire: str = Field(title="Fire", description="The name of the Fire label in the chart, in the language")
150
- earth: str = Field(title="Earth", description="The name of the Earth label in the chart, in the language")
151
- air: str = Field(title="Air", description="The name of the Air label in the chart, in the language")
152
- water: str = Field(title="Water", description="The name of the Water label in the chart, in the language")
153
- and_word: str = Field(title="And", description="The name of the And word in the chart, in the language")
154
- transits: str = Field(title="Transits", description="The name of the Transits label in the chart, in the language")
155
- type: str = Field(title="Type", description="The name of the Type label in the chart, in the language")
156
- aspects: str = Field(title="Aspects", description="The name of the Aspects label in the chart, in the language")
157
- planets_and_house: str = Field(title="Planets and Houses", description="The name of the Planets and Houses label in the chart, in the language")
158
- transit_name: str = Field(title="Transit Name", description="The name of the Transit Name label in the chart, in the language")
159
- lunar_phase: str = Field(title="Lunar Phase", description="The name of the Lunar Phase label in the chart, in the language")
160
- day: str = Field(title="Day", description="The name of the Day label in the chart, in the language")
161
- celestial_points: KerykeionLanguageCelestialPointModel
162
-
163
-
164
- class KerykeionGeneralSettingsModel(CustomBaseModel):
165
- axes_orbit: int = Field(title="Axes Orbit", description="The orbit of the axes in the chart")
166
- planet_in_zodiac_extra_points: int = Field(title="Planet in Zodiac Extra Points", description="The extra points of the planet in the zodiac")
167
- language: str = Field(title="Language", description="The language of the chart")
168
-
169
- class KerykeionChartSettingsModel(CustomBaseModel):
170
- basic_chart_viewBox: str = Field(title="Basic Chart ViewBox", description="The viewbox of the basic chart")
171
- basic_chart_viewBox_width: int = Field(title="Basic Chart ViewBox Width", description="The width of the viewbox of the basic chart")
172
-
173
- # Settings Model
174
- class KerykeionSettingsModel(CustomBaseModel):
175
- """
176
- This class is used to define the global settings for the Kerykeion.
177
- """
178
-
179
- chart_colors: KerykeionSettingsChartColorsModel = Field(title="Chart Colors", description="The colors of the chart")
180
- celestial_points: List[KerykeionSettingsCelestialPointModel] = Field(title="Celestial Points", description="The list of the celestial points of the chart")
181
- aspects: List[KerykeionSettingsAspectModel] = Field(title="Aspects", description="The list of the aspects of the chart")
182
- language_settings: dict[str, KerykeionLanguageModel] = Field(title="Language Settings", description="The language settings of the chart")
183
- general_settings: KerykeionGeneralSettingsModel = Field(title="General Settings", description="The general settings of the chart")
184
- chart_settings: KerykeionChartSettingsModel = Field(title="Chart Settings", description="The chart settings of the chart")
185
-
186
-
187
- def get_settings_dict(new_settings_file: Union[Path, None] = None) -> Dict:
14
+ def get_settings(new_settings_file: Union[Path, None] = None) -> KerykeionSettingsModel:
188
15
  """
189
16
  This function is used to get the settings dict from the settings file.
190
17
  If no settings file is passed as argument, or the file is not found, it will fallback to:
@@ -214,14 +41,14 @@ def get_settings_dict(new_settings_file: Union[Path, None] = None) -> Dict:
214
41
  if not settings_file.exists():
215
42
  settings_file = Path(__file__).parent / "kr.config.json"
216
43
 
217
- logger.debug(f"Kerykeion config file path: {settings_file}")
44
+ logging.debug(f"Kerykeion config file path: {settings_file}")
218
45
  with open(settings_file, "r", encoding="utf8") as f:
219
46
  settings_dict = load(f)
220
47
 
221
- return settings_dict
48
+ return KerykeionSettingsModel(**settings_dict)
222
49
 
223
50
 
224
- def merge_settings_file(settings: KerykeionSettingsModel, new_settings: Dict) -> KerykeionSettingsModel:
51
+ def merge_settings(settings: KerykeionSettingsModel, new_settings: Dict) -> KerykeionSettingsModel:
225
52
  """
226
53
  This function is used to merge the settings file with the default settings,
227
54
  it's useful to add new settings to the config file without breaking the old ones.
@@ -233,9 +60,12 @@ def merge_settings_file(settings: KerykeionSettingsModel, new_settings: Dict) ->
233
60
  Returns:
234
61
  KerykeionSettingsModel: The new settings
235
62
  """
236
- new_settings_dict = settings.dict() | new_settings
63
+ new_settings_dict = settings.model_dump() | new_settings
237
64
  return KerykeionSettingsModel(**new_settings_dict)
238
65
 
239
66
 
240
67
  if __name__ == "__main__":
241
- print(get_settings_dict())
68
+ from kerykeion.utilities import setup_logging
69
+ setup_logging(level="debug")
70
+
71
+ print(get_settings())
@@ -77,7 +77,7 @@
77
77
  "Mc": "Mc",
78
78
  "Dsc": "Dsc",
79
79
  "Ic": "Ic",
80
- "North_Node": "Noeud Nord",
80
+ "True_Node": "Noeud Nord",
81
81
  "Mean_Node": "Noeud Moyen",
82
82
  "Chiron": "Chiron"
83
83
  }
@@ -411,21 +411,21 @@
411
411
  },
412
412
  {
413
413
  "id": 10,
414
- "name": "True_Node",
414
+ "name": "Mean_Node",
415
415
  "color": "#4c1541",
416
- "is_active": true,
417
- "element_points": 20,
416
+ "is_active": false,
417
+ "element_points": 0,
418
418
  "related_zodiac_signs": [],
419
- "label": "True_Node"
419
+ "label": "Mean_Node"
420
420
  },
421
421
  {
422
422
  "id": 11,
423
- "name": "Mean_Node",
423
+ "name": "True_Node",
424
424
  "color": "#4c1541",
425
- "is_active": false,
426
- "element_points": 0,
425
+ "is_active": true,
426
+ "element_points": 20,
427
427
  "related_zodiac_signs": [],
428
- "label": "Mean_Node"
428
+ "label": "True_Node"
429
429
  },
430
430
  {
431
431
  "id": 12,