kerykeion 5.0.0a9__py3-none-any.whl → 5.1.8__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.

Files changed (79) hide show
  1. kerykeion/__init__.py +50 -9
  2. kerykeion/aspects/__init__.py +5 -2
  3. kerykeion/aspects/aspects_factory.py +568 -0
  4. kerykeion/aspects/aspects_utils.py +78 -11
  5. kerykeion/astrological_subject_factory.py +1032 -275
  6. kerykeion/backword.py +820 -0
  7. kerykeion/chart_data_factory.py +552 -0
  8. kerykeion/charts/chart_drawer.py +2661 -0
  9. kerykeion/charts/charts_utils.py +652 -399
  10. kerykeion/charts/draw_planets.py +603 -353
  11. kerykeion/charts/templates/aspect_grid_only.xml +326 -198
  12. kerykeion/charts/templates/chart.xml +306 -256
  13. kerykeion/charts/templates/wheel_only.xml +330 -200
  14. kerykeion/charts/themes/black-and-white.css +148 -0
  15. kerykeion/charts/themes/classic.css +11 -0
  16. kerykeion/charts/themes/dark-high-contrast.css +11 -0
  17. kerykeion/charts/themes/dark.css +11 -0
  18. kerykeion/charts/themes/light.css +11 -0
  19. kerykeion/charts/themes/strawberry.css +10 -0
  20. kerykeion/composite_subject_factory.py +232 -13
  21. kerykeion/ephemeris_data_factory.py +443 -0
  22. kerykeion/fetch_geonames.py +78 -21
  23. kerykeion/house_comparison/__init__.py +4 -1
  24. kerykeion/house_comparison/house_comparison_factory.py +52 -19
  25. kerykeion/house_comparison/house_comparison_utils.py +37 -9
  26. kerykeion/kr_types/__init__.py +66 -6
  27. kerykeion/kr_types/chart_template_model.py +20 -0
  28. kerykeion/kr_types/kerykeion_exception.py +15 -9
  29. kerykeion/kr_types/kr_literals.py +14 -160
  30. kerykeion/kr_types/kr_models.py +14 -291
  31. kerykeion/kr_types/settings_models.py +15 -167
  32. kerykeion/planetary_return_factory.py +545 -40
  33. kerykeion/relationship_score_factory.py +137 -63
  34. kerykeion/report.py +749 -64
  35. kerykeion/schemas/__init__.py +106 -0
  36. kerykeion/schemas/chart_template_model.py +367 -0
  37. kerykeion/schemas/kerykeion_exception.py +20 -0
  38. kerykeion/schemas/kr_literals.py +181 -0
  39. kerykeion/schemas/kr_models.py +603 -0
  40. kerykeion/schemas/settings_models.py +188 -0
  41. kerykeion/settings/__init__.py +20 -1
  42. kerykeion/settings/chart_defaults.py +444 -0
  43. kerykeion/settings/config_constants.py +88 -12
  44. kerykeion/settings/kerykeion_settings.py +32 -75
  45. kerykeion/settings/translation_strings.py +1499 -0
  46. kerykeion/settings/translations.py +74 -0
  47. kerykeion/sweph/ast136/s136108s.se1 +0 -0
  48. kerykeion/sweph/ast136/s136199s.se1 +0 -0
  49. kerykeion/sweph/ast136/s136472s.se1 +0 -0
  50. kerykeion/sweph/ast28/se28978s.se1 +0 -0
  51. kerykeion/sweph/ast50/se50000s.se1 +0 -0
  52. kerykeion/sweph/ast90/se90377s.se1 +0 -0
  53. kerykeion/sweph/ast90/se90482s.se1 +0 -0
  54. kerykeion/sweph/sefstars.txt +1602 -0
  55. kerykeion/transits_time_range_factory.py +302 -0
  56. kerykeion/utilities.py +289 -204
  57. kerykeion-5.1.8.dist-info/METADATA +1793 -0
  58. kerykeion-5.1.8.dist-info/RECORD +63 -0
  59. kerykeion/aspects/natal_aspects.py +0 -181
  60. kerykeion/aspects/synastry_aspects.py +0 -141
  61. kerykeion/aspects/transits_time_range.py +0 -41
  62. kerykeion/charts/draw_planets_v2.py +0 -649
  63. kerykeion/charts/draw_planets_v3.py +0 -679
  64. kerykeion/charts/kerykeion_chart_svg.py +0 -2038
  65. kerykeion/enums.py +0 -57
  66. kerykeion/ephemeris_data.py +0 -238
  67. kerykeion/house_comparison/house_comparison_models.py +0 -38
  68. kerykeion/kr_types/chart_types.py +0 -106
  69. kerykeion/settings/kr.config.json +0 -1304
  70. kerykeion/settings/legacy/__init__.py +0 -0
  71. kerykeion/settings/legacy/legacy_celestial_points_settings.py +0 -299
  72. kerykeion/settings/legacy/legacy_chart_aspects_settings.py +0 -71
  73. kerykeion/settings/legacy/legacy_color_settings.py +0 -42
  74. kerykeion/transits_time_range.py +0 -128
  75. kerykeion-5.0.0a9.dist-info/METADATA +0 -636
  76. kerykeion-5.0.0a9.dist-info/RECORD +0 -55
  77. kerykeion-5.0.0a9.dist-info/entry_points.txt +0 -2
  78. {kerykeion-5.0.0a9.dist-info → kerykeion-5.1.8.dist-info}/WHEEL +0 -0
  79. {kerykeion-5.0.0a9.dist-info → kerykeion-5.1.8.dist-info}/licenses/LICENSE +0 -0
