kerykeion 5.0.0b2__py3-none-any.whl → 5.0.0b4__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 +3 -2
- kerykeion/aspects/aspects_factory.py +60 -21
- kerykeion/aspects/aspects_utils.py +1 -1
- kerykeion/backword.py +111 -18
- kerykeion/chart_data_factory.py +72 -7
- kerykeion/charts/chart_drawer.py +524 -203
- kerykeion/charts/charts_utils.py +416 -253
- kerykeion/charts/templates/aspect_grid_only.xml +269 -312
- kerykeion/charts/templates/chart.xml +248 -304
- kerykeion/charts/templates/wheel_only.xml +271 -312
- kerykeion/charts/themes/black-and-white.css +148 -0
- kerykeion/relationship_score_factory.py +12 -2
- kerykeion/schemas/kr_literals.py +1 -1
- kerykeion/settings/__init__.py +16 -2
- kerykeion/settings/chart_defaults.py +444 -0
- kerykeion/settings/config_constants.py +0 -5
- kerykeion/settings/kerykeion_settings.py +31 -74
- kerykeion/settings/translation_strings.py +1479 -0
- kerykeion/settings/translations.py +74 -0
- kerykeion/transits_time_range_factory.py +10 -1
- {kerykeion-5.0.0b2.dist-info → kerykeion-5.0.0b4.dist-info}/METADATA +304 -204
- {kerykeion-5.0.0b2.dist-info → kerykeion-5.0.0b4.dist-info}/RECORD +24 -25
- kerykeion/settings/kr.config.json +0 -1474
- kerykeion/settings/legacy/__init__.py +0 -0
- kerykeion/settings/legacy/legacy_celestial_points_settings.py +0 -299
- kerykeion/settings/legacy/legacy_chart_aspects_settings.py +0 -71
- kerykeion/settings/legacy/legacy_color_settings.py +0 -42
- {kerykeion-5.0.0b2.dist-info → kerykeion-5.0.0b4.dist-info}/WHEEL +0 -0
- {kerykeion-5.0.0b2.dist-info → kerykeion-5.0.0b4.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Simple helpers to access chart translation strings.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from collections.abc import Mapping
|
|
8
|
+
from copy import deepcopy
|
|
9
|
+
from typing import Any, Optional, TypeVar
|
|
10
|
+
|
|
11
|
+
from .translation_strings import LANGUAGE_SETTINGS
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T")
|
|
14
|
+
|
|
15
|
+
_SENTINEL = object()
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def load_language_settings(overrides: Optional[Mapping[str, Any]] = None) -> dict[str, dict[str, Any]]:
|
|
19
|
+
"""Return the available language settings merged with optional overrides."""
|
|
20
|
+
languages = deepcopy(LANGUAGE_SETTINGS)
|
|
21
|
+
if overrides:
|
|
22
|
+
data = overrides.get("language_settings", overrides)
|
|
23
|
+
languages = _deep_merge(languages, data)
|
|
24
|
+
return languages
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def get_translations(
|
|
28
|
+
value: str,
|
|
29
|
+
default: T,
|
|
30
|
+
*,
|
|
31
|
+
language: Optional[str] = None,
|
|
32
|
+
language_dict: Optional[Mapping[str, Any]] = None,
|
|
33
|
+
) -> T:
|
|
34
|
+
"""Fetch a translation by key, falling back to English when missing."""
|
|
35
|
+
primary = _select_language(language_dict, language)
|
|
36
|
+
result = _deep_get(primary, value)
|
|
37
|
+
if result is _SENTINEL:
|
|
38
|
+
fallback = LANGUAGE_SETTINGS.get("EN", {})
|
|
39
|
+
result = _deep_get(fallback, value)
|
|
40
|
+
return default if result is _SENTINEL or result is None else result # type: ignore[return-value]
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _select_language(language_dict: Optional[Mapping[str, Any]], language: Optional[str]) -> Mapping[str, Any]:
|
|
44
|
+
if language_dict is not None:
|
|
45
|
+
return language_dict
|
|
46
|
+
fallback = LANGUAGE_SETTINGS.get("EN", {})
|
|
47
|
+
if language is None:
|
|
48
|
+
return fallback
|
|
49
|
+
return LANGUAGE_SETTINGS.get(language, fallback)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _deep_merge(base: Mapping[str, Any], overrides: Mapping[str, Any]) -> dict[str, Any]:
|
|
53
|
+
merged: dict[str, Any] = {}
|
|
54
|
+
for key, value in base.items():
|
|
55
|
+
merged[key] = deepcopy(value)
|
|
56
|
+
for key, value in overrides.items():
|
|
57
|
+
if key in merged and isinstance(merged[key], Mapping) and isinstance(value, Mapping):
|
|
58
|
+
merged[key] = _deep_merge(merged[key], value)
|
|
59
|
+
else:
|
|
60
|
+
merged[key] = deepcopy(value)
|
|
61
|
+
return merged
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def _deep_get(mapping: Mapping[str, Any], dotted_key: str):
|
|
65
|
+
current: Any = mapping
|
|
66
|
+
for segment in dotted_key.split("."):
|
|
67
|
+
if isinstance(current, Mapping) and segment in current:
|
|
68
|
+
current = current[segment]
|
|
69
|
+
else:
|
|
70
|
+
return _SENTINEL
|
|
71
|
+
return current
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
__all__ = ["get_translations", "load_language_settings"]
|
|
@@ -55,7 +55,7 @@ Copyright: (C) 2025 Kerykeion Project
|
|
|
55
55
|
License: AGPL-3.0
|
|
56
56
|
"""
|
|
57
57
|
|
|
58
|
-
from typing import Union, List
|
|
58
|
+
from typing import Union, List, Optional
|
|
59
59
|
from datetime import datetime, timedelta
|
|
60
60
|
from kerykeion.schemas.kr_models import AstrologicalSubjectModel
|
|
61
61
|
from kerykeion.astrological_subject_factory import AstrologicalSubjectFactory
|
|
@@ -97,6 +97,8 @@ class TransitsTimeRangeFactory:
|
|
|
97
97
|
settings_file (Union[Path, KerykeionSettingsModel, dict, None], optional):
|
|
98
98
|
Configuration settings for calculations. Can be a file path, settings
|
|
99
99
|
model, dictionary, or None for defaults. Defaults to None.
|
|
100
|
+
axis_orb_limit (float | None, optional): Optional orb threshold applied to chart axes
|
|
101
|
+
during single-chart aspect calculations. Dual-chart calculations ignore this value.
|
|
100
102
|
|
|
101
103
|
Attributes:
|
|
102
104
|
natal_chart: The reference natal chart for transit calculations.
|
|
@@ -104,6 +106,7 @@ class TransitsTimeRangeFactory:
|
|
|
104
106
|
active_points: Celestial bodies included in calculations.
|
|
105
107
|
active_aspects: Aspect types considered for analysis.
|
|
106
108
|
settings_file: Configuration settings for the calculations.
|
|
109
|
+
axis_orb_limit: Optional orb override used when calculating single-chart aspects.
|
|
107
110
|
|
|
108
111
|
Examples:
|
|
109
112
|
Basic transit calculation:
|
|
@@ -137,6 +140,8 @@ class TransitsTimeRangeFactory:
|
|
|
137
140
|
active_points: List[AstrologicalPoint] = DEFAULT_ACTIVE_POINTS,
|
|
138
141
|
active_aspects: List[ActiveAspect] = DEFAULT_ACTIVE_ASPECTS,
|
|
139
142
|
settings_file: Union[Path, KerykeionSettingsModel, dict, None] = None,
|
|
143
|
+
*,
|
|
144
|
+
axis_orb_limit: Optional[float] = None,
|
|
140
145
|
):
|
|
141
146
|
"""
|
|
142
147
|
Initialize the TransitsTimeRangeFactory with calculation parameters.
|
|
@@ -161,6 +166,8 @@ class TransitsTimeRangeFactory:
|
|
|
161
166
|
settings_file (Union[Path, KerykeionSettingsModel, dict, None], optional):
|
|
162
167
|
Configuration settings for orb tolerances, calculation methods, and
|
|
163
168
|
other parameters. Defaults to None (uses system defaults).
|
|
169
|
+
axis_orb_limit (float | None, optional): Optional orb threshold for
|
|
170
|
+
chart axes applied during aspect calculations.
|
|
164
171
|
|
|
165
172
|
Note:
|
|
166
173
|
- All ephemeris data points should use the same coordinate system as the natal chart
|
|
@@ -172,6 +179,7 @@ class TransitsTimeRangeFactory:
|
|
|
172
179
|
self.active_points = active_points
|
|
173
180
|
self.active_aspects = active_aspects
|
|
174
181
|
self.settings_file = settings_file
|
|
182
|
+
self.axis_orb_limit = axis_orb_limit
|
|
175
183
|
|
|
176
184
|
def get_transit_moments(self) -> TransitsTimeRangeModel:
|
|
177
185
|
"""
|
|
@@ -238,6 +246,7 @@ class TransitsTimeRangeFactory:
|
|
|
238
246
|
self.natal_chart,
|
|
239
247
|
active_points=self.active_points,
|
|
240
248
|
active_aspects=self.active_aspects,
|
|
249
|
+
axis_orb_limit=self.axis_orb_limit,
|
|
241
250
|
).relevant_aspects
|
|
242
251
|
|
|
243
252
|
# Create a transit moment for this point in time
|