kerykeion 4.12.1__tar.gz → 4.12.3__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.12.1 → kerykeion-4.12.3}/PKG-INFO +58 -12
  2. {kerykeion-4.12.1 → kerykeion-4.12.3}/README.md +57 -11
  3. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/astrological_subject.py +108 -24
  4. {kerykeion-4.12.1 → kerykeion-4.12.3}/pyproject.toml +1 -1
  5. {kerykeion-4.12.1 → kerykeion-4.12.3}/LICENSE +0 -0
  6. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/__init__.py +0 -0
  7. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/aspects/__init__.py +0 -0
  8. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/aspects/aspects_utils.py +0 -0
  9. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/aspects/natal_aspects.py +0 -0
  10. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/aspects/synastry_aspects.py +0 -0
  11. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/charts/__init__.py +0 -0
  12. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/charts/charts_utils.py +0 -0
  13. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/charts/kerykeion_chart_svg.py +0 -0
  14. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/charts/templates/chart.xml +0 -0
  15. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/enums.py +0 -0
  16. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/fetch_geonames.py +0 -0
  17. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/kr_types/__init__.py +0 -0
  18. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/kr_types/chart_types.py +0 -0
  19. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/kr_types/kerykeion_exception.py +0 -0
  20. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/kr_types/kr_literals.py +0 -0
  21. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/kr_types/kr_models.py +0 -0
  22. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/kr_types/settings_models.py +0 -0
  23. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/relationship_score.py +0 -0
  24. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/report.py +0 -0
  25. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/settings/__init__.py +0 -0
  26. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/settings/kerykeion_settings.py +0 -0
  27. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/settings/kr.config.json +0 -0
  28. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/sweph/README.md +0 -0
  29. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/sweph/seas_18.se1 +0 -0
  30. {kerykeion-4.12.1 → kerykeion-4.12.3}/kerykeion/utilities.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kerykeion
3
- Version: 4.12.1
3
+ Version: 4.12.3
4
4
  Summary: A python library for astrology.
5
5
  Home-page: https://www.kerykeion.net/
6
6
  License: AGPL-3.0
@@ -95,9 +95,11 @@ Kerykeion is a _Python 3.9_ package, make sure you have _Python 3.9_ or above in
95
95
  pip3 install kerykeion
96
96
  ```
97
97
 
98
- ## Usage
98
+ ## Basic Usage
99
99
 
100
- Here some examples:
100
+ The basic usage of the library is to create an instance of the AstrologicalSubject class and then access the properties of the instance to get the astrological information about the subject.
101
+
102
+ Here's an example:
101
103
 
102
104
  ```python
103
105
 
@@ -105,8 +107,8 @@ Here some examples:
105
107
  from kerykeion import AstrologicalSubject
106
108
 
107
109
  # Create a kerykeion instance:
108
- # Args: Name, year, month, day, hour, minuts, city, nation(optional)
109
- kanye = AstrologicalSubject("Kanye", 1977, 6, 8, 8, 45, "Atlanta")
110
+ # Args: Name, year, month, day, hour, minuts, city, nation
111
+ kanye = AstrologicalSubject("Kanye", 1977, 6, 8, 8, 45, "Atlanta", "US")
110
112
 
111
113
  # Get the information about the sun in the chart:
112
114
  # (The position of the planets always starts at 0)
@@ -139,6 +141,23 @@ If you omit the nation, it will be set to "GB" by default, but the value is not
139
141
 
140
142
  ## Generate a SVG Chart
141
143
 