@@ -1,5 +1,5 @@
1
- from kerykeion.kr_types.kr_literals import AstrologicalPoint
2
- from kerykeion.kr_types.kr_models import ActiveAspect
1
+ from kerykeion.schemas.kr_literals import AstrologicalPoint
2
+ from kerykeion.schemas.kr_models import ActiveAspect
3
3
  from typing import List
4
4
 
5
5
 
@@ -14,10 +14,10 @@ DEFAULT_ACTIVE_POINTS: List[AstrologicalPoint] = [
14
14
  "Uranus",
15
15
  "Neptune",
16
16
  "Pluto",
17
- "Mean_Node",
18
- # "True_Node",
19
- "Mean_South_Node",
20
- # "True_South_Node",
17
+ # "Mean_North_Lunar_Node",
18
+ "True_North_Lunar_Node",
19
+ # "Mean_South_Lunar_Node",
20
+ "True_South_Lunar_Node",
21
21
  "Chiron",
22
22
  "Mean_Lilith",
23
23
  # "True_Lilith",
@@ -38,8 +38,8 @@ DEFAULT_ACTIVE_POINTS: List[AstrologicalPoint] = [
38
38
  # "Spica",
39
39
  "Ascendant",
40
40
  "Medium_Coeli",
41
- # "Descendant",
42
- # "Imum_Coeli",
41
+ "Descendant",
42
+ "Imum_Coeli",
43
43
  # "Vertex",
44
44
  # "Anti_Vertex",
45
45
  # "Pars_Fortunae",
@@ -49,7 +49,56 @@ DEFAULT_ACTIVE_POINTS: List[AstrologicalPoint] = [
49
49
  ]
50
50
  """
51
51
  Default list of active points in the charts or aspects calculations.
52
- The full list of points is available in the `kr_types.kr_literals.AstrologicalPoint` literal.
52
+ The full list of points is available in the `schemas.kr_literals.AstrologicalPoint` literal.
53
+ """
54
+
55
+ ALL_ACTIVE_POINTS: List[AstrologicalPoint] = [
56
+ "Sun",
57
+ "Moon",
58
+ "Mercury",
59
+ "Venus",
60
+ "Mars",
61
+ "Jupiter",
62
+ "Saturn",
63
+ "Uranus",
64
+ "Neptune",
65
+ "Pluto",
66
+ "Mean_North_Lunar_Node",
67
+ "True_North_Lunar_Node",
68
+ "Mean_South_Lunar_Node",
69
+ "True_South_Lunar_Node",
70
+ "Chiron",
71
+ "Mean_Lilith",
72
+ "True_Lilith",
73
+ "Earth",
74
+ "Pholus",
75
+ "Ceres",
76
+ "Pallas",
77
+ "Juno",
78
+ "Vesta",
79
+ "Eris",
80
+ "Sedna",
81
+ "Haumea",
82
+ "Makemake",
83
+ "Ixion",
84
+ "Orcus",
85
+ "Quaoar",
86
+ "Regulus",
87
+ "Spica",
88
+ "Ascendant",
89
+ "Medium_Coeli",
90
+ "Descendant",
91
+ "Imum_Coeli",
92
+ "Vertex",
93
+ "Anti_Vertex",
94
+ "Pars_Fortunae",
95
+ "Pars_Spiritus",
96
+ "Pars_Amoris",
97
+ "Pars_Fidei"
98
+ ]
99
+ """
100
+ Full list of active points in the charts or aspects calculations.
101
+ The full list of points is available in the `schemas.kr_literals.AstrologicalPoint` literal.
53
102
  """
54
103
 
55
104
  DEFAULT_ACTIVE_ASPECTS: List[ActiveAspect] = [
@@ -67,10 +116,37 @@ DEFAULT_ACTIVE_ASPECTS: List[ActiveAspect] = [
67
116
  ]
68
117
  """
69
118
  Default list of active aspects in the aspects calculations.
70
- The full list of aspects is available in the `kr_types.kr_literals.AspectName` literal.
119
+ The full list of aspects is available in the `schemas.kr_literals.AspectName` literal.
71
120
  """
72
121
 
73
- DEFAULT_AXIS_ORBIT: int = 1
122
+ ALL_ACTIVE_ASPECTS: List[ActiveAspect] = [
123
+ {"name": "conjunction", "orb": 10},
124
+ {"name": "opposition", "orb": 10},
125
+ {"name": "trine", "orb": 8},
126
+ {"name": "sextile", "orb": 6},
127
+ {"name": "square", "orb": 5},
128
+ {"name": "quintile", "orb": 1},
129
+ {"name": "semi-sextile", "orb": 1},
130
+ {"name": "semi-square", "orb": 1},
131
+ {"name": "sesquiquadrate", "orb": 1},
132
+ {"name": "biquintile", "orb": 1},
133
+ {"name": "quincunx", "orb": 1},
134
+ ]
135
+ """
136
+ Full list of active aspects in the charts or aspects calculations.
137
+ The full list of aspects is available in the `schemas.kr_literals.AspectName` literal.
138
+ """
139
+
140
+ DISCEPOLO_SCORE_ACTIVE_ASPECTS: List[ActiveAspect] = [
141
+ {"name": "conjunction", "orb": 8},
142
+ {"name": "semi-sextile", "orb": 2},
143
+ {"name": "semi-square", "orb": 2},
144
+ {"name": "sextile", "orb": 4},
145
+ {"name": "square", "orb": 5},
146
+ {"name": "trine", "orb": 7},
147
+ {"name": "sesquiquadrate", "orb": 2},
148
+ {"name": "opposition", "orb": 8},
149
+ ]
74
150
  """
75
- Default orbit for the axes aspects.
151
+ List of active aspects with their orbs according to Ciro Discepolo's affinity scoring methodology.
76
152
  """
@@ -1,94 +1,51 @@
1
- # -*- coding: utf-8 -*-
2
1
  """
3
- This is part of Kerykeion (C) 2025 Giacomo Battaglia
4
- """
5
-
6
-
7
- from json import load
8
- import logging
9
- from pathlib import Path
10
- from typing import Dict, Union
11
- from kerykeion.kr_types import KerykeionSettingsModel
12
- import functools
13
-
14
-
15
- def get_settings(new_settings_file: Union[Path, None, KerykeionSettingsModel, dict] = None) -> KerykeionSettingsModel:
16
- """
17
- This function is used to get the settings dict from the settings file.
18
- If no settings file is passed as argument, or the file is not found, it will fallback to:
19
- - The system wide config file, located in ~/.config/kerykeion/kr.config.json
20
- - The default config file, located in the package folder
21
-
22
- Args:
23
- new_settings_file (Union[Path, None], optional): The path of the settings file. Defaults to None.
24
-
25
- Returns:
26
- Dict: The settings dict
27
- """
2
+ Utilities for loading Kerykeion configuration settings from Python sources.
28
3
 
29
- if isinstance(new_settings_file, dict):
30
- return KerykeionSettingsModel(**new_settings_file)
31
- elif isinstance(new_settings_file, KerykeionSettingsModel):
32
- return new_settings_file
33
-
34
- # Config path we passed as argument
35
- if new_settings_file is not None:
36
- settings_file = new_settings_file
37
-
38
- if not settings_file.exists():
39
- raise FileNotFoundError(f"File {settings_file} does not exist")
4
+ The translation strings are now stored directly in :mod:`translation_strings`,
5
+ so the loader simply wraps those dictionaries (or any user-provided overrides).
6
+ """
40
7
 
41
- # System wide config path
42
- else:
43
- home_folder = Path.home()
44
- settings_file = home_folder / ".config" / "kerykeion" / "kr.config.json"
8
+ from __future__ import annotations
45
9
 
46
- # Fallback to the default config in the package
47
- if not settings_file.exists():
48
- settings_file = Path(__file__).parent / "kr.config.json"
10
+ from copy import deepcopy
11
+ from typing import Any, Mapping, Optional, cast
49
12
 
50
- logging.debug(f"Kerykeion config file path: {settings_file}")
51
- settings_dict = load_settings_file(settings_file)
13
+ from .translation_strings import LANGUAGE_SETTINGS
52
14
 
53
- return KerykeionSettingsModel(**settings_dict)
15
+ SettingsSource = Optional[Mapping[str, Any]]
54
16
 
55
17
 
56
- @functools.lru_cache
57
- def merge_settings(settings: KerykeionSettingsModel, new_settings: Dict) -> KerykeionSettingsModel:
18
+ def load_settings_mapping(settings_source: Optional[SettingsSource] = None) -> Mapping[str, Any]:
58
19
  """
59
- This function is used to merge the settings file with the default settings,
60
- it's useful to add new settings to the config file without breaking the old ones.
20
+ Resolve the configuration mapping from the provided source.
61
21
 
62
22
  Args:
63
- settings (KerykeionSettingsModel): The default settings
64
- new_settings (Dict): The new settings to add to the default ones
23
+ settings_source (Mapping | None): Optional overrides for the bundled
24
+ language settings. When provided, keys and nested dictionaries are
25
+ merged on top of the default values.
65
26
 
66
27
  Returns:
67
- KerykeionSettingsModel: The new settings
68
- """
69
- new_settings_dict = settings.model_dump() | new_settings
70
- return KerykeionSettingsModel(**new_settings_dict)
71
-
72
-
73
- @functools.lru_cache
74
- def load_settings_file(settings_file_path: str) -> dict:
28
+ Mapping[str, Any]: The resolved configuration dictionary.
75
29
  """
76
- This function is used to load the settings file from a path.
77
-
78
- Args:
79
- settings_file (Path): The path of the settings file
30
+ language_settings = deepcopy(LANGUAGE_SETTINGS)
80
31
 
81
- Returns:
82
- dict: The settings dict
83
- """
84
- with open(settings_file_path, "r", encoding="utf8") as f:
85
- settings_dict = load(f)
32
+ if settings_source:
33
+ overrides = cast(Mapping[str, Any], settings_source)
34
+ if "language_settings" in overrides:
35
+ overrides = cast(Mapping[str, Any], overrides["language_settings"])
36
+ language_settings = _deep_merge(language_settings, overrides)
86
37
 
87
- return settings_dict
38
+ return {"language_settings": language_settings}
88
39
 
89
40
 
90
- if __name__ == "__main__":
91
- from kerykeion.utilities import setup_logging
92
- setup_logging(level="debug")
41
+ def _deep_merge(base: Mapping[str, Any], overrides: Mapping[str, Any]) -> dict[str, Any]:
42
+ merged: dict[str, Any] = {key: deepcopy(value) for key, value in base.items()}
43
+ for key, value in overrides.items():
44
+ if key in merged and isinstance(merged[key], Mapping) and isinstance(value, Mapping):
45
+ merged[key] = _deep_merge(cast(Mapping[str, Any], merged[key]), cast(Mapping[str, Any], value))
46
+ else:
47
+ merged[key] = deepcopy(value)
48
+ return merged
93
49
 
94
- print(get_settings())
50
+ # Keep the public surface area explicit for downstream imports.
51
+ __all__ = ["SettingsSource", "load_settings_mapping", "LANGUAGE_SETTINGS"]