kerykeion 4.10.1__tar.gz → 4.11.1__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 (31) hide show
  1. {kerykeion-4.10.1 → kerykeion-4.11.1}/PKG-INFO +37 -17
  2. {kerykeion-4.10.1 → kerykeion-4.11.1}/README.md +36 -16
  3. kerykeion-4.11.1/kerykeion/__init__.py +16 -0
  4. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/aspects/aspects_utils.py +0 -12
  5. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/aspects/natal_aspects.py +1 -2
  6. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/aspects/synastry_aspects.py +1 -2
  7. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/astrological_subject.py +28 -4
  8. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/charts/kerykeion_chart_svg.py +17 -2
  9. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/charts/templates/chart.xml +1 -0
  10. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/kr_types/chart_types.py +1 -0
  11. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/kr_types/kr_literals.py +33 -1
  12. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/kr_types/kr_models.py +3 -1
  13. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/utilities.py +2 -2
  14. {kerykeion-4.10.1 → kerykeion-4.11.1}/pyproject.toml +1 -1
  15. kerykeion-4.10.1/kerykeion/__init__.py +0 -253
  16. {kerykeion-4.10.1 → kerykeion-4.11.1}/LICENSE +0 -0
  17. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/aspects/__init__.py +0 -0
  18. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/charts/__init__.py +0 -0
  19. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/charts/charts_utils.py +0 -0
  20. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/enums.py +0 -0
  21. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/fetch_geonames.py +0 -0
  22. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/kr_types/__init__.py +0 -0
  23. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/kr_types/kerykeion_exception.py +0 -0
  24. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/kr_types/settings_models.py +0 -0
  25. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/relationship_score.py +0 -0
  26. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/report.py +0 -0
  27. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/settings/__init__.py +0 -0
  28. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/settings/kerykeion_settings.py +0 -0
  29. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/settings/kr.config.json +0 -0
  30. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/sweph/README.md +0 -0
  31. {kerykeion-4.10.1 → kerykeion-4.11.1}/kerykeion/sweph/seas_18.se1 +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kerykeion
3
- Version: 4.10.1
3
+ Version: 4.11.1
4
4
  Summary: A python library for astrology.
5
5
  Home-page: https://github.com/g-battaglia/kerykeion
6
6
  License: AGPL-3.0
@@ -69,13 +69,13 @@ The core goal of this project is to provide a simple and easy approach to astrol
69
69
 
70
70
  Here's an example of a birthchart:
71
71
 
