kerykeion 4.24.7__py3-none-any.whl → 4.25.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.
- kerykeion/__init__.py +1 -0
- kerykeion/aspects/natal_aspects.py +2 -1
- kerykeion/astrological_subject.py +9 -47
- kerykeion/charts/charts_utils.py +40 -76
- kerykeion/charts/kerykeion_chart_svg.py +119 -59
- kerykeion/charts/templates/chart.xml +27 -13
- kerykeion/composite_subject_factory.py +200 -0
- kerykeion/kr_types/chart_types.py +20 -13
- kerykeion/kr_types/kr_literals.py +6 -1
- kerykeion/kr_types/kr_models.py +79 -2
- kerykeion/kr_types/settings_models.py +71 -20
- kerykeion/relationship_score/relationship_score_factory.py +7 -54
- kerykeion/settings/kr.config.json +545 -14
- kerykeion/utilities.py +73 -1
- {kerykeion-4.24.7.dist-info → kerykeion-4.25.1.dist-info}/METADATA +2 -2
- {kerykeion-4.24.7.dist-info → kerykeion-4.25.1.dist-info}/RECORD +19 -18
- {kerykeion-4.24.7.dist-info → kerykeion-4.25.1.dist-info}/LICENSE +0 -0
- {kerykeion-4.24.7.dist-info → kerykeion-4.25.1.dist-info}/WHEEL +0 -0
- {kerykeion-4.24.7.dist-info → kerykeion-4.25.1.dist-info}/entry_points.txt +0 -0
kerykeion/utilities.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from kerykeion.kr_types import KerykeionPointModel, KerykeionException, ZodiacSignModel, AstrologicalSubjectModel
|
|
1
|
+
from kerykeion.kr_types import KerykeionPointModel, KerykeionException, ZodiacSignModel, AstrologicalSubjectModel, LunarPhaseModel
|
|
2
2
|
from kerykeion.kr_types.kr_literals import LunarPhaseEmoji, LunarPhaseName, PointType, Planet, Houses, AxialCusps
|
|
3
3
|
from typing import Union, get_args, TYPE_CHECKING
|
|
4
4
|
import logging
|
|
@@ -318,3 +318,75 @@ def get_available_astrological_points_list(subject: Union["AstrologicalSubject",
|
|
|
318
318
|
planets_absolute_position_list.append(subject[axis.lower()])
|
|
319
319
|
|
|
320
320
|
return planets_absolute_position_list
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
def circular_mean(first_position: Union[int, float], second_position: Union[int, float]) -> float:
|
|
324
|
+
"""
|
|
325
|
+
Computes the circular mean of two astrological positions (e.g., house cusps, planets).
|
|
326
|
+
|
|
327
|
+
This function ensures that positions crossing 0° Aries (360°) are correctly averaged,
|
|
328
|
+
avoiding errors that occur with simple linear means.
|
|
329
|
+
|
|
330
|
+
Args:
|
|
331
|
+
position1 (Union[int, float]): First position in degrees (0-360).
|
|
332
|
+
position2 (Union[int, float]): Second position in degrees (0-360).
|
|
333
|
+
|
|
334
|
+
Returns:
|
|
335
|
+
float: The circular mean position in degrees (0-360).
|
|
336
|
+
"""
|
|
337
|
+
x = (math.cos(math.radians(first_position)) + math.cos(math.radians(second_position))) / 2
|
|
338
|
+
y = (math.sin(math.radians(first_position)) + math.sin(math.radians(second_position))) / 2
|
|
339
|
+
mean_position = math.degrees(math.atan2(y, x))
|
|
340
|
+
|
|
341
|
+
# Ensure the result is within 0-360°
|
|
342
|
+
if mean_position < 0:
|
|
343
|
+
mean_position += 360
|
|
344
|
+
|
|
345
|
+
return mean_position
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
def calculate_moon_phase(moon_abs_pos: float, sun_abs_pos: float) -> LunarPhaseModel:
|
|
349
|
+
"""
|
|
350
|
+
Calculate the lunar phase based on the positions of the moon and sun.
|
|
351
|
+
|
|
352
|
+
Args:
|
|
353
|
+
- moon_abs_pos (float): The absolute position of the moon.
|
|
354
|
+
- sun_abs_pos (float): The absolute position of the sun.
|
|
355
|
+
|
|
356
|
+
Returns:
|
|
357
|
+
- dict: A dictionary containing the lunar phase information.
|
|
358
|
+
"""
|
|
359
|
+
# Initialize moon_phase and sun_phase to None in case of an error
|
|
360
|
+
moon_phase, sun_phase = None, None
|
|
361
|
+
|
|
362
|
+
# Calculate the anti-clockwise degrees between the sun and moon
|
|
363
|
+
degrees_between = (moon_abs_pos - sun_abs_pos) % 360
|
|
364
|
+
|
|
365
|
+
# Calculate the moon phase (1-28) based on the degrees between the sun and moon
|
|
366
|
+
step = 360.0 / 28.0
|
|
367
|
+
moon_phase = int(degrees_between // step) + 1
|
|
368
|
+
|
|
369
|
+
# Define the sun phase steps
|
|
370
|
+
sunstep = [
|
|
371
|
+
0, 30, 40, 50, 60, 70, 80, 90, 120, 130, 140, 150, 160, 170, 180,
|
|
372
|
+
210, 220, 230, 240, 250, 260, 270, 300, 310, 320, 330, 340, 350
|
|
373
|
+
]
|
|
374
|
+
|
|
375
|
+
# Calculate the sun phase (1-28) based on the degrees between the sun and moon
|
|
376
|
+
for x in range(len(sunstep)):
|
|
377
|
+
low = sunstep[x]
|
|
378
|
+
high = sunstep[x + 1] if x < len(sunstep) - 1 else 360
|
|
379
|
+
if low <= degrees_between < high:
|
|
380
|
+
sun_phase = x + 1
|
|
381
|
+
break
|
|
382
|
+
|
|
383
|
+
# Create a dictionary with the lunar phase information
|
|
384
|
+
lunar_phase_dictionary = {
|
|
385
|
+
"degrees_between_s_m": degrees_between,
|
|
386
|
+
"moon_phase": moon_phase,
|
|
387
|
+
"sun_phase": sun_phase,
|
|
388
|
+
"moon_emoji": get_moon_emoji_from_phase_int(moon_phase),
|
|
389
|
+
"moon_phase_name": get_moon_phase_name_from_phase_int(moon_phase)
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
return LunarPhaseModel(**lunar_phase_dictionary)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: kerykeion
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.25.1
|
|
4
4
|
Summary: A python library for astrology.
|
|
5
5
|
Home-page: https://www.kerykeion.net/
|
|
6
6
|
License: AGPL-3.0
|
|
@@ -71,7 +71,7 @@ The core goal of this project is to provide a simple and easy approach to astrol
|
|
|
71
71
|
|
|
72
72
|
Here's an example of a birthchart:
|
|
73
73
|
|
|
74
|
-

|
|
75
75
|
|
|
76
76
|
## Web API
|
|
77
77
|
|
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
LICENSE,sha256=UTLH8EdbAsgQei4PA2PnBCPGLSZkq5J-dhkyJuXgWQU,34273
|
|
2
|
-
kerykeion/__init__.py,sha256=
|
|
2
|
+
kerykeion/__init__.py,sha256=5uWwosgfy16r2g4pl6TJsee8Nz5-UTrpyrH1KTgfvc8,702
|
|
3
3
|
kerykeion/aspects/__init__.py,sha256=9kx_Rx1NJx5SM7nDCSbI79S1neZ3c-q2NvQr-S6A9PY,292
|
|
4
4
|
kerykeion/aspects/aspects_utils.py,sha256=Ej-E7Uvfi8x_ydP9dOhzhCp2uSpvX67T_VXuOjEKdoQ,3071
|
|
5
|
-
kerykeion/aspects/natal_aspects.py,sha256=
|
|
5
|
+
kerykeion/aspects/natal_aspects.py,sha256=YAhf8Dqkx9kouealIzPae0VNK77P9-9oQhJw6dYXqo0,6661
|
|
6
6
|
kerykeion/aspects/synastry_aspects.py,sha256=5vU8yJgAGRyVBoKvRpsg-0AcQg-imOzH91tvDM_RUNQ,5044
|
|
7
|
-
kerykeion/astrological_subject.py,sha256=
|
|
7
|
+
kerykeion/astrological_subject.py,sha256=643axkLtIVPkOOTHhB4InHYn3XVEOBZdXLS9B-N7kSQ,36451
|
|
8
8
|
kerykeion/charts/__init__.py,sha256=i9NMZ7LdkllPlqQSi1or9gTobHbROGDKmJhBDO4R0mA,128
|
|
9
|
-
kerykeion/charts/charts_utils.py,sha256=
|
|
9
|
+
kerykeion/charts/charts_utils.py,sha256=TGmya60LMswUvQMi6irJWaboK6QRWCZ52wv5FMgaUT8,40424
|
|
10
10
|
kerykeion/charts/draw_planets.py,sha256=Uty3zpWYMQZvvK7ZHhlmynCHeL8DIN3qL2ifnBXVciM,17393
|
|
11
|
-
kerykeion/charts/kerykeion_chart_svg.py,sha256=
|
|
11
|
+
kerykeion/charts/kerykeion_chart_svg.py,sha256=JPsNV7AAwYY1tQ8jNnc0TKEGXY-l-Ez3-Z632QcbR90,51221
|
|
12
12
|
kerykeion/charts/templates/aspect_grid_only.xml,sha256=ZiBVeToVmCA8QxYlB_cfnsAO1NNeQAnJ_6rIYkr4F58,70091
|
|
13
|
-
kerykeion/charts/templates/chart.xml,sha256=
|
|
13
|
+
kerykeion/charts/templates/chart.xml,sha256=2p2LNNib9MfZiq521tFoEUwOBEN6KlbKOY4ZINdf7Dc,74985
|
|
14
14
|
kerykeion/charts/templates/wheel_only.xml,sha256=E0JCxcnjTjxuaomw7PQEc_3xRVErj1y2hIOGTrShuhc,71304
|
|
15
15
|
kerykeion/charts/themes/classic.css,sha256=-b6XllAZmqUDjBwDtIkfzfI3Wtc8AImuGMpfAQ_2wa0,3552
|
|
16
16
|
kerykeion/charts/themes/dark-high-contrast.css,sha256=9tdyFC-4Ytnv4lrVwKnOjZJ0YNgbRrP_HNnfJRlnbn0,6099
|
|
17
17
|
kerykeion/charts/themes/dark.css,sha256=ml2lnzQVuS5DhCdoeUrDmMv9kB1nNceRt7hHbOHSbjM,6099
|
|
18
18
|
kerykeion/charts/themes/light.css,sha256=ALf5U8tQsb6ky0N9R7ZLOHDrfKEXNM-sBR3JIRxFrCI,6092
|
|
19
|
+
kerykeion/composite_subject_factory.py,sha256=3wyY03mefF9OPfeFyV7Ck4BIq8oY-kSqkHi4f8Ap9B0,8049
|
|
19
20
|
kerykeion/enums.py,sha256=nPXgP_ocsRnRno5H-yunZy3fp-hLZ9aYRaUb-2gBdvw,1199
|
|
20
21
|
kerykeion/ephemeris_data.py,sha256=Cd5TK5nTkFHYU6bkLKjZRfiU4_6AgsWGcwBDrBHKrQk,8096
|
|
21
22
|
kerykeion/fetch_geonames.py,sha256=e66Nh6yq9A4VjnuvVSiV1TW1IkJ9m3Q2LKPWrkOGgO0,4764
|
|
22
23
|
kerykeion/kr_types/__init__.py,sha256=jshJOccCQcYZuoOvrILRZH6imy4RBvKpFPujlNLFyGE,295
|
|
23
|
-
kerykeion/kr_types/chart_types.py,sha256=
|
|
24
|
+
kerykeion/kr_types/chart_types.py,sha256=EFXTddX1wwTzbLSDKw_ipg4tbOihTKPEnn2T9ooFSig,2123
|
|
24
25
|
kerykeion/kr_types/kerykeion_exception.py,sha256=kE1y0K0rmuz32b4K_ZppSsZ59I2Get0ZkvOkTE5HejI,314
|
|
25
|
-
kerykeion/kr_types/kr_literals.py,sha256=
|
|
26
|
-
kerykeion/kr_types/kr_models.py,sha256=
|
|
27
|
-
kerykeion/kr_types/settings_models.py,sha256=
|
|
26
|
+
kerykeion/kr_types/kr_literals.py,sha256=b1JEgByA8-PWtkM8TdkNb2aePr8dUApI-OH3ciulJF8,4327
|
|
27
|
+
kerykeion/kr_types/kr_models.py,sha256=N7VhwxcMkXMjn5UNArleuxZ684woJzBjvvNC1CF7ttg,6824
|
|
28
|
+
kerykeion/kr_types/settings_models.py,sha256=kIq8If9rjnDhLUZ4y68fl0xcHTQoI9kbbny8NegPtsY,10968
|
|
28
29
|
kerykeion/relationship_score/__init__.py,sha256=cLaEBQXQBfyRkv0OaS3ceLROzvWcvKXWiRq0PS6LDjY,114
|
|
29
30
|
kerykeion/relationship_score/relationship_score.py,sha256=lJkSbHw9nOUaPMrPxqcGhnVQIwAgI52K8BQzXXswb6A,6504
|
|
30
|
-
kerykeion/relationship_score/relationship_score_factory.py,sha256=
|
|
31
|
+
kerykeion/relationship_score/relationship_score_factory.py,sha256=wVdVomy_WlIvIvidnsf5a7jEZA8HJV8m8E3E_gia2yY,8651
|
|
31
32
|
kerykeion/report.py,sha256=snqnrJzb89q2ixL74qS9ksvzNSh_WXtZ_haBOIvHYeY,2814
|
|
32
33
|
kerykeion/settings/__init__.py,sha256=QQNFCl7sgN27MKaVscqtpPk10HGz4wZS3I_7KEGMaVA,69
|
|
33
34
|
kerykeion/settings/config_constants.py,sha256=OUi28L2l8s09Df3GHiQUiBZuTjOdfL4A5zSRNqBRHc8,1255
|
|
34
35
|
kerykeion/settings/kerykeion_settings.py,sha256=7GCGUzcctEg5uyWlzRk2YIotJSkCZDOVAo_CXwgMeK4,2934
|
|
35
|
-
kerykeion/settings/kr.config.json,sha256=
|
|
36
|
+
kerykeion/settings/kr.config.json,sha256=5ktsoMnuhY9eUpQHC8oNmRZqPC7Lt3ILgOucKQvsJkQ,42059
|
|
36
37
|
kerykeion/sweph/README.md,sha256=L7FtNAJTWtrZNGKa8MX87SjduFYPYxwWhaI5fmtzNZo,73
|
|
37
38
|
kerykeion/sweph/seas_18.se1,sha256=X9nCqhZU43wJpq61WAdueVQJt9xL2UjrwPqn1Kdoa1s,223002
|
|
38
|
-
kerykeion/utilities.py,sha256=
|
|
39
|
-
kerykeion-4.
|
|
40
|
-
kerykeion-4.
|
|
41
|
-
kerykeion-4.
|
|
42
|
-
kerykeion-4.
|
|
43
|
-
kerykeion-4.
|
|
39
|
+
kerykeion/utilities.py,sha256=6TQpxENYDMacH4CsRJGJ4rmoV2Pn7pmQc8MTOUR2CSg,13824
|
|
40
|
+
kerykeion-4.25.1.dist-info/LICENSE,sha256=UTLH8EdbAsgQei4PA2PnBCPGLSZkq5J-dhkyJuXgWQU,34273
|
|
41
|
+
kerykeion-4.25.1.dist-info/METADATA,sha256=PQnqq2_2emnyReIYrR2P7io4x0WRQ3EFwftDiGA6cvc,17802
|
|
42
|
+
kerykeion-4.25.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
43
|
+
kerykeion-4.25.1.dist-info/entry_points.txt,sha256=5SmANYscFDDTdeovHvGQ-cnj0hdFvGoxPaWLCpyDFnQ,49
|
|
44
|
+
kerykeion-4.25.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|