kerykeion 4.26.3__py3-none-any.whl → 5.0.0__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 (76) hide show
  1. kerykeion/__init__.py +54 -11
  2. kerykeion/aspects/__init__.py +5 -2
  3. kerykeion/aspects/aspects_factory.py +569 -0
  4. kerykeion/aspects/aspects_utils.py +81 -8
  5. kerykeion/astrological_subject_factory.py +1897 -0
  6. kerykeion/backword.py +773 -0
  7. kerykeion/chart_data_factory.py +549 -0
  8. kerykeion/charts/chart_drawer.py +2601 -0
  9. kerykeion/charts/charts_utils.py +948 -177
  10. kerykeion/charts/draw_planets.py +602 -351
  11. kerykeion/charts/templates/aspect_grid_only.xml +328 -202
  12. kerykeion/charts/templates/chart.xml +432 -272
  13. kerykeion/charts/templates/wheel_only.xml +350 -214
  14. kerykeion/charts/themes/black-and-white.css +148 -0
  15. kerykeion/charts/themes/classic.css +107 -76
  16. kerykeion/charts/themes/dark-high-contrast.css +145 -107
  17. kerykeion/charts/themes/dark.css +146 -107
  18. kerykeion/charts/themes/light.css +146 -103
  19. kerykeion/charts/themes/strawberry.css +158 -0
  20. kerykeion/composite_subject_factory.py +253 -51
  21. kerykeion/ephemeris_data_factory.py +434 -0
  22. kerykeion/fetch_geonames.py +27 -8
  23. kerykeion/house_comparison/__init__.py +6 -0
  24. kerykeion/house_comparison/house_comparison_factory.py +103 -0
  25. kerykeion/house_comparison/house_comparison_utils.py +126 -0
  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 -132
  30. kerykeion/kr_types/kr_models.py +14 -318
  31. kerykeion/kr_types/settings_models.py +15 -203
  32. kerykeion/planetary_return_factory.py +805 -0
  33. kerykeion/relationship_score_factory.py +301 -0
  34. kerykeion/report.py +751 -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 +605 -0
  40. kerykeion/schemas/settings_models.py +180 -0
  41. kerykeion/settings/__init__.py +20 -1
  42. kerykeion/settings/chart_defaults.py +444 -0
  43. kerykeion/settings/config_constants.py +117 -12
  44. kerykeion/settings/kerykeion_settings.py +31 -73
  45. kerykeion/settings/translation_strings.py +1479 -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 +393 -114
  57. kerykeion-5.0.0.dist-info/METADATA +1176 -0
  58. kerykeion-5.0.0.dist-info/RECORD +63 -0
  59. {kerykeion-4.26.3.dist-info → kerykeion-5.0.0.dist-info}/WHEEL +1 -1
  60. kerykeion/aspects/natal_aspects.py +0 -172
  61. kerykeion/aspects/synastry_aspects.py +0 -124
  62. kerykeion/aspects/transits_time_range.py +0 -41
  63. kerykeion/astrological_subject.py +0 -841
  64. kerykeion/charts/kerykeion_chart_svg.py +0 -1219
  65. kerykeion/enums.py +0 -57
  66. kerykeion/ephemeris_data.py +0 -242
  67. kerykeion/kr_types/chart_types.py +0 -95
  68. kerykeion/relationship_score/__init__.py +0 -2
  69. kerykeion/relationship_score/relationship_score.py +0 -175
  70. kerykeion/relationship_score/relationship_score_factory.py +0 -230
  71. kerykeion/settings/kr.config.json +0 -1258
  72. kerykeion/transits_time_range.py +0 -124
  73. kerykeion-4.26.3.dist-info/METADATA +0 -634
  74. kerykeion-4.26.3.dist-info/RECORD +0 -45
  75. kerykeion-4.26.3.dist-info/entry_points.txt +0 -3
  76. {kerykeion-4.26.3.dist-info → kerykeion-5.0.0.dist-info/licenses}/LICENSE +0 -0
@@ -1,8 +1,9 @@
1
- from kerykeion.kr_types.kr_literals import Planet, AxialCusps, AspectName
2
- from kerykeion.kr_types.kr_models import ActiveAspect
3
- from typing import List, Union
1
+ from kerykeion.schemas.kr_literals import AstrologicalPoint
2
+ from kerykeion.schemas.kr_models import ActiveAspect
3
+ from typing import List
4
4
 
