kerykeion 4.25.2__tar.gz → 4.25.4__tar.gz

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 (42) hide show
  1. {kerykeion-4.25.2 → kerykeion-4.25.4}/PKG-INFO +11 -10
  2. {kerykeion-4.25.2 → kerykeion-4.25.4}/README.md +10 -9
  3. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/composite_subject_factory.py +12 -6
  4. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/utilities.py +50 -0
  5. {kerykeion-4.25.2 → kerykeion-4.25.4}/pyproject.toml +1 -1
  6. {kerykeion-4.25.2 → kerykeion-4.25.4}/LICENSE +0 -0
  7. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/__init__.py +0 -0
  8. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/aspects/__init__.py +0 -0
  9. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/aspects/aspects_utils.py +0 -0
  10. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/aspects/natal_aspects.py +0 -0
  11. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/aspects/synastry_aspects.py +0 -0
  12. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/astrological_subject.py +0 -0
  13. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/charts/__init__.py +0 -0
  14. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/charts/charts_utils.py +0 -0
  15. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/charts/draw_planets.py +0 -0
  16. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/charts/kerykeion_chart_svg.py +0 -0
  17. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/charts/templates/aspect_grid_only.xml +0 -0
  18. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/charts/templates/chart.xml +0 -0
  19. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/charts/templates/wheel_only.xml +0 -0
  20. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/charts/themes/classic.css +0 -0
  21. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/charts/themes/dark-high-contrast.css +0 -0
  22. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/charts/themes/dark.css +0 -0
  23. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/charts/themes/light.css +0 -0
  24. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/enums.py +0 -0
  25. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/ephemeris_data.py +0 -0
  26. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/fetch_geonames.py +0 -0
  27. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/kr_types/__init__.py +0 -0
  28. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/kr_types/chart_types.py +0 -0
  29. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/kr_types/kerykeion_exception.py +0 -0
  30. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/kr_types/kr_literals.py +0 -0
  31. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/kr_types/kr_models.py +0 -0
  32. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/kr_types/settings_models.py +0 -0
  33. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/relationship_score/__init__.py +0 -0
  34. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/relationship_score/relationship_score.py +0 -0
  35. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/relationship_score/relationship_score_factory.py +0 -0
  36. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/report.py +0 -0
  37. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/settings/__init__.py +0 -0
  38. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/settings/config_constants.py +0 -0
  39. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/settings/kerykeion_settings.py +0 -0
  40. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/settings/kr.config.json +0 -0
  41. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/sweph/README.md +0 -0
  42. {kerykeion-4.25.2 → kerykeion-4.25.4}/kerykeion/sweph/seas_18.se1 +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kerykeion
3
- Version: 4.25.2
3
+ Version: 4.25.4
4
4
  Summary: A python library for astrology.
5
5
  Home-page: https://www.kerykeion.net/
6
6
  License: AGPL-3.0
@@ -39,15 +39,16 @@ Description-Content-Type: text/markdown
39
39
 
40
40
  <h1 align=center>Kerykeion</h1>
41
41
  <div align="center">
42
- <img src="https://img.shields.io/github/contributors/g-battaglia/kerykeion?color=blue&logo=github" alt="contributors">
43
42
  <img src="https://img.shields.io/github/stars/g-battaglia/kerykeion.svg?logo=github" alt="stars">
44
43
  <img src="https://img.shields.io/github/forks/g-battaglia/kerykeion.svg?logo=github" alt="forks">
45
- <img src="https://static.pepy.tech/badge/kerykeion" alt="PyPI Downloads">
46
- <img src="https://visitor-badge.laobi.icu/badge?page_id=g-battaglia.kerykeion" alt="visitors"/>
44
+
45
+ </div>
46
+ <div align="center">
47
+ <img src="https://static.pepy.tech/badge/kerykeion/month" alt="PyPI Downloads">
48
+ <img src="https://static.pepy.tech/badge/kerykeion/week" alt="PyPI Downloads">
49
+ <img src="https://img.shields.io/github/contributors/g-battaglia/kerykeion?color=blue&logo=github" alt="contributors">
47
50
  <img src="https://img.shields.io/pypi/v/kerykeion?label=pypi%20package" alt="Package version">
48
51
  <img src="https://img.shields.io/pypi/pyversions/kerykeion.svg" alt="Supported Python versions">
49
- <img src="https://img.shields.io/github/license/g-battaglia/kerykeion" alt="License">
50
-
51
52
  </div>
52
53
 
53
54
  &nbsp;
