kerykeion 4.4.1__tar.gz → 4.5.0__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 (30) hide show
  1. {kerykeion-4.4.1 → kerykeion-4.5.0}/PKG-INFO +2 -1
  2. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/__init__.py +1 -0
  3. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/astrological_subject.py +52 -15
  4. kerykeion-4.5.0/kerykeion/enums.py +50 -0
  5. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/kr_types/kr_models.py +1 -1
  6. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/utilities.py +15 -10
  7. {kerykeion-4.4.1 → kerykeion-4.5.0}/pyproject.toml +1 -1
  8. {kerykeion-4.4.1 → kerykeion-4.5.0}/LICENSE +0 -0
  9. {kerykeion-4.4.1 → kerykeion-4.5.0}/README.md +0 -0
  10. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/aspects/__init__.py +0 -0
  11. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/aspects/aspects_utils.py +0 -0
  12. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/aspects/natal_aspects.py +0 -0
  13. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/aspects/synastry_aspects.py +0 -0
  14. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/charts/__init__.py +0 -0
  15. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/charts/charts_utils.py +0 -0
  16. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/charts/kerykeion_chart_svg.py +0 -0
  17. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/charts/templates/chart.xml +0 -0
  18. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/fetch_geonames.py +0 -0
  19. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/kr_types/__init__.py +0 -0
  20. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/kr_types/chart_types.py +0 -0
  21. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/kr_types/kerykeion_exception.py +0 -0
  22. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/kr_types/kr_literals.py +0 -0
  23. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/kr_types/settings_models.py +0 -0
  24. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/relationship_score.py +0 -0
  25. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/report.py +0 -0
  26. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/settings/__init__.py +0 -0
  27. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/settings/kerykeion_settings.py +0 -0
  28. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/settings/kr.config.json +0 -0
  29. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/sweph/README.md +0 -0
  30. {kerykeion-4.4.1 → kerykeion-4.5.0}/kerykeion/sweph/seas_18.se1 +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kerykeion
3
- Version: 4.4.1
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
@@ -106,3 +106,4 @@ from .relationship_score import RelationshipScore
106
106
  from .aspects import SynastryAspects, NatalAspects
107
107
  from .report import Report
108
108
  from .settings import KerykeionSettingsModel, get_settings
109
+ from .enums import Planets, Aspects, Signs
@@ -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] = 0,
129
- lat: Union[int, float] = 0,
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 (not self.online) and (not lng or not lat or not tz_str):
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.debug("Conneting to Geonames...")
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 or not self.lng or not self.lat):
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
- chiron_deg = swe.calc(self.julian_day, 15, self._iflag)[0][0]
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
- self.chiron = calculate_position(self.planets_degrees_ut[12], "Chiron", point_type=point_type)
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
- self.chiron = for_every_planet(self.chiron, self.planets_degrees_ut[12])
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)
@@ -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"
@@ -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
@@ -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
- """Setup logging for testing.
208
-
208
+ """
209
+ Setup logging for testing.
210
+
209
211
  Args:
210
- level: Log level as a string, options: debug, info, warning, error"""
211
- logopt: dict[str, int] = {"debug": logging.DEBUG,
212
- "info": logging.INFO,
213
- "warning": logging.WARNING ,
214
- "error": logging.ERROR}
215
- format: str = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
216
- loglevel: int = logopt.get(level, logging.INFO)
217
- logging.basicConfig(format=format, level=loglevel)
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
  [tool.poetry]
2
2
  name = "kerykeion"
3
- version = "4.4.1"
3
+ version = "4.5.0"
4
4
  authors = ["Giacomo Battaglia <battaglia.giacomo@yahoo.it>"]
5
5
  description = "A python library for astrology."
6
6
  license = "AGPL-3.0"
File without changes
File without changes
File without changes