5
- DEFAULT_ACTIVE_POINTS: List[Union[Planet, AxialCusps]] = [
5
+
6
+ DEFAULT_ACTIVE_POINTS: List[AstrologicalPoint] = [
6
7
  "Sun",
7
8
  "Moon",
8
9
  "Mercury",
@@ -13,19 +14,91 @@ DEFAULT_ACTIVE_POINTS: List[Union[Planet, AxialCusps]] = [
13
14
  "Uranus",
14
15
  "Neptune",
15
16
  "Pluto",
16
- "Mean_Node",
17
- # "True_Node",
17
+ # "Mean_North_Lunar_Node",
18
+ "True_North_Lunar_Node",
19
+ # "Mean_South_Lunar_Node",
20
+ "True_South_Lunar_Node",
18
21
  "Chiron",
22
+ "Mean_Lilith",
23
+ # "True_Lilith",
24
+ # "Earth",
25
+ # "Pholus",
26
+ # "Ceres",
27
+ # "Pallas",
28
+ # "Juno",
29
+ # "Vesta",
30
+ # "Eris",
31
+ # "Sedna",
32
+ # "Haumea",
33
+ # "Makemake",
34
+ # "Ixion",
35
+ # "Orcus",
36
+ # "Quaoar",
37
+ # "Regulus",
38
+ # "Spica",
19
39
  "Ascendant",
20
40
  "Medium_Coeli",
21
- # "Descendant",
22
- # "Imum_Coeli",
23
- "Mean_Lilith",
24
- "Mean_South_Node",
25
- # "True_South_Node"
41
+ "Descendant",
42
+ "Imum_Coeli",
43
+ # "Vertex",
44
+ # "Anti_Vertex",
45
+ # "Pars_Fortunae",
46
+ # "Pars_Spiritus",
47
+ # "Pars_Amoris",
48
+ # "Pars_Fidei"
26
49
  ]
27
50
  """
28
51
  Default list of active points in the charts or aspects calculations.
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.
29
102
  """
30
103
 
31
104
  DEFAULT_ACTIVE_ASPECTS: List[ActiveAspect] = [
@@ -43,5 +116,37 @@ DEFAULT_ACTIVE_ASPECTS: List[ActiveAspect] = [
43
116
  ]
44
117
  """
45
118
  Default list of active aspects in the aspects calculations.
46
- 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.
120
+ """
121
+
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
+ ]
150
+ """
151
+ List of active aspects with their orbs according to Ciro Discepolo's affinity scoring methodology.
47
152
  """
@@ -1,93 +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
- """
28
-
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
2
+ Utilities for loading Kerykeion configuration settings from Python sources.
37
3
 
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
- def merge_settings(settings: KerykeionSettingsModel, new_settings: Dict) -> KerykeionSettingsModel:
18
+ def load_settings_mapping(settings_source: Optional[SettingsSource] = None) -> Mapping[str, Any]:
57
19
  """
58
- This function is used to merge the settings file with the default settings,
59
- 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.
60
21
 
61
22
  Args:
62
- settings (KerykeionSettingsModel): The default settings
63
- 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.
64
26
 
65
27
  Returns:
66
- KerykeionSettingsModel: The new settings
67
- """
68
- new_settings_dict = settings.model_dump() | new_settings
69
- return KerykeionSettingsModel(**new_settings_dict)
70
-
71
-
72
- @functools.lru_cache
73
- def load_settings_file(settings_file_path: str) -> dict:
28
+ Mapping[str, Any]: The resolved configuration dictionary.
74
29
  """
75
- This function is used to load the settings file from a path.
30
+ language_settings = deepcopy(LANGUAGE_SETTINGS)
76
31
 
77
- Args:
78
- settings_file (Path): The path of the settings file
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)
79
37
 
80
- Returns:
81
- dict: The settings dict
82
- """
83
- with open(settings_file_path, "r", encoding="utf8") as f:
84
- settings_dict = load(f)
38
+ return {"language_settings": language_settings}
85
39
 
86
- return settings_dict
87
40
 
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
88
49
 
89
- if __name__ == "__main__":
90
- from kerykeion.utilities import setup_logging
91
- setup_logging(level="debug")
92
50
 
93
- print(get_settings())
51
+ __all__ = ["SettingsSource", "load_settings_mapping", "LANGUAGE_SETTINGS"]