@@ -147,7 +148,7 @@ birth_chart_svg.makeSVG()
147
148
  ```
148
149
 
149
150
  The SVG file will be saved in the home directory.
150
- ![John Lennon Birth Chart](https://www.kerykeion.net/docs/assets/img/examples/birth-chart.svg)
151
+ ![John Lennon Birth Chart](https://www.kerykeion.net/img/examples/birth-chart.svg)
151
152
 
152
153
  ### Synastry Chart
153
154
 
@@ -158,12 +159,12 @@ first = AstrologicalSubject("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB
158
159
  second = AstrologicalSubject("Paul McCartney", 1942, 6, 18, 15, 30, "Liverpool", "GB")
159
160
 
160
161
  # Set the type, it can be Natal, Synastry or Transit
161
- synastry_chart = KerykeionChartSVG(first, "Synastry", second)
162
+ synastry_chart = KerykeionChartSVG(first, "Synastry", second)
162
163
  synastry_chart.makeSVG()
163
164
 
164
165
  ```
165
166
 
166
- ![John Lennon and Paul McCartney Synastry](https://www.kerykeion.net/docs/assets/img/examples/synastry-chart.svg)
167
+ ![John Lennon and Paul McCartney Synastry](https://www.kerykeion.net/img/examples/synastry-chart.svg)
167
168
 
168
169
 
169
170
  ### Transit Chart
@@ -183,7 +184,7 @@ transit_chart.makeSVG()
183
184
  ### Composite Chart
184
185
 
185
186
  ```python
186
- from kerykeion import CompositeChart, AstrologicalSubject, KerykeionChartSVG
187
+ from kerykeion import CompositeSubjectFactory, AstrologicalSubject, KerykeionChartSVG
187
188
 
188
189
  angelina = AstrologicalSubject("Angelina Jolie", 1975, 6, 4, 9, 9, "Los Angeles", "US", lng=-118.15, lat=34.03, tz_str="America/Los_Angeles")
189
190
  brad = AstrologicalSubject("Brad Pitt", 1963, 12, 18, 6, 31, "Shawnee", "US", lng=-96.56, lat=35.20, tz_str="America/Chicago")
@@ -1,14 +1,15 @@
1
1
  <h1 align=center>Kerykeion</h1>
2
2
  <div align="center">
3
- <img src="https://img.shields.io/github/contributors/g-battaglia/kerykeion?color=blue&logo=github" alt="contributors">
4
3
  <img src="https://img.shields.io/github/stars/g-battaglia/kerykeion.svg?logo=github" alt="stars">
5
4
  <img src="https://img.shields.io/github/forks/g-battaglia/kerykeion.svg?logo=github" alt="forks">
6
- <img src="https://static.pepy.tech/badge/kerykeion" alt="PyPI Downloads">
7
- <img src="https://visitor-badge.laobi.icu/badge?page_id=g-battaglia.kerykeion" alt="visitors"/>
5
+
6
+ </div>
7
+ <div align="center">
8
+ <img src="https://static.pepy.tech/badge/kerykeion/month" alt="PyPI Downloads">
9
+ <img src="https://static.pepy.tech/badge/kerykeion/week" alt="PyPI Downloads">
10
+ <img src="https://img.shields.io/github/contributors/g-battaglia/kerykeion?color=blue&logo=github" alt="contributors">
8
11
  <img src="https://img.shields.io/pypi/v/kerykeion?label=pypi%20package" alt="Package version">
9
12
  <img src="https://img.shields.io/pypi/pyversions/kerykeion.svg" alt="Supported Python versions">
10
- <img src="https://img.shields.io/github/license/g-battaglia/kerykeion" alt="License">
11
-
12
13
  </div>
13
14
 
14
15
  &nbsp;
@@ -108,7 +109,7 @@ birth_chart_svg.makeSVG()
108
109
  ```
109
110
 
110
111
  The SVG file will be saved in the home directory.
111
- ![John Lennon Birth Chart](https://www.kerykeion.net/docs/assets/img/examples/birth-chart.svg)
112
+ ![John Lennon Birth Chart](https://www.kerykeion.net/img/examples/birth-chart.svg)
112
113
 
113
114
  ### Synastry Chart
114
115
 
@@ -119,12 +120,12 @@ first = AstrologicalSubject("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB
119
120
  second = AstrologicalSubject("Paul McCartney", 1942, 6, 18, 15, 30, "Liverpool", "GB")
120
121
 
121
122
  # Set the type, it can be Natal, Synastry or Transit
122
- synastry_chart = KerykeionChartSVG(first, "Synastry", second)
123
+ synastry_chart = KerykeionChartSVG(first, "Synastry", second)
123
124
  synastry_chart.makeSVG()
124
125
 
125
126
  ```
126
127
 
127
- ![John Lennon and Paul McCartney Synastry](https://www.kerykeion.net/docs/assets/img/examples/synastry-chart.svg)
128
+ ![John Lennon and Paul McCartney Synastry](https://www.kerykeion.net/img/examples/synastry-chart.svg)
128
129
 
129
130
 
130
131
  ### Transit Chart
@@ -144,7 +145,7 @@ transit_chart.makeSVG()
144
145
  ### Composite Chart
145
146
 
146
147
  ```python
147
- from kerykeion import CompositeChart, AstrologicalSubject, KerykeionChartSVG
148
+ from kerykeion import CompositeSubjectFactory, AstrologicalSubject, KerykeionChartSVG
148
149
 
149
150
  angelina = AstrologicalSubject("Angelina Jolie", 1975, 6, 4, 9, 9, "Los Angeles", "US", lng=-118.15, lat=34.03, tz_str="America/Los_Angeles")
150
151
  brad = AstrologicalSubject("Brad Pitt", 1963, 12, 18, 6, 31, "Shawnee", "US", lng=-96.56, lat=35.20, tz_str="America/Chicago")
@@ -8,7 +8,8 @@ from kerykeion.utilities import (
8
8
  get_kerykeion_point_from_degree,
9
9
  get_planet_house,
10
10
  circular_mean,
11
- calculate_moon_phase
11
+ calculate_moon_phase,
12
+ circular_sort
12
13
  )
13
14
 
14
15
 
@@ -132,17 +133,22 @@ class CompositeSubjectFactory:
132
133
  house_degree_list_ut = []
133
134
  for house in self.first_subject.houses_names_list:
134
135
  house_lower = house.lower()
135
- self[house_lower] = get_kerykeion_point_from_degree(
136
+ house_degree_list_ut.append(
136
137
  circular_mean(
137
138
  self.first_subject[house_lower]["abs_pos"],
138
139
  self.second_subject[house_lower]["abs_pos"]
139
- ),
140
- house,
140
+ )
141
+ )
142
+ house_degree_list_ut = circular_sort(house_degree_list_ut)
143
+
144
+ for house_index, house_name in enumerate(self.first_subject.houses_names_list):
145
+ house_lower = house_name.lower()
146
+ self[house_lower] = get_kerykeion_point_from_degree(
147
+ house_degree_list_ut[house_index],
148
+ house_name,
141
149
  "House"
142
150
  )
143
- house_degree_list_ut.append(self[house_lower]["abs_pos"])
144
151
 
145
- house_degree_list_ut = sorted(house_degree_list_ut)
146
152
 
147
153
  # Planets
148
154
  common_planets = []
@@ -390,3 +390,53 @@ def calculate_moon_phase(moon_abs_pos: float, sun_abs_pos: float) -> LunarPhaseM
390
390
  }
391
391
 
392
392
  return LunarPhaseModel(**lunar_phase_dictionary)
393
+
394
+
395
+ def circular_sort(degrees: list[Union[int, float]]) -> list[Union[int, float]]:
396
+ """
397
+ Sort a list of degrees in a circular manner, starting from the first element
398
+ and progressing clockwise around the circle.
399
+
400
+ Args:
401
+ degrees: A list of numeric values representing degrees
402
+
403
+ Returns:
404
+ A list sorted based on circular clockwise progression from the first element
405
+
406
+ Raises:
407
+ ValueError: If the list is empty or contains non-numeric values
408
+ """
409
+ # Input validation
410
+ if not degrees:
411
+ raise ValueError("Input list cannot be empty")
412
+
413
+ if not all(isinstance(degree, (int, float)) for degree in degrees):
414
+ invalid = next(d for d in degrees if not isinstance(d, (int, float)))
415
+ raise ValueError(f"All elements must be numeric, found: {invalid} of type {type(invalid).__name__}")
416
+
417
+ # If list has 0 or 1 element, return it as is
418
+ if len(degrees) <= 1:
419
+ return degrees.copy()
420
+
421
+ # Save the first element as the reference
422
+ reference = degrees[0]
423
+
424
+ # Define a function to calculate clockwise distance from reference
425
+ def clockwise_distance(angle: Union[int, float]) -> Union[int, float]:
426
+ # Normalize angles to 0-360 range
427
+ ref_norm = reference % 360
428
+ angle_norm = angle % 360
429
+
430
+ # Calculate clockwise distance
431
+ distance = angle_norm - ref_norm
432
+ if distance < 0:
433
+ distance += 360
434
+
435
+ return distance
436
+
437
+ # Sort the rest of the elements based on circular distance
438
+ remaining = degrees[1:]
439
+ sorted_remaining = sorted(remaining, key=clockwise_distance)
440
+
441
+ # Return the reference followed by the sorted remaining elements
442
+ return [reference] + sorted_remaining
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "kerykeion"
3
- version = "4.25.2"
3
+ version = "4.25.4"
4
4
  authors = ["Giacomo Battaglia <kerykeion.astrology@gmail.com>"]
5
5
  description = "A python library for astrology."
6
6
  license = "AGPL-3.0"
File without changes