144
+ ### Birth Chart
145
+
146
+ ```python
147
+ from kerykeion import AstrologicalSubject, KerykeionChartSVG
148
+
149
+
150
+ birth_chart = AstrologicalSubject("Kanye", 1977, 6, 8, 8, 45, "Atlanta", "US")
151
+ birth_chart_svg = KerykeionChartSVG(birth_chart)
152
+
153
+ birth_chart_svg.makeSVG()
154
+ ```
155
+
156
+ The SVG file will be saved in the home directory.
157
+ ![John Lennon Birth Chart](https://www.kerykeion.net/assets/img/examples/birth-chart.svg)
158
+
159
+ ### Synastry Chart
160
+
142
161
  ```python
143
162
  from kerykeion import AstrologicalSubject, KerykeionChartSVG
144
163
 
@@ -153,7 +172,9 @@ synastry_chart.makeSVG()
153
172
 
154
173
  ![John Lennon and Paul McCartney Synastry](https://www.kerykeion.net/assets/img/examples/synastry-chart.svg)
155
174
 
156
- Note: By default, the generated SVG file will be in the home directory! To change the destination directory:
175
+ ### Change the output directory
176
+
177
+ By default the output directory is the home directory, you can change it by passing the new_output_directory parameter to the KerykeionChartSVG class:
157
178
 
158
179
  ```python
159
180
  from kerykeion import AstrologicalSubject, KerykeionChartSVG
@@ -161,7 +182,7 @@ from kerykeion import AstrologicalSubject, KerykeionChartSVG
161
182
  first = AstrologicalSubject("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
162
183
  second = AstrologicalSubject("Paul McCartney", 1942, 6, 18, 15, 30, "Liverpool", "GB")
163
184
 
164
- # Synastry Chart
185
+ # Set the output directory to the current directory
165
186
  synastry_chart = KerykeionChartSVG(first, "Synastry", second, new_output_directory=".")
166
187
  synastry_chart.makeSVG()
167
188
  ```
@@ -179,7 +200,7 @@ To print a report of all the data:
179
200
  ```python
180
201
  from kerykeion import Report, AstrologicalSubject
181
202
 
182
- kanye = AstrologicalSubject("Kanye", 1977, 6, 8, 8, 45, "Atlanta")
203
+ kanye = AstrologicalSubject("Kanye", 1977, 6, 8, 8, 45, "Atlanta", "US")
183
204
  report = Report(kanye)
184
205
  report.print_report()
185
206
 
@@ -236,14 +257,14 @@ And if you want to export it to a file:
236
257
  python3 your_script_name.py > file.txt
237
258
  ```
238
259
 
239
- ## Other exeples of possibles usecase
260
+ ## Other examples of possible use cases:
240
261
 
241
262
  ```python
242
263
  # Get all aspects between two persons:
243
264
 
244
265
  from kerykeion import SynastryAspects, AstrologicalSubject
245
- first = AstrologicalSubject("Jack", 1990, 6, 15, 15, 15, "Roma")
246
- second = AstrologicalSubject("Jane", 1991, 10, 25, 21, 00, "Roma")
266
+ first = AstrologicalSubject("Jack", 1990, 6, 15, 15, 15, "Roma", "IT")
267
+ second = AstrologicalSubject("Jane", 1991, 10, 25, 21, 00, "Roma", "IT")
247
268
 
248
269
  name = SynastryAspects(first, second)
249
270
  aspect_list = name.get_relevant_aspects()
@@ -257,7 +278,8 @@ print(aspect_list[0])
257
278
 
258
279
  ## Ayanamsa (Sidereal Modes)
259
280
 
260
- You can set the zodiac type and the sidereal mode in the AstrologicalSubject class:
281
+ By default, the zodiac type is set to Tropic (Tropical).
282
+ You can set the zodiac type to Sidereal and the sidereal mode in the AstrologicalSubject class:
261
283
 
262
284
  ```python
263
285
  johnny = AstrologicalSubject("Johnny Depp", 1963, 6, 9, 0, 0, "Owensboro", "US", zodiac_type="Sidereal", sidereal_mode="LAHIRI")
@@ -269,6 +291,7 @@ Full list of supported sidereal modes [here](https://www.kerykeion.net/pydocs/ke
269
291
 
270
292
  ## Houses Systems
271
293
 
294
+ By default, the houses system is set to Placidus.
272
295
  You can set the houses system in the AstrologicalSubject class:
273
296
 
274
297
  ```python
@@ -283,6 +306,7 @@ So far all the available houses system in the Swiss Ephemeris are supported but
283
306
 
284
307
  ## Perspective Type
285
308
 
309
+ By default, the perspective type is set to Apparent Geocentric (the most common standard for astrology).
286
310
  The perspective indicates the point of view from which the chart is calculated (Es. Apparent Geocentric, Heliocentric, etc.).
287
311
  You can set the perspective type in the AstrologicalSubject class:
288
312
 
@@ -294,6 +318,28 @@ More examples [here](https://www.kerykeion.net/docs/examples/perspective-type/).
294
318
 
295
319
  Full list of supported perspective types [here](https://www.kerykeion.net/pydocs/kerykeion/kr_types/kr_literals.html#PerspectiveType).
296
320
 
321
+ ## Alternative Initialization
322
+
323
+ You can initialize the AstrologicalSubject from a **UTC** ISO 8601 string:
324
+
325
+ ```python
326
+ subject = AstrologicalSubject.get_from_iso_utc_time(
327
+ "Johnny Depp", "1963-06-09T05:00:00Z", "Owensboro", "US")
328
+ ```
329
+
330
+ Note : The default time zone is UTC, with Greenwich longitude and latitude.
331
+
332
+ The default online/offline mode is set to offline, if you set it online the default latitude and longitude will be ignored and
333
+ calculated from the city and nation. Remember to pass also the geonames_username parameter if you want to use the online mode, like this:
334
+
335
+ ```python
336
+ from kerykeion.astrological_subject import AstrologicalSubject
337
+
338
+ # Use the static method get_from_iso_utc_time to create an instance of AstrologicalSubject
339
+ subject = AstrologicalSubject.get_from_iso_utc_time(
340
+ "Johnny Depp", "1963-06-09T05:00:00Z", "Owensboro", "US", online=True)
341
+ ```
342
+
297
343
  ## Documentation
298
344
 
299
345
  Most of the functions and the classes are self documented by the types and have docstrings.
@@ -58,9 +58,11 @@ Kerykeion is a _Python 3.9_ package, make sure you have _Python 3.9_ or above in
58
58
  pip3 install kerykeion
59
59
  ```
60
60
 
61
- ## Usage
61
+ ## Basic Usage
62
62
 
63
- Here some examples:
63
+ The basic usage of the library is to create an instance of the AstrologicalSubject class and then access the properties of the instance to get the astrological information about the subject.
64
+
65
+ Here's an example:
64
66
 
65
67
  ```python
66
68
 
@@ -68,8 +70,8 @@ Here some examples:
68
70
  from kerykeion import AstrologicalSubject
69
71
 
70
72
  # Create a kerykeion instance:
71
- # Args: Name, year, month, day, hour, minuts, city, nation(optional)
72
- kanye = AstrologicalSubject("Kanye", 1977, 6, 8, 8, 45, "Atlanta")
73
+ # Args: Name, year, month, day, hour, minuts, city, nation
74
+ kanye = AstrologicalSubject("Kanye", 1977, 6, 8, 8, 45, "Atlanta", "US")
73
75
 
74
76
  # Get the information about the sun in the chart:
75
77
  # (The position of the planets always starts at 0)
@@ -102,6 +104,23 @@ If you omit the nation, it will be set to "GB" by default, but the value is not
102
104
 
103
105
  ## Generate a SVG Chart
104
106
 
107
+ ### Birth Chart
108
+
109
+ ```python
110
+ from kerykeion import AstrologicalSubject, KerykeionChartSVG
111
+
112
+
113
+ birth_chart = AstrologicalSubject("Kanye", 1977, 6, 8, 8, 45, "Atlanta", "US")
114
+ birth_chart_svg = KerykeionChartSVG(birth_chart)
115
+
116
+ birth_chart_svg.makeSVG()
117
+ ```
118
+
119
+ The SVG file will be saved in the home directory.
120
+ ![John Lennon Birth Chart](https://www.kerykeion.net/assets/img/examples/birth-chart.svg)
121
+
122
+ ### Synastry Chart
123
+
105
124
  ```python
106
125
  from kerykeion import AstrologicalSubject, KerykeionChartSVG
107
126
 
@@ -116,7 +135,9 @@ synastry_chart.makeSVG()
116
135
 
117
136
  ![John Lennon and Paul McCartney Synastry](https://www.kerykeion.net/assets/img/examples/synastry-chart.svg)
118
137
 
119
- Note: By default, the generated SVG file will be in the home directory! To change the destination directory:
138
+ ### Change the output directory
139
+
140
+ By default the output directory is the home directory, you can change it by passing the new_output_directory parameter to the KerykeionChartSVG class:
120
141
 
121
142
  ```python
122
143
  from kerykeion import AstrologicalSubject, KerykeionChartSVG
@@ -124,7 +145,7 @@ from kerykeion import AstrologicalSubject, KerykeionChartSVG
124
145
  first = AstrologicalSubject("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
125
146
  second = AstrologicalSubject("Paul McCartney", 1942, 6, 18, 15, 30, "Liverpool", "GB")
126
147
 
127
- # Synastry Chart
148
+ # Set the output directory to the current directory
128
149
  synastry_chart = KerykeionChartSVG(first, "Synastry", second, new_output_directory=".")
129
150
  synastry_chart.makeSVG()
130
151
  ```
@@ -142,7 +163,7 @@ To print a report of all the data:
142
163
  ```python
143
164
  from kerykeion import Report, AstrologicalSubject
144
165
 
145
- kanye = AstrologicalSubject("Kanye", 1977, 6, 8, 8, 45, "Atlanta")
166
+ kanye = AstrologicalSubject("Kanye", 1977, 6, 8, 8, 45, "Atlanta", "US")
146
167
  report = Report(kanye)
147
168
  report.print_report()
148
169
 
@@ -199,14 +220,14 @@ And if you want to export it to a file:
199
220
  python3 your_script_name.py > file.txt
200
221
  ```
201
222
 
202
- ## Other exeples of possibles usecase
223
+ ## Other examples of possible use cases:
203
224
 
204
225
  ```python
205
226
  # Get all aspects between two persons:
206
227
 
207
228
  from kerykeion import SynastryAspects, AstrologicalSubject
208
- first = AstrologicalSubject("Jack", 1990, 6, 15, 15, 15, "Roma")
209
- second = AstrologicalSubject("Jane", 1991, 10, 25, 21, 00, "Roma")
229
+ first = AstrologicalSubject("Jack", 1990, 6, 15, 15, 15, "Roma", "IT")
230
+ second = AstrologicalSubject("Jane", 1991, 10, 25, 21, 00, "Roma", "IT")
210
231
 
211
232
  name = SynastryAspects(first, second)
212
233
  aspect_list = name.get_relevant_aspects()
@@ -220,7 +241,8 @@ print(aspect_list[0])
220
241
 
221
242
  ## Ayanamsa (Sidereal Modes)
222
243
 
223
- You can set the zodiac type and the sidereal mode in the AstrologicalSubject class:
244
+ By default, the zodiac type is set to Tropic (Tropical).
245
+ You can set the zodiac type to Sidereal and the sidereal mode in the AstrologicalSubject class:
224
246
 
225
247
  ```python
226
248
  johnny = AstrologicalSubject("Johnny Depp", 1963, 6, 9, 0, 0, "Owensboro", "US", zodiac_type="Sidereal", sidereal_mode="LAHIRI")
@@ -232,6 +254,7 @@ Full list of supported sidereal modes [here](https://www.kerykeion.net/pydocs/ke
232
254
 
233
255
  ## Houses Systems
234
256
 
257
+ By default, the houses system is set to Placidus.
235
258
  You can set the houses system in the AstrologicalSubject class:
236
259
 
237
260
  ```python
@@ -246,6 +269,7 @@ So far all the available houses system in the Swiss Ephemeris are supported but
246
269
 
247
270
  ## Perspective Type
248
271
 
272
+ By default, the perspective type is set to Apparent Geocentric (the most common standard for astrology).
249
273
  The perspective indicates the point of view from which the chart is calculated (Es. Apparent Geocentric, Heliocentric, etc.).
250
274
  You can set the perspective type in the AstrologicalSubject class:
251
275
 
@@ -257,6 +281,28 @@ More examples [here](https://www.kerykeion.net/docs/examples/perspective-type/).
257
281
 
258
282
  Full list of supported perspective types [here](https://www.kerykeion.net/pydocs/kerykeion/kr_types/kr_literals.html#PerspectiveType).
259
283
 
284
+ ## Alternative Initialization
285
+
286
+ You can initialize the AstrologicalSubject from a **UTC** ISO 8601 string:
287
+
288
+ ```python
289
+ subject = AstrologicalSubject.get_from_iso_utc_time(
290
+ "Johnny Depp", "1963-06-09T05:00:00Z", "Owensboro", "US")
291
+ ```
292
+
293
+ Note : The default time zone is UTC, with Greenwich longitude and latitude.
294
+
295
+ The default online/offline mode is set to offline, if you set it online the default latitude and longitude will be ignored and
296
+ calculated from the city and nation. Remember to pass also the geonames_username parameter if you want to use the online mode, like this:
297
+
298
+ ```python
299
+ from kerykeion.astrological_subject import AstrologicalSubject
300
+
301
+ # Use the static method get_from_iso_utc_time to create an instance of AstrologicalSubject
302
+ subject = AstrologicalSubject.get_from_iso_utc_time(
303
+ "Johnny Depp", "1963-06-09T05:00:00Z", "Owensboro", "US", online=True)
304
+ ```
305
+
260
306
  ## Documentation
261
307
 
262
308
  Most of the functions and the classes are self documented by the types and have docstrings.
@@ -34,8 +34,19 @@ from typing import Union, get_args
34
34
 
35
35
  DEFAULT_GEONAMES_USERNAME = "century.boy"
36
36
  DEFAULT_SIDEREAL_MODE = "FAGAN_BRADLEY"
37
- DEFAULT_HOUSES_SYSTEM = "P"
38
- PERSPECTIVE_TYPE = "Apparent Geocentric"
37
+ DEFAULT_HOUSES_SYSTEM_IDENTIFIER = "P"
38
+ DEFAULT_ZODIAC_TYPE = "Tropic"
39
+ DEFAULT_PERSPECTIVE_TYPE = "Apparent Geocentric"
40
+ GEONAMES_DEFAULT_USERNAME_WARNING = (
41
+ "\n********\n"
42
+ "NO GEONAMES USERNAME SET!\n"
43
+ "Using the default geonames username is not recommended, please set a custom one!\n"
44
+ "You can get one for free here:\n"
45
+ "https://www.geonames.org/login\n"
46
+ "Keep in mind that the default username is limited to 2000 requests per hour and is shared with everyone else using this library.\n"
47
+ "********"
48
+ )
49
+
39
50
  NOW = datetime.now()
40
51
 
41
52
 
@@ -154,12 +165,12 @@ class AstrologicalSubject:
154
165
  lat: Union[int, float, None] = None,
155
166
  tz_str: Union[str, None] = None,
156
167
  geonames_username: Union[str, None] = None,
157
- zodiac_type: ZodiacType = "Tropic",
168
+ zodiac_type: ZodiacType = DEFAULT_ZODIAC_TYPE,
158
169
  online: bool = True,
159
170
  disable_chiron: bool = False,
160
171
  sidereal_mode: Union[SiderealMode, None] = None,
161
- houses_system_identifier: HousesSystemIdentifier = DEFAULT_HOUSES_SYSTEM,
162
- perspective_type: PerspectiveType = PERSPECTIVE_TYPE
172
+ houses_system_identifier: HousesSystemIdentifier = DEFAULT_HOUSES_SYSTEM_IDENTIFIER,
173
+ perspective_type: PerspectiveType = DEFAULT_PERSPECTIVE_TYPE
163
174
  ) -> None:
164
175
  logging.debug("Starting Kerykeion")
165
176
 
@@ -190,20 +201,7 @@ class AstrologicalSubject:
190
201
  # This message is set to encourage the user to set a custom geonames username
191
202
  if geonames_username is None and online:
192
203
  logging.warning(
193
- "\n"
194
- "********" +
195
- "\n" +
196
- "NO GEONAMES USERNAME SET!" +
197
- "\n" +
198
- "Using the default geonames username is not recommended, please set a custom one!" +
199
- "\n" +
200
- "You can get one for free here:" +
201
- "\n" +
202
- "https://www.geonames.org/login" +
203
- "\n" +
204
- "Keep in mind that the default username is limited to 2000 requests per hour and is shared with everyone else using this library." +
205
- "\n" +
206
- "********"
204
+
207
205
  )
208
206
 
209
207
  self.geonames_username = DEFAULT_GEONAMES_USERNAME
@@ -687,6 +685,96 @@ class AstrologicalSubject:
687
685
 
688
686
  return float_time
689
687
 
688
+
689
+ @staticmethod
690
+ def get_from_iso_utc_time(
691
+ name: str,
692
+ iso_utc_time: str,
693
+ city: str = "Greenwich",
694
+ nation: str = "GB",
695
+ tz_str: str = "Etc/GMT",
696
+ online: bool = False,
697
+ lng: Union[int, float] = 0,
698
+ lat: Union[int, float] = 51.5074,
699
+ geonames_username: str = DEFAULT_GEONAMES_USERNAME,
700
+ zodiac_type: ZodiacType = DEFAULT_ZODIAC_TYPE,
701
+ disable_chiron: bool = False,
702
+ sidereal_mode: Union[SiderealMode, None] = None,
703
+ houses_system_identifier: HousesSystemIdentifier = DEFAULT_HOUSES_SYSTEM_IDENTIFIER,
704
+ perspective_type: PerspectiveType = DEFAULT_PERSPECTIVE_TYPE
705
+
706
+ ) -> "AstrologicalSubject":
707
+ """
708
+ Creates an AstrologicalSubject object from an iso formatted UTC time.
709
+ This method is offline by default, set online=True to fetch the timezone and coordinates from geonames.
710
+
711
+ Args:
712
+ - name (str): The name of the subject.
713
+ - iso_utc_time (str): The iso formatted UTC time.
714
+ - city (str, optional): City or location of birth. Defaults to "Greenwich".
715
+ - nation (str, optional): Nation of birth. Defaults to "GB".
716
+ - tz_str (str, optional): Timezone of the birth location. Defaults to "Etc/GMT".
717
+ - online (bool, optional): Sets if you want to use the online mode, which fetches the timezone and coordinates from geonames.
718
+ If you already have the coordinates and timezone, set this to False. Defaults to False.
719
+ - lng (Union[int, float], optional): Longitude of the birth location. Defaults to 0 (Greenwich, London).
720
+ - lat (Union[int, float], optional): Latitude of the birth location. Defaults to 51.5074 (Greenwich, London).
721
+ - geonames_username (str, optional): The username for the geonames API. Note: Change this to your own username to avoid rate limits!
722
+ You can get one for free here: https://www.geonames.org/login
723
+ - zodiac_type (ZodiacType, optional): The zodiac type to use. Defaults to "Tropic".
724
+ - disable_chiron (bool, optional): Disables the calculation of Chiron. Defaults to False.
725
+ Chiron calculation can create some issues with the Swiss Ephemeris when the date is too far in the past.
726
+ - sidereal_mode (SiderealMode, optional): Also known as Ayanamsa.
727
+ The mode to use for the sidereal zodiac, according to the Swiss Ephemeris.
728
+ Defaults to None.
729
+ Available modes are visible in the SiderealMode Literal.
730
+ - houses_system_identifier (HousesSystemIdentifier, optional): The system to use for the calculation of the houses.
731
+ Defaults to "P" (Placidus).
732
+ Available systems are visible in the HousesSystemIdentifier Literal.
733
+ - perspective_type (PerspectiveType, optional): The perspective to use for the calculation of the chart.
734
+ Defaults to "Apparent Geocentric".
735
+
736
+ Returns:
737
+ - AstrologicalSubject: The AstrologicalSubject object.
738
+ """
739
+ dt = datetime.fromisoformat(iso_utc_time)
740
+
741
+ if online == True:
742
+ if geonames_username == DEFAULT_GEONAMES_USERNAME:
743
+ logging.warning(GEONAMES_DEFAULT_USERNAME_WARNING)
744
+
745
+ geonames = FetchGeonames(
746
+ city,
747
+ nation,
748
+ username=geonames_username,
749
+ )
750
+
751
+ city_data: dict[str, str] = geonames.get_serialized_data()
752
+ lng = float(city_data["lng"])
753
+ lat = float(city_data["lat"])
754
+
755
+ subject = AstrologicalSubject(
756
+ name=name,
757
+ year=dt.year,
758
+ month=dt.month,
759
+ day=dt.day,
760
+ hour=dt.hour,
761
+ minute=dt.minute,
762
+ city=city,
763
+ nation=city,
764
+ lng=lng,
765
+ lat=lat,
766
+ tz_str=tz_str,
767
+ online=False,
768
+ geonames_username=geonames_username,
769
+ zodiac_type=zodiac_type,
770
+ disable_chiron=disable_chiron,
771
+ sidereal_mode=sidereal_mode,
772
+ houses_system_identifier=houses_system_identifier,
773
+ perspective_type=perspective_type
774
+ )
775
+
776
+ return subject
777
+
690
778
  if __name__ == "__main__":
691
779
  import json
692
780
  from kerykeion.utilities import setup_logging
@@ -724,8 +812,4 @@ if __name__ == "__main__":
724
812
  print(johnny.json(dump=True, indent=2))
725
813
 
726
814
  # With Topocentric Perspective
727
- johnny = AstrologicalSubject("Johnny Depp", 1963, 6, 9, 0, 0, "Owensboro", "US", perspective_type="Topocentric")
728
-
729
- # Print the utc time
730
- print(johnny.utc_time)
731
- print(johnny.local_time)
815
+ johnny = AstrologicalSubject("Johnny Depp", 1963, 6, 9, 0, 0, "Owensboro", "US", perspective_type="Topocentric")
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "kerykeion"
3
- version = "4.12.1"
3
+ version = "4.12.3"
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