kerykeion 3.1.1__py3-none-any.whl → 5.1.9__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 +58 -141
- kerykeion/aspects/__init__.py +14 -0
- kerykeion/aspects/aspects_factory.py +568 -0
- kerykeion/aspects/aspects_utils.py +164 -0
- kerykeion/astrological_subject_factory.py +1901 -0
- kerykeion/backword.py +820 -0
- kerykeion/chart_data_factory.py +552 -0
- kerykeion/charts/__init__.py +5 -0
- kerykeion/charts/chart_drawer.py +2794 -0
- kerykeion/charts/charts_utils.py +1840 -0
- kerykeion/charts/draw_planets.py +658 -0
- kerykeion/charts/templates/aspect_grid_only.xml +596 -0
- kerykeion/charts/templates/chart.xml +741 -0
- kerykeion/charts/templates/wheel_only.xml +653 -0
- kerykeion/charts/themes/black-and-white.css +148 -0
- kerykeion/charts/themes/classic.css +113 -0
- kerykeion/charts/themes/dark-high-contrast.css +159 -0
- kerykeion/charts/themes/dark.css +160 -0
- kerykeion/charts/themes/light.css +160 -0
- kerykeion/charts/themes/strawberry.css +158 -0
- kerykeion/composite_subject_factory.py +408 -0
- kerykeion/ephemeris_data_factory.py +443 -0
- kerykeion/fetch_geonames.py +105 -61
- kerykeion/house_comparison/__init__.py +6 -0
- kerykeion/house_comparison/house_comparison_factory.py +103 -0
- kerykeion/house_comparison/house_comparison_utils.py +126 -0
- kerykeion/kr_types/__init__.py +70 -0
- kerykeion/kr_types/chart_template_model.py +20 -0
- kerykeion/kr_types/kerykeion_exception.py +20 -0
- kerykeion/kr_types/kr_literals.py +20 -0
- kerykeion/kr_types/kr_models.py +20 -0
- kerykeion/kr_types/settings_models.py +20 -0
- kerykeion/planetary_return_factory.py +805 -0
- kerykeion/relationship_score_factory.py +301 -0
- kerykeion/report.py +779 -0
- kerykeion/schemas/__init__.py +106 -0
- kerykeion/schemas/chart_template_model.py +367 -0
- kerykeion/schemas/kerykeion_exception.py +20 -0
- kerykeion/schemas/kr_literals.py +181 -0
- kerykeion/schemas/kr_models.py +603 -0
- kerykeion/schemas/settings_models.py +188 -0
- kerykeion/settings/__init__.py +20 -0
- kerykeion/settings/chart_defaults.py +444 -0
- kerykeion/settings/config_constants.py +152 -0
- kerykeion/settings/kerykeion_settings.py +51 -0
- kerykeion/settings/translation_strings.py +1499 -0
- kerykeion/settings/translations.py +74 -0
- kerykeion/sweph/README.md +3 -0
- kerykeion/sweph/ast136/s136108s.se1 +0 -0
- kerykeion/sweph/ast136/s136199s.se1 +0 -0
- kerykeion/sweph/ast136/s136472s.se1 +0 -0
- kerykeion/sweph/ast28/se28978s.se1 +0 -0
- kerykeion/sweph/ast50/se50000s.se1 +0 -0
- kerykeion/sweph/ast90/se90377s.se1 +0 -0
- kerykeion/sweph/ast90/se90482s.se1 +0 -0
- kerykeion/sweph/seas_18.se1 +0 -0
- kerykeion/sweph/sefstars.txt +1602 -0
- kerykeion/transits_time_range_factory.py +302 -0
- kerykeion/utilities.py +762 -130
- kerykeion-5.1.9.dist-info/METADATA +1793 -0
- kerykeion-5.1.9.dist-info/RECORD +63 -0
- {kerykeion-3.1.1.dist-info → kerykeion-5.1.9.dist-info}/WHEEL +1 -2
- kerykeion-5.1.9.dist-info/licenses/LICENSE +661 -0
- kerykeion/aspects.py +0 -331
- kerykeion/charts/charts_svg.py +0 -1607
- kerykeion/charts/templates/basic.xml +0 -285
- kerykeion/charts/templates/extended.xml +0 -294
- kerykeion/kr.config.json +0 -464
- kerykeion/main.py +0 -595
- kerykeion/print_all_data.py +0 -44
- kerykeion/relationship_score.py +0 -219
- kerykeion/types.py +0 -190
- kerykeion-3.1.1.dist-info/METADATA +0 -204
- kerykeion-3.1.1.dist-info/RECORD +0 -17
- kerykeion-3.1.1.dist-info/top_level.txt +0 -1
|
@@ -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"]
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|