kerykeion 4.0.3__py3-none-any.whl → 4.8.1__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,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,186 +1,30 @@
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):
14
+ def get_settings(new_settings_file: Union[Path, None] = None) -> KerykeionSettingsModel:
19
15
  """
20
- Extends the BaseModel class of Pydantic to add some useful methods.
16
+ This function is used to get the settings dict from the settings file.
17
+ If no settings file is passed as argument, or the file is not found, it will fallback to:
18
+ - The system wide config file, located in ~/.config/kerykeion/kr.config.json
19
+ - The default config file, located in the package folder
20
+
21
+ Args:
22
+ new_settings_file (Union[Path, None], optional): The path of the settings file. Defaults to None.
23
+
24
+ Returns:
25
+ Dict: The settings dict
21
26
  """
22
27
 
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
-
170
- # Settings Model
171
- class KerykeionSettingsModel(CustomBaseModel):
172
- """
173
- This class is used to define the global settings for the Kerykeion.
174
- """
175
-
176
- chart_colors: KerykeionSettingsChartColorsModel = Field(title="Chart Colors", description="The colors of the chart")
177
- celestial_points: List[KerykeionSettingsCelestialPointModel] = Field(title="Celestial Points", description="The list of the celestial points of the chart")
178
- aspects: List[KerykeionSettingsAspectModel] = Field(title="Aspects", description="The list of the aspects of the chart")
179
- language_settings: dict[str, KerykeionLanguageModel] = Field(title="Language Settings", description="The language settings of the chart")
180
- general_settings: KerykeionGeneralSettingsModel = Field(title="General Settings", description="The general settings of the chart")
181
-
182
-
183
- def get_settings_dict(new_settings_file: Union[Path, None] = None) -> Dict:
184
28
  # Config path we passed as argument
185
29
  if new_settings_file is not None:
186
30
  settings_file = new_settings_file
@@ -197,17 +41,31 @@ def get_settings_dict(new_settings_file: Union[Path, None] = None) -> Dict:
197
41
  if not settings_file.exists():
198
42
  settings_file = Path(__file__).parent / "kr.config.json"
199
43
 
200
- logger.debug(f"Kerykeion config file path: {settings_file}")
201
- with open(settings_file, "r") as f:
44
+ logging.debug(f"Kerykeion config file path: {settings_file}")
45
+ with open(settings_file, "r", encoding="utf8") as f:
202
46
  settings_dict = load(f)
203
47
 
204
- return settings_dict
48
+ return KerykeionSettingsModel(**settings_dict)
205
49
 
206
50
 
207
- def merge_settings_file(settings: KerykeionSettingsModel, new_settings: Dict) -> KerykeionSettingsModel:
208
- new_settings_dict = settings.dict() | new_settings
51
+ def merge_settings(settings: KerykeionSettingsModel, new_settings: Dict) -> KerykeionSettingsModel:
52
+ """
53
+ This function is used to merge the settings file with the default settings,
54
+ it's useful to add new settings to the config file without breaking the old ones.
55
+
56
+ Args:
57
+ settings (KerykeionSettingsModel): The default settings
58
+ new_settings (Dict): The new settings to add to the default ones
59
+
60
+ Returns:
61
+ KerykeionSettingsModel: The new settings
62
+ """
63
+ new_settings_dict = settings.model_dump() | new_settings
209
64
  return KerykeionSettingsModel(**new_settings_dict)
210
65
 
211
66
 
212
67
  if __name__ == "__main__":
213
- 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,
@@ -517,5 +517,9 @@
517
517
  "axes_orbit": 1,
518
518
  "planet_in_zodiac_extra_points": 10,
519
519
  "language": "EN"
520
+ },
521
+ "chart_settings": {
522
+ "basic_chart_viewBox": "0 0 772.2 546.0",
523
+ "wide_chart_viewBox": "0 0 1060 546.0"
520
524
  }
521
525
  }