72
- ![Kanye Birth Chart](http://centuryboy.altervista.org/KanyeNatalChart.svg)
72
+ ![Kanye Birth Chart](https://www.kerykeion.net/assets/img/examples/birth-chart.svg)
73
73
 
74
74
  ## Web API
75
75
 
76
76
  If you want to use Kerykeion in a web application, I've created a web API for this purpose, you can find it here:
77
77
 
78
- **[AstrologerAPI](https://rapidapi.com/gbattaglia/api/astrologer/)**
78
+ **[AstrologerAPI](https://rapidapi.com/gbattaglia/api/astrologer/pricing)**
79
79
 
80
80
  It's [open source](https://github.com/g-battaglia/Astrologer-API), it's a way to support me and the project.
81
81
 
@@ -142,26 +142,32 @@ If you omit the nation, it will be set to "GB" by default, but the value is not
142
142
  ```python
143
143
  from kerykeion import AstrologicalSubject, KerykeionChartSVG
144
144
 
145
- first = AstrologicalSubject("Jack", 1990, 6, 15, 15, 15, "Roma")
146
- second = AstrologicalSubject("Jane", 1991, 10, 25, 21, 00, "Roma")
145
+ first = AstrologicalSubject("John Lennon", 1940, 10, 9, 10, 30, "Liverpool", "GB")
146
+ second = AstrologicalSubject("Paul McCartney", 1942, 6, 18, 15, 30, "Liverpool", "GB")
147
147
 
148
148
  # Set the type, it can be Natal, Synastry or Transit
149
+ synastry_chart = KerykeionChartSVG(first, "Synastry", second)
150
+ synastry_chart.makeSVG()
149
151
 
150
- name = KerykeionChartSVG(first, chart_type="Synastry", second_obj=second)
151
- name.makeSVG()
152
- print(len(name.aspects_list))
152
+ ```
153
153
 
154
- #> Generating kerykeion object for Jack...
155
- #> Generating kerykeion object for Jane...
156
- #> Jack birth location: Roma, 41.89193, 12.51133
157
- #> SVG Generated Correctly
158
- #> 38
154
+ ![John Lennon and Paul McCartney Synastry](https://www.kerykeion.net/assets/img/examples/synastry-chart.svg)
159
155
 
160
- ```
161
156
 
162
- ![Synastry Chart](http://centuryboy.altervista.org/JackComposite_Chart.svg)
157
+ Note: By default, the generated SVG file will be in the home directory! To change the destination directory:
163
158
 
164
- # Report
159
+ ```python
160
+ from kerykeion import AstrologicalSubject, KerykeionChartSVG
161
+
162
+ first = AstrologicalSubject("John Lennon", 1940, 10, 9, 10, 30, "Liverpool", "GB")
163
+ second = AstrologicalSubject("Paul McCartney", 1942, 6, 18, 15, 30, "Liverpool", "GB")
164
+
165
+ # Synastry Chart
166
+ synastry_chart = KerykeionChartSVG(first, "Synastry", second, new_output_directory=".")
167
+ synastry_chart.makeSVG()
168
+ ```
169
+
170
+ ## Report
165
171
 
166
172
  To print a report of all the data:
167
173
 
@@ -176,7 +182,7 @@ report.print_report()
176
182
 
177
183
  Returns:
178
184
 
179
- ```bash
185
+ ```txt
180
186
  +- Kerykeion report for Kanye -+
181
187
  +----------+------+-------------+-----------+----------+
182
188
  | Date | Time | Location | Longitude | Latitude |
@@ -256,6 +262,20 @@ More examples [here](https://www.kerykeion.net/docs/examples/sidereal-modes/).
256
262
 
257
263
  Full list of supported sidereal modes [here](https://www.kerykeion.net/pydocs/kerykeion/kr_types/kr_literals.html#SiderealMode).
258
264
 
265
+ ## Houses Systems
266
+
267
+ You can set the houses system in the AstrologicalSubject class:
268
+
269
+ ```python
270
+ johnny = AstrologicalSubject("Johnny Depp", 1963, 6, 9, 0, 0, "Owensboro", "US", houses_system="M")
271
+ ```
272
+
273
+ More examples [here](https://www.kerykeion.net/docs/examples/houses-systems/).
274
+
275
+ Full list of supported house systems [here](https://www.kerykeion.net/pydocs/kerykeion/kr_types/kr_literals.html#HousesSystem).
276
+
277
+ So far all the available houses system in the Swiss Ephemeris are supported but the Gauquelin Sectors.
278
+
259
279
  ## Documentation
260
280
 
261
281
  Most of the functions and the classes are self documented by the types and have docstrings.
@@ -32,13 +32,13 @@ The core goal of this project is to provide a simple and easy approach to astrol
32
32
 
33
33
  Here's an example of a birthchart:
34
34
 
35
- ![Kanye Birth Chart](http://centuryboy.altervista.org/KanyeNatalChart.svg)
35
+ ![Kanye Birth Chart](https://www.kerykeion.net/assets/img/examples/birth-chart.svg)
36
36
 
37
37
  ## Web API
38
38
 
39
39
  If you want to use Kerykeion in a web application, I've created a web API for this purpose, you can find it here:
40
40
 
41
- **[AstrologerAPI](https://rapidapi.com/gbattaglia/api/astrologer/)**
41
+ **[AstrologerAPI](https://rapidapi.com/gbattaglia/api/astrologer/pricing)**
42
42
 
43
43
  It's [open source](https://github.com/g-battaglia/Astrologer-API), it's a way to support me and the project.
44
44
 
@@ -105,26 +105,32 @@ If you omit the nation, it will be set to "GB" by default, but the value is not
105
105
  ```python
106
106
  from kerykeion import AstrologicalSubject, KerykeionChartSVG
107
107
 
108
- first = AstrologicalSubject("Jack", 1990, 6, 15, 15, 15, "Roma")
109
- second = AstrologicalSubject("Jane", 1991, 10, 25, 21, 00, "Roma")
108
+ first = AstrologicalSubject("John Lennon", 1940, 10, 9, 10, 30, "Liverpool", "GB")
109
+ second = AstrologicalSubject("Paul McCartney", 1942, 6, 18, 15, 30, "Liverpool", "GB")
110
110
 
111
111
  # Set the type, it can be Natal, Synastry or Transit
112
+ synastry_chart = KerykeionChartSVG(first, "Synastry", second)
113
+ synastry_chart.makeSVG()
112
114
 
113
- name = KerykeionChartSVG(first, chart_type="Synastry", second_obj=second)
114
- name.makeSVG()
115
- print(len(name.aspects_list))
115
+ ```
116
116
 
117
- #> Generating kerykeion object for Jack...
118
- #> Generating kerykeion object for Jane...
119
- #> Jack birth location: Roma, 41.89193, 12.51133
120
- #> SVG Generated Correctly
121
- #> 38
117
+ ![John Lennon and Paul McCartney Synastry](https://www.kerykeion.net/assets/img/examples/synastry-chart.svg)
122
118
 
123
- ```
124
119
 
125
- ![Synastry Chart](http://centuryboy.altervista.org/JackComposite_Chart.svg)
120
+ Note: By default, the generated SVG file will be in the home directory! To change the destination directory:
126
121
 
127
- # Report
122
+ ```python
123
+ from kerykeion import AstrologicalSubject, KerykeionChartSVG
124
+
125
+ first = AstrologicalSubject("John Lennon", 1940, 10, 9, 10, 30, "Liverpool", "GB")
126
+ second = AstrologicalSubject("Paul McCartney", 1942, 6, 18, 15, 30, "Liverpool", "GB")
127
+
128
+ # Synastry Chart
129
+ synastry_chart = KerykeionChartSVG(first, "Synastry", second, new_output_directory=".")
130
+ synastry_chart.makeSVG()
131
+ ```
132
+
133
+ ## Report
128
134
 
129
135
  To print a report of all the data:
130
136
 
@@ -139,7 +145,7 @@ report.print_report()
139
145
 
140
146
  Returns:
141
147
 
142
- ```bash
148
+ ```txt
143
149
  +- Kerykeion report for Kanye -+
144
150
  +----------+------+-------------+-----------+----------+
145
151
  | Date | Time | Location | Longitude | Latitude |
@@ -219,6 +225,20 @@ More examples [here](https://www.kerykeion.net/docs/examples/sidereal-modes/).
219
225
 
220
226
  Full list of supported sidereal modes [here](https://www.kerykeion.net/pydocs/kerykeion/kr_types/kr_literals.html#SiderealMode).
221
227
 
228
+ ## Houses Systems
229
+
230
+ You can set the houses system in the AstrologicalSubject class:
231
+
232
+ ```python
233
+ johnny = AstrologicalSubject("Johnny Depp", 1963, 6, 9, 0, 0, "Owensboro", "US", houses_system="M")
234
+ ```
235
+
236
+ More examples [here](https://www.kerykeion.net/docs/examples/houses-systems/).
237
+
238
+ Full list of supported house systems [here](https://www.kerykeion.net/pydocs/kerykeion/kr_types/kr_literals.html#HousesSystem).
239
+
240
+ So far all the available houses system in the Swiss Ephemeris are supported but the Gauquelin Sectors.
241
+
222
242
  ## Documentation
223
243
 
224
244
  Most of the functions and the classes are self documented by the types and have docstrings.
@@ -0,0 +1,16 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ This is part of Kerykeion (C) 2024 Giacomo Battaglia
4
+
5
+ .. include:: ../README.md
6
+ """
7
+
8
+ # Local
9
+ from .astrological_subject import AstrologicalSubject
10
+ from .charts.kerykeion_chart_svg import KerykeionChartSVG
11
+ from .kr_types import *
12
+ from .relationship_score import RelationshipScore
13
+ from .aspects import SynastryAspects, NatalAspects
14
+ from .report import Report
15
+ from .settings import KerykeionSettingsModel, get_settings
16
+ from .enums import Planets, Aspects, Signs
@@ -23,7 +23,6 @@ def get_aspect_from_two_points(aspects_settings: dict, point_one: Union[float, i
23
23
  if int(distance) <= aspects_settings[0]["orb"]:
24
24
  name = aspects_settings[0]["name"]
25
25
  aspect_degrees = aspects_settings[0]["degree"]
26
- color = aspects_settings[0]["color"]
27
26
  verdict = True
28
27
  aid = 0
29
28
 
@@ -34,7 +33,6 @@ def get_aspect_from_two_points(aspects_settings: dict, point_one: Union[float, i
34
33
  ):
35
34
  name = aspects_settings[1]["name"]
36
35
  aspect_degrees = aspects_settings[1]["degree"]
37
- color = aspects_settings[1]["color"]
38
36
  verdict = True
39
37
  aid = 1
40
38
 
@@ -45,7 +43,6 @@ def get_aspect_from_two_points(aspects_settings: dict, point_one: Union[float, i
45
43
  ):
46
44
  name = aspects_settings[2]["name"]
47
45
  aspect_degrees = aspects_settings[2]["degree"]
48
- color = aspects_settings[2]["color"]
49
46
  verdict = True
50
47
  aid = 2
51
48
 
@@ -56,7 +53,6 @@ def get_aspect_from_two_points(aspects_settings: dict, point_one: Union[float, i
56
53
  ):
57
54
  name = aspects_settings[3]["name"]
58
55
  aspect_degrees = aspects_settings[3]["degree"]
59
- color = aspects_settings[3]["color"]
60
56
  verdict = True
61
57
  aid = 3
62
58
 
@@ -67,7 +63,6 @@ def get_aspect_from_two_points(aspects_settings: dict, point_one: Union[float, i
67
63
  ):
68
64
  name = aspects_settings[4]["name"]
69
65
  aspect_degrees = aspects_settings[4]["degree"]
70
- color = aspects_settings[4]["color"]
71
66
  verdict = True
72
67
  aid = 4
73
68
 
@@ -78,7 +73,6 @@ def get_aspect_from_two_points(aspects_settings: dict, point_one: Union[float, i
78
73
  ):
79
74
  name = aspects_settings[5]["name"]
80
75
  aspect_degrees = aspects_settings[5]["degree"]
81
- color = aspects_settings[5]["color"]
82
76
  verdict = True
83
77
  aid = 5
84
78
 
@@ -89,7 +83,6 @@ def get_aspect_from_two_points(aspects_settings: dict, point_one: Union[float, i
89
83
  ):
90
84
  name = aspects_settings[6]["name"]
91
85
  aspect_degrees = aspects_settings[6]["degree"]
92
- color = aspects_settings[6]["color"]
93
86
  verdict = True
94
87
  aid = 6
95
88
 
@@ -100,7 +93,6 @@ def get_aspect_from_two_points(aspects_settings: dict, point_one: Union[float, i
100
93
  ):
101
94
  name = aspects_settings[7]["name"]
102
95
  aspect_degrees = aspects_settings[7]["degree"]
103
- color = aspects_settings[7]["color"]
104
96
  verdict = True
105
97
  aid = 7
106
98
 
@@ -111,7 +103,6 @@ def get_aspect_from_two_points(aspects_settings: dict, point_one: Union[float, i
111
103
  ):
112
104
  name = aspects_settings[8]["name"]
113
105
  aspect_degrees = aspects_settings[8]["degree"]
114
- color = aspects_settings[8]["color"]
115
106
  verdict = True
116
107
  aid = 8
117
108
 
@@ -122,7 +113,6 @@ def get_aspect_from_two_points(aspects_settings: dict, point_one: Union[float, i
122
113
  ):
123
114
  name = aspects_settings[9]["name"]
124
115
  aspect_degrees = aspects_settings[9]["degree"]
125
- color = aspects_settings[9]["color"]
126
116
  verdict = True
127
117
  aid = 9
128
118
 
@@ -133,7 +123,6 @@ def get_aspect_from_two_points(aspects_settings: dict, point_one: Union[float, i
133
123
  ):
134
124
  name = aspects_settings[10]["name"]
135
125
  aspect_degrees = aspects_settings[10]["degree"]
136
- color = aspects_settings[10]["color"]
137
126
  verdict = True
138
127
  aid = 10
139
128
 
@@ -150,7 +139,6 @@ def get_aspect_from_two_points(aspects_settings: dict, point_one: Union[float, i
150
139
  name,
151
140
  distance - aspect_degrees,
152
141
  aspect_degrees,
153
- color,
154
142
  aid,
155
143
  diff,
156
144
  )
@@ -52,7 +52,7 @@ class NatalAspects:
52
52
  for first in range(len(active_points_list)):
53
53
  # Generates the aspects list without repetitions
54
54
  for second in range(first + 1, len(active_points_list)):
55
- verdict, name, orbit, aspect_degrees, color, aid, diff = get_aspect_from_two_points(
55
+ verdict, name, orbit, aspect_degrees, aid, diff = get_aspect_from_two_points(
56
56
  self.aspects_settings, active_points_list[first]["abs_pos"], active_points_list[second]["abs_pos"]
57
57
  )
58
58
 
@@ -65,7 +65,6 @@ class NatalAspects:
65
65
  "aspect": name,
66
66
  "orbit": orbit,
67
67
  "aspect_degrees": aspect_degrees,
68
- "color": color,
69
68
  "aid": aid,
70
69
  "diff": diff,
71
70
  "p1": planet_id_decoder(self.celestial_points, active_points_list[first]["name"]),
@@ -60,7 +60,7 @@ class SynastryAspects(NatalAspects):
60
60
  for first in range(len(first_active_points_list)):
61
61
  # Generates the aspects list whitout repetitions
62
62
  for second in range(len(second_active_points_list)):
63
- verdict, name, orbit, aspect_degrees, color, aid, diff = get_aspect_from_two_points(
63
+ verdict, name, orbit, aspect_degrees, aid, diff = get_aspect_from_two_points(
64
64
  self.aspects_settings,
65
65
  first_active_points_list[first]["abs_pos"],
66
66
  second_active_points_list[second]["abs_pos"],
@@ -75,7 +75,6 @@ class SynastryAspects(NatalAspects):
75
75
  "aspect": name,
76
76
  "orbit": orbit,
77
77
  "aspect_degrees": aspect_degrees,
78
- "color": color,
79
78
  "aid": aid,
80
79
  "diff": diff,
81
80
  "p1": planet_id_decoder(
@@ -16,7 +16,8 @@ from kerykeion.kr_types import (
16
16
  LunarPhaseModel,
17
17
  KerykeionPointModel,
18
18
  PointType,
19
- SiderealMode
19
+ SiderealMode,
20
+ HousesSystemIdentifier
20
21
  )
21
22
  from kerykeion.utilities import (
22
23
  get_number_from_name,
@@ -30,6 +31,7 @@ from typing import Union, get_args
30
31
 
31
32
  DEFAULT_GEONAMES_USERNAME = "century.boy"
32
33
  DEFAULT_SIDEREAL_MODE = "FAGAN_BRADLEY"
34
+ DEFAULT_HOUSES_SYSTEM = "P"
33
35
 
34
36
 
35
37
  class AstrologicalSubject:
@@ -65,6 +67,7 @@ class AstrologicalSubject:
65
67
  The mode to use for the sidereal zodiac, according to the Swiss Ephemeris.
66
68
  Defaults to "FAGAN_BRADLEY".
67
69
  Available modes are visible in the SiderealMode Literal.
70
+ - houses_system_identifier (HousesSystemIdentifier, optional): The system to use for the calculation of the houses.
68
71
  """
69
72
 
70
73
  # Defined by the user
@@ -84,6 +87,8 @@ class AstrologicalSubject:
84
87
  online: bool
85
88
  zodiac_type: ZodiacType
86
89
  sidereal_mode: SiderealMode
90
+ houses_system_identifier: HousesSystemIdentifier
91
+ houses_system_name: str
87
92
 
88
93
  # Generated internally
89
94
  city_data: dict[str, str]
@@ -148,7 +153,8 @@ class AstrologicalSubject:
148
153
  online: bool = True,
149
154
  utc_datetime: Union[datetime, None] = None,
150
155
  disable_chiron: bool = False,
151
- sidereal_mode: Union[SiderealMode, None] = None
156
+ sidereal_mode: Union[SiderealMode, None] = None,
157
+ houses_system_identifier: HousesSystemIdentifier = DEFAULT_HOUSES_SYSTEM
152
158
  ) -> None:
153
159
  logging.debug("Starting Kerykeion")
154
160
 
@@ -176,6 +182,14 @@ class AstrologicalSubject:
176
182
  self.utc_datetime = utc_datetime
177
183
  self.disable_chiron = disable_chiron
178
184
  self.sidereal_mode = sidereal_mode
185
+ self.houses_system_identifier = houses_system_identifier
186
+
187
+ # House System check and setup --->
188
+ if self.houses_system_identifier not in get_args(HousesSystemIdentifier):
189
+ raise KerykeionException(f"\n* ERROR: '{self.houses_system_identifier}' is NOT a valid house system! Available systems are: *" + "\n" + str(get_args(HousesSystemIdentifier)))
190
+
191
+ self.houses_system_name = swe.house_name(self.houses_system_identifier.encode('ascii'))
192
+ # <--- House System check and setup
179
193
 
180
194
  # Zodiac Type and Sidereal mode checks and setup --->
181
195
  if zodiac_type and not zodiac_type in get_args(ZodiacType):
@@ -350,11 +364,17 @@ class AstrologicalSubject:
350
364
 
351
365
  if self.zodiac_type == "Sidereal":
352
366
  self.houses_degree_ut = swe.houses_ex(
353
- tjdut=self.julian_day, lat=self.lat, lon=self.lng, hsys=str.encode('P'), flags=swe.FLG_SIDEREAL
367
+ tjdut=self.julian_day,
368
+ lat=self.lat, lon=self.lng,
369
+ hsys=str.encode(self.houses_system_identifier),
370
+ flags=swe.FLG_SIDEREAL
354
371
  )[0]
372
+
355
373
  elif self.zodiac_type == "Tropic":
356
374
  self.houses_degree_ut = swe.houses(
357
- tjdut=self.julian_day, lat=self.lat, lon=self.lng, hsys=str.encode('P')
375
+ tjdut=self.julian_day, lat=self.lat,
376
+ lon=self.lng,
377
+ hsys=str.encode(self.houses_system_identifier)
358
378
  )[0]
359
379
 
360
380
  point_type: PointType = "House"
@@ -643,3 +663,7 @@ if __name__ == "__main__":
643
663
  # With Sidereal Zodiac
644
664
  johnny = AstrologicalSubject("Johnny Depp", 1963, 6, 9, 0, 0, "Owensboro", "US", zodiac_type="Sidereal", sidereal_mode="LAHIRI")
645
665
  print(johnny.json(dump=True, indent=2))
666
+
667
+ # With Morinus Houses
668
+ johnny = AstrologicalSubject("Johnny Depp", 1963, 6, 9, 0, 0, "Owensboro", "US", houses_system_identifier="M")
669
+ print(johnny.json(dump=True, indent=2))
@@ -1234,13 +1234,15 @@ class KerykeionChartSVG:
1234
1234
 
1235
1235
  # Bottom Left Corner
1236
1236
  if self.chart_type == "Natal" or self.chart_type == "ExternalNatal" or self.chart_type == "Synastry":
1237
- td["bottomLeft1"] = f"{self.user.zodiac_type if self.user.zodiac_type == 'Tropic' else self.user.zodiac_type + ' ' + self.user.sidereal_mode}"
1237
+ td["bottomLeft0"] = f"{self.user.zodiac_type if self.user.zodiac_type == 'Tropic' else self.user.zodiac_type + ' ' + self.user.sidereal_mode}"
1238
+ td["bottomLeft1"] = f"{self.user.houses_system_name}"
1238
1239
  td["bottomLeft2"] = f'{self.language_settings.get("lunar_phase", "Lunar Phase")}: {self.user.lunar_phase.moon_phase_name}'
1239
1240
  td["bottomLeft3"] = f'{self.language_settings.get("lunar_phase", "Lunar Phase")}: {self.language_settings.get("day", "Day")} {self.user.lunar_phase.get("moon_phase", "")}'
1240
1241
  td["bottomLeft4"] = ""
1241
1242
 
1242
1243
  else:
1243
- td["bottomLeft1"] = f"{self.user.zodiac_type if self.user.zodiac_type == 'Tropic' else self.user.zodiac_type + ' ' + self.user.sidereal_mode}"
1244
+ td["bottomLeft0"] = f"{self.user.zodiac_type if self.user.zodiac_type == 'Tropic' else self.user.zodiac_type + ' ' + self.user.sidereal_mode}"
1245
+ td["bottomLeft1"] = f"{self.user.houses_system_name}"
1244
1246
  td["bottomLeft2"] = f'{self.language_settings.get("lunar_phase", "Lunar Phase")}: {self.t_user.lunar_phase.moon_phase_name}'
1245
1247
  td["bottomLeft3"] = f'{self.language_settings.get("lunar_phase", "Lunar Phase")}: {self.language_settings.get("day", "Day")} {self.t_user.lunar_phase.get("moon_phase", "")}'
1246
1248
  td["bottomLeft4"] = ""
@@ -1456,3 +1458,16 @@ if __name__ == "__main__":
1456
1458
  sidereal_subject = AstrologicalSubject("John Lennon J2000", 1940, 10, 9, 10, 30, "Liverpool", "GB", zodiac_type="Sidereal", sidereal_mode="J2000")
1457
1459
  sidereal_chart = KerykeionChartSVG(sidereal_subject)
1458
1460
  sidereal_chart.makeSVG()
1461
+
1462
+ # House System Morinus
1463
+ morinus_house_subject = AstrologicalSubject("John Lennon - House System Morinus", 1940, 10, 9, 10, 30, "Liverpool", "GB", houses_system_identifier="M")
1464
+ morinus_house_chart = KerykeionChartSVG(morinus_house_subject)
1465
+ morinus_house_chart.makeSVG()
1466
+
1467
+ ## To check all the available house systems uncomment the following code:
1468
+ # from kerykeion.kr_types import HousesSystemIdentifier
1469
+ # from typing import get_args
1470
+ # for i in get_args(HousesSystemIdentifier):
1471
+ # alternatives_house_subject = AstrologicalSubject(f"John Lennon - House System {i}", 1940, 10, 9, 10, 30, "Liverpool", "GB", houses_system=i)
1472
+ # alternatives_house_chart = KerykeionChartSVG(alternatives_house_subject)
1473
+ # alternatives_house_chart.makeSVG()
@@ -21,6 +21,7 @@
21
21
  <text x="20" y="86" style="fill: $paper_color_0; font-size: 11px">$stringLat</text>
22
22
  <text x="20" y="98" style="fill: $paper_color_0; font-size: 11px">$stringLon</text>
23
23
  <text x="20" y="110" style="fill: $paper_color_0; font-size: 11px">$stringPosition</text>
24
+ <text x="20" y="466" style="fill: $paper_color_0; font-size: 10px">$bottomLeft0</text>
24
25
  <text x="20" y="480" style="fill: $paper_color_0; font-size: 10px">$bottomLeft1</text>
25
26
  <text x="20" y="494" style="fill: $paper_color_0; font-size: 10px">$bottomLeft2</text>
26
27
  <text x="20" y="508" style="fill: $paper_color_0; font-size: 10px">$bottomLeft3</text>
@@ -20,6 +20,7 @@ class ChartTemplateDictionary(TypedDict):
20
20
  viewbox: str
21
21
  stringTitle: str
22
22
  stringName: str
23
+ bottomLeft0: str
23
24
  bottomLeft1: str
24
25
  bottomLeft2: str
25
26
  bottomLeft3: str
@@ -54,4 +54,36 @@ LunarPhaseName = Literal["New Moon", "Waxing Crescent", "First Quarter", "Waxing
54
54
 
55
55
 
56
56
  SiderealMode = Literal["FAGAN_BRADLEY", "LAHIRI", "DELUCE", "RAMAN", "USHASHASHI", "KRISHNAMURTI", "DJWHAL_KHUL", "YUKTESHWAR", "JN_BHASIN", "BABYL_KUGLER1", "BABYL_KUGLER2", "BABYL_KUGLER3", "BABYL_HUBER", "BABYL_ETPSC", "ALDEBARAN_15TAU", "HIPPARCHOS", "SASSANIAN", "J2000", "J1900", "B1950"]
57
- """Literal type for Sidereal Modes, as known as Ayanamsa"""
57
+ """Literal type for Sidereal Modes, as known as Ayanamsa"""
58
+
59
+
60
+ HousesSystemIdentifier = Literal["A", "B", "C", "D", "F", "H", "I", "i", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y"]
61
+ """
62
+ Literal type for Houses Systems:
63
+
64
+ A = equal
65
+ B = Alcabitius
66
+ C = Campanus
67
+ D = equal (MC)
68
+ F = Carter poli-equ.
69
+ H = horizon/azimut
70
+ I = Sunshine
71
+ i = Sunshine/alt.
72
+ K = Koch
73
+ L = Pullen SD
74
+ M = Morinus
75
+ N = equal/1=Aries
76
+ O = Porphyry
77
+ P = Placidus
78
+ Q = Pullen SR
79
+ R = Regiomontanus
80
+ S = Sripati
81
+ T = Polich/Page
82
+ U = Krusinski-Pisa-Goelzer
83
+ V = equal/Vehlow
84
+ W = equal/whole sign
85
+ X = axial rotation system/Meridian houses
86
+ Y = APC houses
87
+
88
+ Usually the standard is Placidus (P)
89
+ """
@@ -7,7 +7,7 @@
7
7
  from typing import Union, Optional
8
8
  from pydantic import BaseModel
9
9
 
10
- from kerykeion.kr_types import LunarPhaseEmoji, LunarPhaseName, Planet, Houses, Quality, Element, Sign, ZodiacType, SignNumbers, HouseNumbers, PointType, SiderealMode
10
+ from kerykeion.kr_types import LunarPhaseEmoji, LunarPhaseName, Planet, Houses, Quality, Element, Sign, ZodiacType, SignNumbers, HouseNumbers, PointType, SiderealMode, HousesSystemIdentifier
11
11
 
12
12
  class SubscriptableBaseModel(BaseModel):
13
13
  """
@@ -66,6 +66,8 @@ class AstrologicalSubjectModel(SubscriptableBaseModel):
66
66
  tz_str: str
67
67
  zodiac_type: ZodiacType
68
68
  sidereal_mode: Union[SiderealMode, None]
69
+ houses_system_identifier: HousesSystemIdentifier
70
+ houses_system_name: str
69
71
  local_time: float
70
72
  utc_time: float
71
73
  julian_day: float
@@ -285,7 +285,7 @@ def get_planet_house(planet_position_degree: Union[int, float], houses_degree_ut
285
285
  elif check_if_point_between(houses_degree_ut_list[11], houses_degree_ut_list[0], planet_position_degree) == True:
286
286
  house = "Twelfth_House"
287
287
  else:
288
- raise ValueError("Error in house calculation, planet: ", planet_position_degree)
288
+ raise ValueError("Error in house calculation, planet: ", planet_position_degree, "houses: ", houses_degree_ut_list)
289
289
 
290
290
  return house
291
291
 
@@ -353,4 +353,4 @@ def get_moon_phase_name_from_phase_int(phase: int) -> LunarPhaseName:
353
353
  else:
354
354
  raise KerykeionException(f"Error in moon name calculation! Phase: {phase}")
355
355
 
356
- return result
356
+ return result
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "kerykeion"
3
- version = "4.10.1"
3
+ version = "4.11.1"
4
4
  authors = ["Giacomo Battaglia <battaglia.giacomo@yahoo.it>"]
5
5
  description = "A python library for astrology."
6
6
  license = "AGPL-3.0"
@@ -1,253 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- """
3
- <h1 align=center>Kerykeion</h1>
4
- <div align="center">
5
- <a href="#">
6
- <img src="https://img.shields.io/github/contributors/g-battaglia/kerykeion?color=blue&logo=github" alt="contributors">
7
- </a>
8
- <a href="#">
9
- <img src="https://img.shields.io/github/stars/g-battaglia/kerykeion.svg?logo=github" alt="stars">
10
- </a>
11
- <a href="#">
12
- <img src="https://img.shields.io/github/forks/g-battaglia/kerykeion.svg?logo=github" alt="forks">
13
- </a>
14
- <a href="https://pypi.org/project/kerykeion" target="_blank">
15
- <img src="https://visitor-badge.laobi.icu/badge?page_id=g-battaglia.kerykeion" alt="visitors"/>
16
- </a>
17
- <a href="https://pypi.org/project/kerykeion" target="_blank">
18
- <img src="https://img.shields.io/pypi/v/kerykeion?label=pypi%20package" alt="Package version">
19
- </a>
20
- <a href="https://pypi.org/project/kerykeion" target="_blank">
21
- <img src="https://img.shields.io/pypi/pyversions/kerykeion.svg" alt="Supported Python versions">
22
- </a>
23
- </div>
24
-
25
- &nbsp;
26
-
27
- Kerykeion is a python library for Astrology.
28
- It can calculate all the planet and house position,
29
- also it can calculate the aspects of a single persone or between two, you can set how many planets you
30
- need in the settings in the utility module.
31
- It also can generate an SVG of a birthchart, a synastry chart or a transit chart.
32
-
33
- The core goal of this project is to provide a simple and easy approach to astrology in a data driven way.
34
-
35
- Here's an example of a birthchart:
36
-
37
- ![Kanye Birth Chart](http://centuryboy.altervista.org/KanyeNatalChart.svg)
38
-
39
- ## Web API
40
-
41
- If you want to use Kerykeion in a web application, I've created a web API for this purpose, you can find it here:
42
-
43
- **[AstrologerAPI](https://rapidapi.com/gbattaglia/api/astrologer/)**
44
-
45
- It's [open source](https://github.com/g-battaglia/Astrologer-API), it's a way to support me and the project.
46
-
47
- ## Donate
48
-
49
- Maintaining this project is a lot of work, the Astrologer API doesn't nearly cover the costs of a software engineer working on this project full time. I do this because I love it, but until I can make this my full time job, I won't be able to spend as much time on it.
50
-
51
- If you want to support me, you can do it here:
52
-
53
- [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/kerykeion)
54
-
55
- ## Installation
56
-
57
- Kerykeion is a _Python 3.9_ package, make sure you have _Python 3.9_ or above installed on your system.
58
-
59
- ```bash
60
- pip3 install kerykeion
61
- ```
62
-
63
- ## Usage
64
-
65
- Here some examples:
66
-
67
- ```python
68
-
69
- # Import the main class for creating a kerykeion instance:
70
- from kerykeion import AstrologicalSubject
71
-
72
- # Create a kerykeion instance:
73
- # Args: Name, year, month, day, hour, minuts, city, nation(optional)
74
- kanye = AstrologicalSubject("Kanye", 1977, 6, 8, 8, 45, "Atlanta")
75
-
76
- # Get the information about the sun in the chart:
77
- # (The position of the planets always starts at 0)
78
- kanye.sun
79
-
80
- #> {'name': 'Sun', 'quality': 'Mutable', 'element': 'Air', 'sign': 'Gem', 'sign_num': 2, 'pos': 17.598992059774275, 'abs_pos': 77.59899205977428, 'emoji': '♊️', 'house': '12th House', 'retrograde': False}
81
-
82
- # Get information about the first house:
83
- kanye.first_house
84
-
85
- #> {'name': 'First_House', 'quality': 'Cardinal', 'element': 'Water', 'sign': 'Can', 'sign_num': 3, 'pos': 17.995779673209114, 'abs_pos': 107.99577967320911, 'emoji': '♋️'}
86
-
87
- # Get element of the moon sign:
88
- kanye.moon.element
89
-
90
- #> 'Water'
91
-
92
- ```
93
-
94
- **To avoid connecting to GeoNames (eg. avoiding hourly limit or no internet connection) you should instance kerykeion like this:**
95
-
96
- ```python
97
- kanye = AstrologicalSubject(
98
- "Kanye", 1977, 6, 8, 8, 45, lng=50, lat=50, tz_str="Europe/Rome", city="Rome"
99
- )
100
- ```
101
-
102
- The difference is that you have to pass the longitude, latitude and the timezone string, instead of the city and nation.
103
- If you omit the nation, it will be set to "GB" by default, but the value is not used for calculations. It's better to set it to the correct value though.
104
-
105
- ## Generate a SVG Chart
106
-
107
- ```python
108
- from kerykeion import AstrologicalSubject, KerykeionChartSVG
109
-
110
- first = AstrologicalSubject("Jack", 1990, 6, 15, 15, 15, "Roma")
111
- second = AstrologicalSubject("Jane", 1991, 10, 25, 21, 00, "Roma")
112
-
113
- # Set the type, it can be Natal, Synastry or Transit
114
-
115
- name = KerykeionChartSVG(first, chart_type="Synastry", second_obj=second)
116
- name.makeSVG()
117
- print(len(name.aspects_list))
118
-
119
- #> Generating kerykeion object for Jack...
120
- #> Generating kerykeion object for Jane...
121
- #> Jack birth location: Roma, 41.89193, 12.51133
122
- #> SVG Generated Correctly
123
- #> 38
124
-
125
- ```
126
-
127
- ![Synastry Chart](http://centuryboy.altervista.org/JackComposite_Chart.svg)
128
-
129
- # Report
130
-
131
- To print a report of all the data:
132
-
133
- ```python
134
- from kerykeion import Report, AstrologicalSubject
135
-
136
- kanye = AstrologicalSubject("Kanye", 1977, 6, 8, 8, 45, "Atlanta")
137
- report = Report(kanye)
138
- report.print_report()
139
-
140
- ```
141
-
142
- Returns:
143
-
144
- ```bash
145
- +- Kerykeion report for Kanye -+
146
- +----------+------+-------------+-----------+----------+
147
- | Date | Time | Location | Longitude | Latitude |
148
- +----------+------+-------------+-----------+----------+
149
- | 8/6/1977 | 8:45 | Atlanta, US | -84.38798 | 33.749 |
150
- +----------+------+-------------+-----------+----------+
151
- +-----------+------+-------+------+----------------+
152
- | Planet | Sign | Pos. | Ret. | House |
153
- +-----------+------+-------+------+----------------+
154
- | Sun | Gem | 17.6 | - | Twelfth_House |
155
- | Moon | Pis | 16.43 | - | Ninth_House |
156
- | Mercury | Tau | 26.29 | - | Eleventh_House |
157
- | Venus | Tau | 2.03 | - | Tenth_House |
158
- | Mars | Tau | 1.79 | - | Tenth_House |
159
- | Jupiter | Gem | 14.61 | - | Eleventh_House |
160
- | Saturn | Leo | 12.8 | - | Second_House |
161
- | Uranus | Sco | 8.27 | R | Fourth_House |
162
- | Neptune | Sag | 14.69 | R | Fifth_House |
163
- | Pluto | Lib | 11.45 | R | Fourth_House |
164
- | Mean_Node | Lib | 21.49 | R | Fourth_House |
165
- | True_Node | Lib | 22.82 | R | Fourth_House |
166
- | Chiron | Tau | 4.17 | - | Tenth_House |
167
- +-----------+------+-------+------+----------------+
168
- +----------------+------+----------+
169
- | House | Sign | Position |
170
- +----------------+------+----------+
171
- | First_House | Can | 18.0 |
172
- | Second_House | Leo | 9.51 |
173
- | Third_House | Vir | 4.02 |
174
- | Fourth_House | Lib | 3.98 |
175
- | Fifth_House | Sco | 9.39 |
176
- | Sixth_House | Sag | 15.68 |
177
- | Seventh_House | Cap | 18.0 |
178
- | Eighth_House | Aqu | 9.51 |
179
- | Ninth_House | Pis | 4.02 |
180
- | Tenth_House | Ari | 3.98 |
181
- | Eleventh_House | Tau | 9.39 |
182
- | Twelfth_House | Gem | 15.68 |
183
- +----------------+------+----------+
184
-
185
- ```
186
-
187
- And if you want to export it to a file:
188
-
189
- ```bash
190
- python3 your_script_name.py > file.txt
191
- ```
192
-
193
- ## Other exeples of possibles usecase
194
-
195
- ```python
196
- # Get all aspects between two persons:
197
-
198
- from kerykeion import SynastryAspects, AstrologicalSubject
199
- first = AstrologicalSubject("Jack", 1990, 6, 15, 15, 15, "Roma")
200
- second = AstrologicalSubject("Jane", 1991, 10, 25, 21, 00, "Roma")
201
-
202
- name = SynastryAspects(first, second)
203
- aspect_list = name.get_relevant_aspects()
204
- print(aspect_list[0])
205
-
206
- #> Generating kerykeion object for Jack...
207
- #> Generating kerykeion object for Jane...
208
- #> {'p1_name': 'Sun', 'p1_abs_pos': 84.17867971515636, 'p2_name': 'Sun', 'p2_abs_pos': 211.90472999502984, 'aspect': 'trine', 'orbit': 7.726050279873476, 'aspect_degrees': 120, 'color': '#36d100', 'aid': 6, 'diff': 127.72605027987348, 'p1': 0, 'p2': 0}
209
-
210
- ```
211
-
212
- ## Ayanamsa (Sidereal Modes)
213
-
214
- You can set the zodiac type and the sidereal mode in the AstrologicalSubject class:
215
-
216
- ```python
217
- johnny = AstrologicalSubject("Johnny Depp", 1963, 6, 9, 0, 0, "Owensboro", "US", zodiac_type="Sidereal", sidereal_mode="LAHIRI")
218
- ```
219
-
220
- ## Documentation
221
-
222
- Most of the functions and the classes are self documented by the types and have docstrings.
223
- An auto-generated documentation [is available here](https://www.kerykeion.net/pydocs/kerykeion.html).
224
-
225
- Sooner or later I'll try to write an extensive documentation.
226
-
227
- ## Development
228
-
229
- You can clone this repository or download a zip file using the right side buttons.
230
-
231
- ## Contributing
232
-
233
- Feel free to contribute to the code!
234
-
235
- ## License
236
-
237
- This project is licensed under the AGPL-3.0 License.
238
- To understand how this impacts your use of the software, please see the [LICENSE](LICENSE) file for details.
239
- If you have questions, you can reach out to me at my [email](mailto:battaglia.giacomo@yahoo.it?subject=Kerykeion) address.
240
- As a rule of thumb, if you are using this library in a project, you should open source the code of the project with a compatible license.
241
-
242
- You can implement the logic of kerykeion in your project and also keep it closed source by using a third party API, like the [AstrologerAPI](https://rapidapi.com/gbattaglia/api/astrologer/). The AstrologerAPI is AGPL-3.0 compliant. Subscribing to the API is also, currently, the best way to support the project.
243
- """
244
-
245
- # Local
246
- from .astrological_subject import AstrologicalSubject
247
- from .charts.kerykeion_chart_svg import KerykeionChartSVG
248
- from .kr_types import *
249
- from .relationship_score import RelationshipScore
250
- from .aspects import SynastryAspects, NatalAspects
251
- from .report import Report
252
- from .settings import KerykeionSettingsModel, get_settings
253
- from .enums import Planets, Aspects, Signs
File without changes