kerykeion 4.4.1__py3-none-any.whl → 4.5.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.
- kerykeion/__init__.py +1 -0
- kerykeion/astrological_subject.py +52 -15
- kerykeion/enums.py +50 -0
- kerykeion/kr_types/kr_models.py +1 -1
- kerykeion/utilities.py +15 -10
- {kerykeion-4.4.1.dist-info → kerykeion-4.5.0.dist-info}/METADATA +2 -1
- {kerykeion-4.4.1.dist-info → kerykeion-4.5.0.dist-info}/RECORD +10 -9
- {kerykeion-4.4.1.dist-info → kerykeion-4.5.0.dist-info}/WHEEL +1 -1
- {kerykeion-4.4.1.dist-info → kerykeion-4.5.0.dist-info}/LICENSE +0 -0
- {kerykeion-4.4.1.dist-info → kerykeion-4.5.0.dist-info}/entry_points.txt +0 -0
kerykeion/__init__.py
CHANGED
|
@@ -51,6 +51,8 @@ class AstrologicalSubject:
|
|
|
51
51
|
- utc_datetime (datetime, optional): An alternative way of constructing the object,
|
|
52
52
|
if you know the UTC datetime but do not have easy access to e.g. timezone identifier
|
|
53
53
|
_ Defaults to None.
|
|
54
|
+
- disable_chiron (bool, optional): Disables the calculation of Chiron. Defaults to False.
|
|
55
|
+
Chiron calculation can create some issues with the Swiss Ephemeris when the date is too far in the past.
|
|
54
56
|
"""
|
|
55
57
|
|
|
56
58
|
# Defined by the user
|
|
@@ -91,7 +93,7 @@ class AstrologicalSubject:
|
|
|
91
93
|
pluto: KerykeionPointModel
|
|
92
94
|
true_node: KerykeionPointModel
|
|
93
95
|
mean_node: KerykeionPointModel
|
|
94
|
-
chiron: KerykeionPointModel
|
|
96
|
+
chiron: KerykeionPointModel | None
|
|
95
97
|
|
|
96
98
|
# Houses
|
|
97
99
|
first_house: KerykeionPointModel
|
|
@@ -123,15 +125,16 @@ class AstrologicalSubject:
|
|
|
123
125
|
day: int = now.day,
|
|
124
126
|
hour: int = now.hour,
|
|
125
127
|
minute: int = now.minute,
|
|
126
|
-
city: str =
|
|
127
|
-
nation: str =
|
|
128
|
-
lng: Union[int, float] =
|
|
129
|
-
lat: Union[int, float] =
|
|
130
|
-
tz_str: str =
|
|
128
|
+
city: Union[str, None] = None,
|
|
129
|
+
nation: Union[str, None] = None,
|
|
130
|
+
lng: Union[int, float, None] = None,
|
|
131
|
+
lat: Union[int, float, None] = None,
|
|
132
|
+
tz_str: Union[str, None] = None,
|
|
131
133
|
geonames_username: Union[str, None] = None,
|
|
132
134
|
zodiac_type: ZodiacType = "Tropic",
|
|
133
135
|
online: bool = True,
|
|
134
136
|
utc_datetime: Union[datetime, None] = None,
|
|
137
|
+
disable_chiron: bool = False
|
|
135
138
|
) -> None:
|
|
136
139
|
logging.debug("Starting Kerykeion")
|
|
137
140
|
|
|
@@ -158,6 +161,7 @@ class AstrologicalSubject:
|
|
|
158
161
|
self.json_dir = Path.home()
|
|
159
162
|
self.geonames_username = geonames_username
|
|
160
163
|
self.utc_datetime = utc_datetime
|
|
164
|
+
self.disable_chiron = disable_chiron
|
|
161
165
|
|
|
162
166
|
# This message is set to encourage the user to set a custom geonames username
|
|
163
167
|
if geonames_username is None and online:
|
|
@@ -188,7 +192,15 @@ class AstrologicalSubject:
|
|
|
188
192
|
self.nation = "GB"
|
|
189
193
|
logging.warning("No nation specified, using GB as default")
|
|
190
194
|
|
|
191
|
-
if
|
|
195
|
+
if not self.lat:
|
|
196
|
+
self.lat = 51.5074
|
|
197
|
+
logging.warning("No latitude specified, using London as default")
|
|
198
|
+
|
|
199
|
+
if not self.lng:
|
|
200
|
+
self.lng = 0
|
|
201
|
+
logging.warning("No longitude specified, using London as default")
|
|
202
|
+
|
|
203
|
+
if (not self.online) and (not tz_str):
|
|
192
204
|
raise KerykeionException(
|
|
193
205
|
"You need to set the coordinates and timezone if you want to use the offline mode!"
|
|
194
206
|
)
|
|
@@ -219,7 +231,7 @@ class AstrologicalSubject:
|
|
|
219
231
|
|
|
220
232
|
def _fetch_tz_from_geonames(self) -> None:
|
|
221
233
|
"""Gets the nearest time zone for the calculation"""
|
|
222
|
-
logging.
|
|
234
|
+
logging.info("Fetching timezone/coordinates from geonames")
|
|
223
235
|
|
|
224
236
|
geonames = FetchGeonames(
|
|
225
237
|
self.city,
|
|
@@ -247,7 +259,7 @@ class AstrologicalSubject:
|
|
|
247
259
|
"""Converts local time to utc time."""
|
|
248
260
|
|
|
249
261
|
# If the coordinates are not set, get them from geonames.
|
|
250
|
-
if (self.online) and (not self.tz_str
|
|
262
|
+
if (self.online) and (not self.tz_str):
|
|
251
263
|
self._fetch_tz_from_geonames()
|
|
252
264
|
|
|
253
265
|
# If UTC datetime is provided, then use it directly
|
|
@@ -367,7 +379,11 @@ class AstrologicalSubject:
|
|
|
367
379
|
pluto_deg = swe.calc(self.julian_day, 9, self._iflag)[0][0]
|
|
368
380
|
mean_node_deg = swe.calc(self.julian_day, 10, self._iflag)[0][0]
|
|
369
381
|
true_node_deg = swe.calc(self.julian_day, 11, self._iflag)[0][0]
|
|
370
|
-
|
|
382
|
+
|
|
383
|
+
if not self.disable_chiron:
|
|
384
|
+
chiron_deg = swe.calc(self.julian_day, 15, self._iflag)[0][0]
|
|
385
|
+
else:
|
|
386
|
+
chiron_deg = 0
|
|
371
387
|
|
|
372
388
|
self.planets_degrees_ut = [
|
|
373
389
|
sun_deg,
|
|
@@ -382,8 +398,10 @@ class AstrologicalSubject:
|
|
|
382
398
|
pluto_deg,
|
|
383
399
|
mean_node_deg,
|
|
384
400
|
true_node_deg,
|
|
385
|
-
chiron_deg,
|
|
386
401
|
]
|
|
402
|
+
|
|
403
|
+
if not self.disable_chiron:
|
|
404
|
+
self.planets_degrees_ut.append(chiron_deg)
|
|
387
405
|
|
|
388
406
|
def _planets(self) -> None:
|
|
389
407
|
"""Defines body positon in signs and information and
|
|
@@ -403,7 +421,11 @@ class AstrologicalSubject:
|
|
|
403
421
|
self.pluto = calculate_position(self.planets_degrees_ut[9], "Pluto", point_type=point_type)
|
|
404
422
|
self.mean_node = calculate_position(self.planets_degrees_ut[10], "Mean_Node", point_type=point_type)
|
|
405
423
|
self.true_node = calculate_position(self.planets_degrees_ut[11], "True_Node", point_type=point_type)
|
|
406
|
-
|
|
424
|
+
|
|
425
|
+
if not self.disable_chiron:
|
|
426
|
+
self.chiron = calculate_position(self.planets_degrees_ut[12], "Chiron", point_type=point_type)
|
|
427
|
+
else:
|
|
428
|
+
self.chiron = None
|
|
407
429
|
|
|
408
430
|
def _planets_in_houses(self) -> None:
|
|
409
431
|
"""Calculates the house of the planet and updates
|
|
@@ -464,7 +486,11 @@ class AstrologicalSubject:
|
|
|
464
486
|
self.pluto = for_every_planet(self.pluto, self.planets_degrees_ut[9])
|
|
465
487
|
self.mean_node = for_every_planet(self.mean_node, self.planets_degrees_ut[10])
|
|
466
488
|
self.true_node = for_every_planet(self.true_node, self.planets_degrees_ut[11])
|
|
467
|
-
|
|
489
|
+
|
|
490
|
+
if not self.disable_chiron:
|
|
491
|
+
self.chiron = for_every_planet(self.chiron, self.planets_degrees_ut[12])
|
|
492
|
+
else:
|
|
493
|
+
self.chiron = None
|
|
468
494
|
|
|
469
495
|
self.planets_list = [
|
|
470
496
|
self.sun,
|
|
@@ -479,8 +505,10 @@ class AstrologicalSubject:
|
|
|
479
505
|
self.pluto,
|
|
480
506
|
self.mean_node,
|
|
481
507
|
self.true_node,
|
|
482
|
-
self.chiron
|
|
483
508
|
]
|
|
509
|
+
|
|
510
|
+
if not self.disable_chiron:
|
|
511
|
+
self.planets_list.append(self.chiron)
|
|
484
512
|
|
|
485
513
|
# Check in retrograde or not:
|
|
486
514
|
planets_ret = []
|
|
@@ -635,10 +663,19 @@ class AstrologicalSubject:
|
|
|
635
663
|
if __name__ == "__main__":
|
|
636
664
|
import json
|
|
637
665
|
from kerykeion.utilities import setup_logging
|
|
638
|
-
setup_logging(level="debug")
|
|
639
666
|
|
|
667
|
+
setup_logging(level="debug")
|
|
668
|
+
|
|
669
|
+
# With Chiron enabled
|
|
640
670
|
johnny = AstrologicalSubject("Johnny Depp", 1963, 6, 9, 0, 0, "Owensboro", "US")
|
|
641
671
|
print(json.loads(johnny.json(dump=True)))
|
|
642
672
|
|
|
643
673
|
print('\n')
|
|
644
674
|
print(johnny.chiron)
|
|
675
|
+
|
|
676
|
+
# With Chiron disabled
|
|
677
|
+
johnny = AstrologicalSubject("Johnny Depp", 1963, 6, 9, 0, 0, "Owensboro", "US", disable_chiron=True)
|
|
678
|
+
print(json.loads(johnny.json(dump=True)))
|
|
679
|
+
|
|
680
|
+
print('\n')
|
|
681
|
+
print(johnny.chiron)
|
kerykeion/enums.py
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Planets(Enum):
|
|
5
|
+
SUN = "Sun"
|
|
6
|
+
MOON = "Moon"
|
|
7
|
+
MERCURY = "Mercury"
|
|
8
|
+
VENUS = "Venus"
|
|
9
|
+
MARS = "Mars"
|
|
10
|
+
JUPITER = "Jupiter"
|
|
11
|
+
SATURN = "Saturn"
|
|
12
|
+
URANUS = "Uranus"
|
|
13
|
+
NEPTUNE = "Neptune"
|
|
14
|
+
PLUTO = "Pluto"
|
|
15
|
+
CHIRON = "Chiron"
|
|
16
|
+
TRUE_NODE = "True_Node"
|
|
17
|
+
MEAN_NODE = "Mean_Node"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class Aspects(Enum):
|
|
21
|
+
CONJUNCTION = "Conjunction"
|
|
22
|
+
SEXTILE = "Sextile"
|
|
23
|
+
SEMI_SEXTILE = "Semi-Sextile"
|
|
24
|
+
SQUARE = "Square"
|
|
25
|
+
TRINE = "Trine"
|
|
26
|
+
OPPOSITION = "Opposition"
|
|
27
|
+
QUINCUNX = "Quincunx"
|
|
28
|
+
NONE = None
|
|
29
|
+
QUINTILE = "Quintile"
|
|
30
|
+
BIQUINTILE = "Biquintile"
|
|
31
|
+
OCTILE = "Octile"
|
|
32
|
+
TRIOCTILE = "Trioctile"
|
|
33
|
+
DECILE = "Decile"
|
|
34
|
+
TRIDECILE = "Tridecile"
|
|
35
|
+
SESQUIQUADRATE = "Sesquiquadrate"
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class Signs(Enum):
|
|
39
|
+
ARI = "Ari"
|
|
40
|
+
TAU = "Tau"
|
|
41
|
+
GEM = "Gem"
|
|
42
|
+
CAN = "Can"
|
|
43
|
+
LEO = "Leo"
|
|
44
|
+
VIR = "Vir"
|
|
45
|
+
LIB = "Lib"
|
|
46
|
+
SCO = "Sco"
|
|
47
|
+
SAG = "Sag"
|
|
48
|
+
CAP = "Cap"
|
|
49
|
+
AQU = "Aqu"
|
|
50
|
+
PIS = "Pis"
|
kerykeion/kr_types/kr_models.py
CHANGED
|
@@ -136,7 +136,7 @@ class AstrologicalSubjectModel(BaseModel):
|
|
|
136
136
|
uranus: KerykeionPointModel
|
|
137
137
|
neptune: KerykeionPointModel
|
|
138
138
|
pluto: KerykeionPointModel
|
|
139
|
-
chiron: KerykeionPointModel
|
|
139
|
+
chiron: KerykeionPointModel | None
|
|
140
140
|
|
|
141
141
|
# Houses
|
|
142
142
|
first_house: KerykeionPointModel
|
kerykeion/utilities.py
CHANGED
|
@@ -203,15 +203,20 @@ def calculate_position(
|
|
|
203
203
|
|
|
204
204
|
return KerykeionPointModel(**dictionary)
|
|
205
205
|
|
|
206
|
+
|
|
206
207
|
def setup_logging(level: str) -> None:
|
|
207
|
-
"""
|
|
208
|
-
|
|
208
|
+
"""
|
|
209
|
+
Setup logging for testing.
|
|
210
|
+
|
|
209
211
|
Args:
|
|
210
|
-
level: Log level as a string, options: debug, info, warning, error
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
212
|
+
level: Log level as a string, options: debug, info, warning, error
|
|
213
|
+
"""
|
|
214
|
+
logopt: dict[str, int] = {
|
|
215
|
+
"debug": logging.DEBUG,
|
|
216
|
+
"info": logging.INFO,
|
|
217
|
+
"warning": logging.WARNING,
|
|
218
|
+
"error": logging.ERROR,
|
|
219
|
+
}
|
|
220
|
+
format: str = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
|
221
|
+
loglevel: int = logopt.get(level, logging.INFO)
|
|
222
|
+
logging.basicConfig(format=format, level=loglevel)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: kerykeion
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.5.0
|
|
4
4
|
Summary: A python library for astrology.
|
|
5
5
|
Home-page: https://github.com/g-battaglia/kerykeion
|
|
6
6
|
License: AGPL-3.0
|
|
@@ -18,6 +18,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.9
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.10
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
22
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
22
23
|
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
23
24
|
Classifier: Topic :: Software Development
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
LICENSE,sha256=UTLH8EdbAsgQei4PA2PnBCPGLSZkq5J-dhkyJuXgWQU,34273
|
|
2
|
-
kerykeion/__init__.py,sha256=
|
|
2
|
+
kerykeion/__init__.py,sha256=PCtgM8o1R8Poo4RoISq23jLP-74LYWoShnK4bm81Yks,3917
|
|
3
3
|
kerykeion/aspects/__init__.py,sha256=8uOTYtcMwyDBbDjIoz8wvWtdcgdU-86yQeM3EVLwnIA,293
|
|
4
4
|
kerykeion/aspects/aspects_utils.py,sha256=10ozUZ4ZhMJ8e_wOZ02hoW9mHJm_d7bq4QXKG90CeNc,5832
|
|
5
5
|
kerykeion/aspects/natal_aspects.py,sha256=k3L6wLec7l7BF1jKULN8rNlQNOhINnfPN6x8MixoMMo,4507
|
|
6
6
|
kerykeion/aspects/synastry_aspects.py,sha256=rM_of6GU-ZQL1A6JaLsG59MTaAeWx29MWRf9te9hHeg,3993
|
|
7
|
-
kerykeion/astrological_subject.py,sha256=
|
|
7
|
+
kerykeion/astrological_subject.py,sha256=KWHvnqqDW4D4n4z4nysWighpYft6_G_K3PI7iwMp2gg,25672
|
|
8
8
|
kerykeion/charts/__init__.py,sha256=3WzR2n9dr6MDzjTbEQOYpXSFlhfMfga5YWNsPawdbRw,127
|
|
9
9
|
kerykeion/charts/charts_utils.py,sha256=qQMXu5XZCCjvyqL62fzh4JnKLzd_G6u9pcMk6f1DpIc,3197
|
|
10
10
|
kerykeion/charts/kerykeion_chart_svg.py,sha256=-5kclHKKL8kya2lFFnw5pZiygck82lAFBSI-eyse8lk,65295
|
|
11
11
|
kerykeion/charts/templates/chart.xml,sha256=ZrkqJV3Du8vG1w8kVkM1wI-IiZNVDLDuS6dRtPz7wVo,69874
|
|
12
|
+
kerykeion/enums.py,sha256=Ben9GLYkPucpYY2ZDpURzUbNCc9jzK2MuaffkgiXFdQ,965
|
|
12
13
|
kerykeion/fetch_geonames.py,sha256=NwiRzl-OlA2yoEtgHEvdgWeed42cpcONmOhb9s-DAOY,4444
|
|
13
14
|
kerykeion/kr_types/__init__.py,sha256=-vRe-jixD6n8d7vsLSwbbvU4c2RXOoVvv0pjbX-9eiY,205
|
|
14
15
|
kerykeion/kr_types/chart_types.py,sha256=PvdOEqzZZBrJxFKQqAC0KcnfIY4T4I2i6CeLQhvVbe8,1945
|
|
15
16
|
kerykeion/kr_types/kerykeion_exception.py,sha256=CtdpOaGTox_LBGB0Ji_qtcwbgYAqBJ8AfDXbeaiAkM0,314
|
|
16
17
|
kerykeion/kr_types/kr_literals.py,sha256=hbgeq5yPuyLv9zXp7shBeEsMHOd8UQBBUa_HQnBQu7w,1034
|
|
17
|
-
kerykeion/kr_types/kr_models.py,sha256=
|
|
18
|
+
kerykeion/kr_types/kr_models.py,sha256=g0-m17JetNpNgniyk5cxLtN23ho-zb5Y-HbHtGUX5Q4,4100
|
|
18
19
|
kerykeion/kr_types/settings_models.py,sha256=4dOTAy6UgevF9dGPnBLIp4Aw5FBEygifnjDO8kALmdw,12737
|
|
19
20
|
kerykeion/relationship_score.py,sha256=IPO8IH9J6GOYuuAfn01d0KamY1xSIjl391Zvk5F434Y,6794
|
|
20
21
|
kerykeion/report.py,sha256=kS5avIN119pJVapYjZOvabg77nEcA8sSrOuXbRifABk,2565
|
|
@@ -23,9 +24,9 @@ kerykeion/settings/kerykeion_settings.py,sha256=vZCpWpTHVD3ItERWzsVW3syhgchJbWaP
|
|
|
23
24
|
kerykeion/settings/kr.config.json,sha256=1Yhv9RGHom5U9e-JZZRWVfT2Ubllz2WrckdwadDWfyg,12282
|
|
24
25
|
kerykeion/sweph/README.md,sha256=L7FtNAJTWtrZNGKa8MX87SjduFYPYxwWhaI5fmtzNZo,73
|
|
25
26
|
kerykeion/sweph/seas_18.se1,sha256=X9nCqhZU43wJpq61WAdueVQJt9xL2UjrwPqn1Kdoa1s,223002
|
|
26
|
-
kerykeion/utilities.py,sha256=
|
|
27
|
-
kerykeion-4.
|
|
28
|
-
kerykeion-4.
|
|
29
|
-
kerykeion-4.
|
|
30
|
-
kerykeion-4.
|
|
31
|
-
kerykeion-4.
|
|
27
|
+
kerykeion/utilities.py,sha256=LOug1qgHoR12hNvL2hqdRWTnTHst4BdzY6u1dl3PfL0,6207
|
|
28
|
+
kerykeion-4.5.0.dist-info/LICENSE,sha256=UTLH8EdbAsgQei4PA2PnBCPGLSZkq5J-dhkyJuXgWQU,34273
|
|
29
|
+
kerykeion-4.5.0.dist-info/METADATA,sha256=0S62iUPPD6Y_yb_EhoChnwXj7uJFXzx08EJAuhT7l9U,10311
|
|
30
|
+
kerykeion-4.5.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
31
|
+
kerykeion-4.5.0.dist-info/entry_points.txt,sha256=5SmANYscFDDTdeovHvGQ-cnj0hdFvGoxPaWLCpyDFnQ,49
|
|
32
|
+
kerykeion-4.5.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|