kerykeion/utilities.py CHANGED
@@ -1,9 +1,9 @@
1
- from kerykeion.kr_types import KerykeionPointModel, KerykeionException
2
- from pathlib import Path
1
+ from kerykeion.kr_types import KerykeionPointModel, KerykeionException, KerykeionSettingsModel, AstrologicalSubjectModel
2
+ from kerykeion.kr_types.kr_literals import LunarPhaseEmoji, LunarPhaseName
3
3
  from typing import Union, Literal
4
- from logging import getLogger
4
+ import logging
5
+ import math
5
6
 
6
- logger = getLogger(__name__)
7
7
 
8
8
 
9
9
  def get_number_from_name(name: str) -> int:
@@ -206,3 +206,152 @@ def calculate_position(
206
206
 
207
207
  return KerykeionPointModel(**dictionary)
208
208
 
209
+
210
+ def setup_logging(level: str) -> None:
211
+ """
212
+ Setup logging for testing.
213
+
214
+ Args:
215
+ level: Log level as a string, options: debug, info, warning, error
216
+ """
217
+ logopt: dict[str, int] = {
218
+ "debug": logging.DEBUG,
219
+ "info": logging.INFO,
220
+ "warning": logging.WARNING,
221
+ "error": logging.ERROR,
222
+ }
223
+ format: str = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
224
+ loglevel: int = logopt.get(level, logging.INFO)
225
+ logging.basicConfig(format=format, level=loglevel)
226
+
227
+ def check_if_point_between(
228
+ start_point: Union[int, float], end_point: Union[int, float], evaluated_point: Union[int, float]
229
+ ) -> bool:
230
+ """
231
+ Finds if a point is between two other in a circle.
232
+
233
+ Args:
234
+ - start_point: The first point
235
+ - end_point: The second point
236
+ - point: The point to check if it is between start_point and end_point
237
+
238
+ Returns:
239
+ - True if point is between start_point and end_point, False otherwise
240
+ """
241
+
242
+ p1_p2 = math.fmod(end_point - start_point + 360, 360)
243
+ p1_p3 = math.fmod(evaluated_point - start_point + 360, 360)
244
+
245
+ if (p1_p2 <= 180) != (p1_p3 > p1_p2):
246
+ return True
247
+ else:
248
+ return False
249
+
250
+
251
+ def get_planet_house(planet_position_degree: Union[int, float], houses_degree_ut_list: list) -> str:
252
+ """
253
+ Returns the house in which a planet is located.
254
+
255
+ Args:
256
+ - planet_position_degree: The position of the planet in degrees
257
+ - houses_degree_ut_list: A list of the houses in degrees (0-360)
258
+
259
+ Returns:
260
+ - The house in which the planet is located
261
+ """
262
+
263
+ house = None
264
+ if check_if_point_between(houses_degree_ut_list[0], houses_degree_ut_list[1], planet_position_degree) == True:
265
+ house = "First_House"
266
+ elif check_if_point_between(houses_degree_ut_list[1], houses_degree_ut_list[2], planet_position_degree) == True:
267
+ house = "Second_House"
268
+ elif check_if_point_between(houses_degree_ut_list[2], houses_degree_ut_list[3], planet_position_degree) == True:
269
+ house = "Third_House"
270
+ elif check_if_point_between(houses_degree_ut_list[3], houses_degree_ut_list[4], planet_position_degree) == True:
271
+ house = "Fourth_House"
272
+ elif check_if_point_between(houses_degree_ut_list[4], houses_degree_ut_list[5], planet_position_degree) == True:
273
+ house = "Fifth_House"
274
+ elif check_if_point_between(houses_degree_ut_list[5], houses_degree_ut_list[6], planet_position_degree) == True:
275
+ house = "Sixth_House"
276
+ elif check_if_point_between(houses_degree_ut_list[6], houses_degree_ut_list[7], planet_position_degree) == True:
277
+ house = "Seventh_House"
278
+ elif check_if_point_between(houses_degree_ut_list[7], houses_degree_ut_list[8], planet_position_degree) == True:
279
+ house = "Eighth_House"
280
+ elif check_if_point_between(houses_degree_ut_list[8], houses_degree_ut_list[9], planet_position_degree) == True:
281
+ house = "Ninth_House"
282
+ elif check_if_point_between(houses_degree_ut_list[9], houses_degree_ut_list[10], planet_position_degree) == True:
283
+ house = "Tenth_House"
284
+ elif check_if_point_between(houses_degree_ut_list[10], houses_degree_ut_list[11], planet_position_degree) == True:
285
+ house = "Eleventh_House"
286
+ elif check_if_point_between(houses_degree_ut_list[11], houses_degree_ut_list[0], planet_position_degree) == True:
287
+ house = "Twelfth_House"
288
+ else:
289
+ raise ValueError("Error in house calculation, planet: ", planet_position_degree)
290
+
291
+ return house
292
+
293
+ def get_moon_emoji_from_phase_int(phase: int) -> LunarPhaseEmoji:
294
+ """
295
+ Returns the emoji of the moon phase.
296
+
297
+ Args:
298
+ - phase: The phase of the moon (0-28)
299
+
300
+ Returns:
301
+ - The emoji of the moon phase
302
+ """
303
+
304
+ if phase == 1:
305
+ result = "🌑"
306
+ elif phase < 7:
307
+ result = "🌒"
308
+ elif 7 <= phase <= 9:
309
+ result = "🌓"
310
+ elif phase < 14:
311
+ result = "🌔"
312
+ elif phase == 14:
313
+ result = "🌕"
314
+ elif phase < 20:
315
+ result = "🌖"
316
+ elif 20 <= phase <= 22:
317
+ result = "🌗"
318
+ elif phase <= 28:
319
+ result = "🌘"
320
+
321
+ else:
322
+ raise KerykeionException(f"Error in moon emoji calculation! Phase: {phase}")
323
+
324
+ return result
325
+
326
+ def get_moon_phase_name_from_phase_int(phase: int) -> LunarPhaseName:
327
+ """
328
+ Returns the name of the moon phase.
329
+
330
+ Args:
331
+ - phase: The phase of the moon (0-28)
332
+
333
+ Returns:
334
+ - The name of the moon phase
335
+ """
336
+
337
+ if phase == 1:
338
+ result = "New Moon"
339
+ elif phase < 7:
340
+ result = "Waxing Crescent"
341
+ elif 7 <= phase <= 9:
342
+ result = "First Quarter"
343
+ elif phase < 14:
344
+ result = "Waxing Gibbous"
345
+ elif phase == 14:
346
+ result = "Full Moon"
347
+ elif phase < 20:
348
+ result = "Waning Gibbous"
349
+ elif 20 <= phase <= 22:
350
+ result = "Last Quarter"
351
+ elif phase <= 28:
352
+ result = "Waning Crescent"
353
+
354
+ else:
355
+ raise KerykeionException(f"Error in moon name calculation! Phase: {phase}")
356
+
357
+ return result
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kerykeion
3
- Version: 4.0.3
3
+ Version: 4.8.1
4
4
  Summary: A python library for astrology.
5
5
  Home-page: https://github.com/g-battaglia/kerykeion
6
6
  License: AGPL-3.0
@@ -18,17 +18,19 @@ Classifier: Programming Language :: Python :: 3
18
18
  Classifier: Programming Language :: Python :: 3.9
19
19
  Classifier: Programming Language :: Python :: 3.10
20
20
  Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
21
22
  Classifier: Programming Language :: Python :: 3 :: Only
22
23
  Classifier: Topic :: Scientific/Engineering :: Astronomy
23
24
  Classifier: Topic :: Software Development
24
25
  Classifier: Topic :: Software Development :: Libraries
25
26
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
26
27
  Classifier: Typing :: Typed
27
- Requires-Dist: pydantic (>=1.10.4,<2.0.0)
28
+ Requires-Dist: pydantic (>=2.5,<3.0)
28
29
  Requires-Dist: pyswisseph (>=2.10.3.1,<3.0.0.0)
29
30
  Requires-Dist: pytz (>=2022.7,<2023.0)
30
31
  Requires-Dist: requests (>=2.28.1,<3.0.0)
31
32
  Requires-Dist: requests-cache (>=0.9.7,<0.10.0)
33
+ Requires-Dist: scour (>=0.38.2,<0.39.0)
32
34
  Requires-Dist: terminaltables (>=3.1.10,<4.0.0)
33
35
  Project-URL: Repository, https://github.com/g-battaglia/kerykeion
34
36
  Description-Content-Type: text/markdown
@@ -63,7 +65,10 @@ also it can calculate the aspects of a single persone or between two, you can se
63
65
  need in the settings in the utility module.
64
66
  It also can generate an SVG of a birthchart, a synastry chart or a transit chart.
65
67
 
68
+ The core goal of this project is to provide a simple and easy approach to astrology in a data driven way.
69
+
66
70
  Here's an example of a birthchart:
71
+
67
72
  ![Kanye Birth Chart](http://centuryboy.altervista.org/KanyeNatalChart.svg)
68
73
 
69
74
  ## Web API
@@ -254,3 +259,12 @@ You can clone this repository or download a zip file using the right side button
254
259
 
255
260
  Feel free to contribute to the code!
256
261
 
262
+ ## License
263
+
264
+ This project is licensed under the AGPL-3.0 License.
265
+ To understand how this impacts your use of the software, please see the [LICENSE](LICENSE) file for details.
266
+ If you have questions, you can reach out to me at my [email](mailto:battaglia.giacomo@yahoo.it?subject=Kerykeion) address.
267
+ As a rule of thumb, if you are using this library in a project, you should open source the code of the project with a compatible license.
268
+
269
+ You can implement the logic of kerkeion in your project and also keep it closed source by using a third party API, like the [AstrologerAPI](https://rapidapi.com/gbattaglia/api/astrologer/). The AstrologerAPI is AGPL-3.0 compliant. Subscribing to the API is also, currently, the best way to support the project.
270
+
@@ -0,0 +1,32 @@
1
+ LICENSE,sha256=UTLH8EdbAsgQei4PA2PnBCPGLSZkq5J-dhkyJuXgWQU,34273
2
+ kerykeion/__init__.py,sha256=Z2-gAp09RAl2_WwzPO-OTc4ZRDLh54kTduAoy891gQc,3917
3
+ kerykeion/aspects/__init__.py,sha256=9FlDVI1ndCJga0-chNIhcLitjU_x3kbtAFfFqVp2ejc,293
4
+ kerykeion/aspects/aspects_utils.py,sha256=Rdo3ITDSU80n6U7aazpzzK4ruv7Iui2PaI3zMGqu1NQ,5832
5
+ kerykeion/aspects/natal_aspects.py,sha256=m3_v1dM6YXvENZ6iN_EJkikKxySZBeR5QKhGsaChERk,4507
6
+ kerykeion/aspects/synastry_aspects.py,sha256=uwg7Lc7wKnpxW9ydOdBHqx9cvO_t0ydGfIGluBIDD7c,3993
7
+ kerykeion/astrological_subject.py,sha256=Z9QUNqX6mrOm4ihxmhH0hiMv6ilp_-0HCQ4u_feE73g,22956
8
+ kerykeion/charts/__init__.py,sha256=Juxkduy2TaagWblh_7CE8Acrg3dHL27-WEddJhau_eQ,127
9
+ kerykeion/charts/charts_utils.py,sha256=45Ee0Hj5nb30q97ggYTQEShxkbCPq65gI0-sE32UxDM,15112
10
+ kerykeion/charts/kerykeion_chart_svg.py,sha256=vtTYgwXELnZoPKvySpEQRLZSaYVzzpDQBcUk9DwnQjw,60764
11
+ kerykeion/charts/templates/chart.xml,sha256=njaX-1vglR7PFInmteCNHcxwMTjsMJPkW56TlJq0qxw,70158
12
+ kerykeion/enums.py,sha256=Ben9GLYkPucpYY2ZDpURzUbNCc9jzK2MuaffkgiXFdQ,965
13
+ kerykeion/fetch_geonames.py,sha256=ZWB1DbcH54ab3fQhzPhLY0Dz0OaPJqiHFn2e7DRr1MM,4588
14
+ kerykeion/kr_types/__init__.py,sha256=-qhGQikurdoHnGtuT1bsaEeZ-IwmZtIHMjGOPC9_oqQ,295
15
+ kerykeion/kr_types/chart_types.py,sha256=g9z53FTOsb2rusUG8nK4dtFgvVa6RCwAfAbrxFb9KaM,2180
16
+ kerykeion/kr_types/kerykeion_exception.py,sha256=G-7VFta78qBt10l54JZWvwH-3lUNKmDwuILXaVGVu9A,314
17
+ kerykeion/kr_types/kr_literals.py,sha256=Kc7LfdeTqHi5uDGoQHWsB81GTBc5E-fGxTJqWKK1FFU,1267
18
+ kerykeion/kr_types/kr_models.py,sha256=3gyT4z-J9EM6p5175HKJX9q9WVWQTDt5Y_m3m8lZu9s,4260
19
+ kerykeion/kr_types/settings_models.py,sha256=V4iEj7egXZHrWiV1cGQIezbtVmOKbOB-BRzPwa8WVtc,12683
20
+ kerykeion/relationship_score.py,sha256=R9JugfK5_gJgr5ND-EghkqpqZcutzzKlJ-2JnYUMVv4,6794
21
+ kerykeion/report.py,sha256=kS5avIN119pJVapYjZOvabg77nEcA8sSrOuXbRifABk,2565
22
+ kerykeion/settings/__init__.py,sha256=QQNFCl7sgN27MKaVscqtpPk10HGz4wZS3I_7KEGMaVA,69
23
+ kerykeion/settings/kerykeion_settings.py,sha256=uRAbhJ0ZXAbGBPGJjhh5u8YX2phcXobEwJA646wMHcM,2347
24
+ kerykeion/settings/kr.config.json,sha256=1Yhv9RGHom5U9e-JZZRWVfT2Ubllz2WrckdwadDWfyg,12282
25
+ kerykeion/sweph/README.md,sha256=L7FtNAJTWtrZNGKa8MX87SjduFYPYxwWhaI5fmtzNZo,73
26
+ kerykeion/sweph/seas_18.se1,sha256=X9nCqhZU43wJpq61WAdueVQJt9xL2UjrwPqn1Kdoa1s,223002
27
+ kerykeion/utilities.py,sha256=ncoXHvzXhNjhdm-uU6hMirVo287laq2GAJElNE6cBZM,10822
28
+ kerykeion-4.8.1.dist-info/LICENSE,sha256=UTLH8EdbAsgQei4PA2PnBCPGLSZkq5J-dhkyJuXgWQU,34273
29
+ kerykeion-4.8.1.dist-info/METADATA,sha256=5KQpaw5C7-Ym6P1S6QJ8pIjMyOn4JlVh3cJrroZmluA,10351
30
+ kerykeion-4.8.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
31
+ kerykeion-4.8.1.dist-info/entry_points.txt,sha256=5SmANYscFDDTdeovHvGQ-cnj0hdFvGoxPaWLCpyDFnQ,49
32
+ kerykeion-4.8.1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.6.1
2
+ Generator: poetry-core 1.9.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,29 +0,0 @@
1
- LICENSE,sha256=UTLH8EdbAsgQei4PA2PnBCPGLSZkq5J-dhkyJuXgWQU,34273
2
- kerykeion/__init__.py,sha256=b01JNmaaRWjA9seRjAA59Cduy1dNVJ0iU2oUFw5qZiw,3885
3
- kerykeion/aspects/__init__.py,sha256=KAGLkC41PRsRqiV6Ii38HIME-rfTrefiKOOzC5d7Ub0,292
4
- kerykeion/aspects/natal_aspects.py,sha256=W5AhNGAXqaBmhQOJghxqYWbETT3NHXLpGdDfqe1gj9E,10436
5
- kerykeion/aspects/synastry_aspects.py,sha256=DBEV-gT5gRuN8Rl6YNamjkvGQMvjehKL8qgTo75O9XI,2862
6
- kerykeion/astrological_subject.py,sha256=cIZiPnuNYSiSOOEAdOiSqxQbJXKDa-8jV8T7oDfRDe0,21222
7
- kerykeion/charts/__init__.py,sha256=3WzR2n9dr6MDzjTbEQOYpXSFlhfMfga5YWNsPawdbRw,127
8
- kerykeion/charts/charts_utils.py,sha256=qQMXu5XZCCjvyqL62fzh4JnKLzd_G6u9pcMk6f1DpIc,3197
9
- kerykeion/charts/kerykeion_chart_svg.py,sha256=Bj74zQMwSbicQ0nWXlGBYWW3ito2kT5BLuU7GI84Cwc,66633
10
- kerykeion/charts/templates/chart.xml,sha256=ZrkqJV3Du8vG1w8kVkM1wI-IiZNVDLDuS6dRtPz7wVo,69874
11
- kerykeion/fetch_geonames.py,sha256=6tgjrwBMyjbA6YNZ4rcESyYSn0FDyi1xL2gkFuy9o6k,4774
12
- kerykeion/kr_types/__init__.py,sha256=xlBzpRwcKTamjYOYxCTf-BGAX5NODBQB3zqBP_sH28o,104
13
- kerykeion/kr_types/chart_types.py,sha256=0grG4IdOd6fYbon5ErBy0xYxB66Ajfsl9o1F4ISPtck,2184
14
- kerykeion/kr_types/kerykeion_exception.py,sha256=CtdpOaGTox_LBGB0Ji_qtcwbgYAqBJ8AfDXbeaiAkM0,314
15
- kerykeion/kr_types/kr_literals.py,sha256=hbgeq5yPuyLv9zXp7shBeEsMHOd8UQBBUa_HQnBQu7w,1034
16
- kerykeion/kr_types/kr_models.py,sha256=pnUwYC3EqxPN3brmWjBUqYT_9Blxcqc--VqUoi6wfOs,3971
17
- kerykeion/relationship_score.py,sha256=bzM97kFjjDbc-grXhWG2PDkodu6dAFYZis3bO7qaR-A,6916
18
- kerykeion/report.py,sha256=se2ZSDKjk2v2eaMWqBFaYPhcqyGP-RlQbr6uA-9-Mz0,2481
19
- kerykeion/settings/__init__.py,sha256=adj8WE0Svgce770ZAhF0B4BhH4liQfTkPDQC6aL39a8,74
20
- kerykeion/settings/kerykeion_settings.py,sha256=f6c2BEBpO8J19-rayFNqDP1X6XccTAeIbrM5Vx1gfsc,13498
21
- kerykeion/settings/kr.config.json,sha256=twLNLD1AQivCVo-mmfmLRlwvuM1LWanPYBcnn9M0Ij4,12167
22
- kerykeion/sweph/README.md,sha256=L7FtNAJTWtrZNGKa8MX87SjduFYPYxwWhaI5fmtzNZo,73
23
- kerykeion/sweph/seas_18.se1,sha256=X9nCqhZU43wJpq61WAdueVQJt9xL2UjrwPqn1Kdoa1s,223002
24
- kerykeion/utilities.py,sha256=l2IuKGP687USF5uzRHJFrNmvzHMSFzZEWliWSIHUjlU,5707
25
- kerykeion-4.0.3.dist-info/LICENSE,sha256=UTLH8EdbAsgQei4PA2PnBCPGLSZkq5J-dhkyJuXgWQU,34273
26
- kerykeion-4.0.3.dist-info/METADATA,sha256=n6ENISZ6woM5dw93ZwDVZGVHTb4Ev40sADyK0X3Yhaw,9409
27
- kerykeion-4.0.3.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
28
- kerykeion-4.0.3.dist-info/entry_points.txt,sha256=5SmANYscFDDTdeovHvGQ-cnj0hdFvGoxPaWLCpyDFnQ,49
29
- kerykeion-4.0.3.dist-info/RECORD,,