kerykeion 5.0.0a11__py3-none-any.whl → 5.0.0b1__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.

Files changed (56) hide show
  1. kerykeion/__init__.py +32 -9
  2. kerykeion/aspects/__init__.py +2 -4
  3. kerykeion/aspects/aspects_factory.py +530 -0
  4. kerykeion/aspects/aspects_utils.py +75 -6
  5. kerykeion/astrological_subject_factory.py +380 -229
  6. kerykeion/backword.py +680 -0
  7. kerykeion/chart_data_factory.py +484 -0
  8. kerykeion/charts/{kerykeion_chart_svg.py → chart_drawer.py} +612 -439
  9. kerykeion/charts/charts_utils.py +135 -94
  10. kerykeion/charts/draw_planets.py +38 -28
  11. kerykeion/charts/templates/aspect_grid_only.xml +188 -17
  12. kerykeion/charts/templates/chart.xml +104 -28
  13. kerykeion/charts/templates/wheel_only.xml +195 -24
  14. kerykeion/charts/themes/classic.css +11 -0
  15. kerykeion/charts/themes/dark-high-contrast.css +11 -0
  16. kerykeion/charts/themes/dark.css +11 -0
  17. kerykeion/charts/themes/light.css +11 -0
  18. kerykeion/charts/themes/strawberry.css +10 -0
  19. kerykeion/composite_subject_factory.py +4 -4
  20. kerykeion/ephemeris_data_factory.py +12 -9
  21. kerykeion/house_comparison/__init__.py +0 -3
  22. kerykeion/house_comparison/house_comparison_factory.py +51 -18
  23. kerykeion/house_comparison/house_comparison_utils.py +37 -8
  24. kerykeion/planetary_return_factory.py +8 -4
  25. kerykeion/relationship_score_factory.py +5 -5
  26. kerykeion/report.py +748 -67
  27. kerykeion/{kr_types → schemas}/__init__.py +44 -4
  28. kerykeion/schemas/chart_template_model.py +340 -0
  29. kerykeion/{kr_types → schemas}/kr_literals.py +7 -3
  30. kerykeion/{kr_types → schemas}/kr_models.py +247 -21
  31. kerykeion/{kr_types → schemas}/settings_models.py +7 -7
  32. kerykeion/settings/config_constants.py +75 -8
  33. kerykeion/settings/kerykeion_settings.py +1 -1
  34. kerykeion/settings/kr.config.json +130 -40
  35. kerykeion/settings/legacy/legacy_celestial_points_settings.py +8 -8
  36. kerykeion/sweph/ast136/s136108s.se1 +0 -0
  37. kerykeion/sweph/ast136/s136199s.se1 +0 -0
  38. kerykeion/sweph/ast136/s136472s.se1 +0 -0
  39. kerykeion/sweph/ast28/se28978s.se1 +0 -0
  40. kerykeion/sweph/ast50/se50000s.se1 +0 -0
  41. kerykeion/sweph/ast90/se90377s.se1 +0 -0
  42. kerykeion/sweph/ast90/se90482s.se1 +0 -0
  43. kerykeion/sweph/sefstars.txt +1602 -0
  44. kerykeion/transits_time_range_factory.py +11 -11
  45. kerykeion/utilities.py +61 -38
  46. kerykeion-5.0.0b1.dist-info/METADATA +1055 -0
  47. kerykeion-5.0.0b1.dist-info/RECORD +58 -0
  48. kerykeion/aspects/natal_aspects_factory.py +0 -235
  49. kerykeion/aspects/synastry_aspects_factory.py +0 -275
  50. kerykeion/house_comparison/house_comparison_models.py +0 -38
  51. kerykeion/kr_types/chart_types.py +0 -106
  52. kerykeion-5.0.0a11.dist-info/METADATA +0 -641
  53. kerykeion-5.0.0a11.dist-info/RECORD +0 -50
  54. /kerykeion/{kr_types → schemas}/kerykeion_exception.py +0 -0
  55. {kerykeion-5.0.0a11.dist-info → kerykeion-5.0.0b1.dist-info}/WHEEL +0 -0
  56. {kerykeion-5.0.0a11.dist-info → kerykeion-5.0.0b1.dist-info}/licenses/LICENSE +0 -0
@@ -1,641 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: kerykeion
3
- Version: 5.0.0a11
4
- Summary: A Python library for astrological calculations, including natal charts, houses, planetary aspects, and SVG chart generation.
5
- Project-URL: Homepage, https://www.kerykeion.net/
6
- Project-URL: Repository, https://github.com/g-battaglia/kerykeion
7
- Author-email: Giacomo Battaglia <kerykeion.astrology@gmail.com>
8
- License: AGPL-3.0
9
- License-File: LICENSE
10
- Keywords: astrology,astrology calculations,astrology calculator,astrology library,astrology transits,astronomical algorithms,birth chart,ephemeris,houses of astrology,natal chart,planetary aspects,svg charts,synastry,zodiac,zodiac signs
11
- Classifier: Development Status :: 5 - Production/Stable
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Intended Audience :: Information Technology
14
- Classifier: Intended Audience :: Science/Research
15
- Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
16
- Classifier: Operating System :: OS Independent
17
- Classifier: Programming Language :: Python :: 3 :: Only
18
- Classifier: Programming Language :: Python :: 3.9
19
- Classifier: Programming Language :: Python :: 3.10
20
- Classifier: Programming Language :: Python :: 3.11
21
- Classifier: Programming Language :: Python :: 3.12
22
- Classifier: Programming Language :: Python :: 3.13
23
- Classifier: Topic :: Religion
24
- Classifier: Topic :: Scientific/Engineering :: Astronomy
25
- Classifier: Topic :: Scientific/Engineering :: Visualization
26
- Classifier: Topic :: Software Development
27
- Classifier: Topic :: Software Development :: Libraries
28
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
29
- Classifier: Typing :: Typed
30
- Requires-Python: >=3.9
31
- Requires-Dist: pydantic>=2.5
32
- Requires-Dist: pyswisseph>=2.10.3.1
33
- Requires-Dist: pytz>=2024.2
34
- Requires-Dist: requests-cache>=1.2.1
35
- Requires-Dist: requests>=2.32.3
36
- Requires-Dist: scour>=0.38.2
37
- Requires-Dist: simple-ascii-tables>=1.0.0
38
- Requires-Dist: typing-extensions>=4.12.2
39
- Description-Content-Type: text/markdown
40
-
41
- <h1 align="center">Kerykeion</h1>
42
-
43
- <div align="center">
44
- <img src="https://img.shields.io/github/stars/g-battaglia/kerykeion.svg?logo=github" alt="stars">
45
- <img src="https://img.shields.io/github/forks/g-battaglia/kerykeion.svg?logo=github" alt="forks">
46
- </div>
47
- <div align="center">
48
- <img src="https://static.pepy.tech/badge/kerykeion/month" alt="PyPI Downloads">
49
- <img src="https://static.pepy.tech/badge/kerykeion/week" alt="PyPI Downloads">
50
- <img src="https://img.shields.io/github/contributors/g-battaglia/kerykeion?color=blue&logo=github" alt="contributors">
51
- <img src="https://img.shields.io/pypi/v/kerykeion?label=pypi%20package" alt="Package version">
52
- <img src="https://img.shields.io/pypi/pyversions/kerykeion.svg" alt="Supported Python versions">
53
- </div>
54
- <p align="center">⭐ Like this project? Star it on GitHub and help it grow! ⭐</p>
55
- &nbsp;
56
-
57
- Kerykeion is a Python library for astrology. It computes planetary and house positions, detects aspects, and generates SVG charts—including birth, synastry, transit, and composite charts. You can also customize which planets to include in your calculations.
58
-
59
- The main goal of this project is to offer a clean, data-driven approach to astrology, making it accessible and programmable.
60
-
61
- Kerykeion also integrates seamlessly with LLM and AI applications.
62
-
63
- Here is an example of a birthchart:
64
-
65
- ![John Lenon Chart](https://raw.githubusercontent.com/g-battaglia/kerykeion/refs/heads/master/tests/charts/svg/John%20Lennon%20-%20Dark%20Theme%20-%20Natal%20Chart.svg)
66
-
67
- **Web API**
68
- ---
69
-
70
- If you want to use Kerykeion in a web application, you can try the dedicated web API:
71
-
72
- **[AstrologerAPI](https://rapidapi.com/gbattaglia/api/astrologer/pricing)**
73
-
74
- It is [open source](https://github.com/g-battaglia/Astrologer-API) and directly supports this project.
75
-
76
- **Donate**
77
- --
78
-
79
- Maintaining this project requires substantial time and effort. The Astrologer API alone cannot cover the costs of full-time development. If you find Kerykeion valuable and would like to support further development, please consider donating:
80
-
81
- [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/kerykeion)
82
-
83
- ## ⚠️ Development Branch Notice
84
-
85
- This branch (`next`) is **not the stable version** of Kerykeion. It is the **development branch for the upcoming V5 release**.
86
-
87
- If you're looking for the latest stable version, please check out the [`master`](https://github.com/g-battaglia/kerykeion/tree/master) branch instead.
88
-
89
- ## Table of Contents
90
- - [**Web API**](#web-api)
91
- - [**Donate**](#donate)
92
- - [⚠️ Development Branch Notice](#️-development-branch-notice)
93
- - [Table of Contents](#table-of-contents)
94
- - [Installation](#installation)
95
- - [Basic Usage](#basic-usage)
96
- - [Generate a SVG Chart](#generate-a-svg-chart)
97
- - [Birth Chart](#birth-chart)
98
- - [External Birth Chart](#external-birth-chart)
99
- - [Synastry Chart](#synastry-chart)
100
- - [Transit Chart](#transit-chart)
101
- - [Composite Chart](#composite-chart)
102
- - [Wheel Only Charts](#wheel-only-charts)
103
- - [Birth Chart](#birth-chart-1)
104
- - [Wheel Only Birth Chart (External)](#wheel-only-birth-chart-external)
105
- - [Synastry Chart](#synastry-chart-1)
106
- - [Change the Output Directory](#change-the-output-directory)
107
- - [Change Language](#change-language)
108
- - [Minified SVG](#minified-svg)
109
- - [SVG without CSS Variables](#svg-without-css-variables)
110
- - [Grid Only SVG](#grid-only-svg)
111
- - [Report](#report)
112
- - [Example: Retrieving Aspects](#example-retrieving-aspects)
113
- - [Ayanamsa (Sidereal Modes)](#ayanamsa-sidereal-modes)
114
- - [House Systems](#house-systems)
115
- - [Perspective Type](#perspective-type)
116
- - [Themes](#themes)
117
- - [Alternative Initialization](#alternative-initialization)
118
- - [Lunar Nodes (Rahu \& Ketu)](#lunar-nodes-rahu--ketu)
119
- - [JSON Support](#json-support)
120
- - [Auto Generated Documentation](#auto-generated-documentation)
121
- - [Development](#development)
122
- - [Integrating Kerykeion into Your Project](#integrating-kerykeion-into-your-project)
123
- - [License](#license)
124
- - [Contributing](#contributing)
125
- - [Citations](#citations)
126
-
127
- ## Installation
128
-
129
- Kerykeion requires **Python 3.9** or higher.
130
-
131
- ```bash
132
- pip3 install kerykeion
133
- ```
134
-
135
- ## Basic Usage
136
-
137
- Below is a simple example illustrating the creation of an astrological subject and retrieving astrological details:
138
-
139
- ```python
140
- from kerykeion import AstrologicalSubjectFactory
141
-
142
- # Create an instance of the AstrologicalSubjectFactory class.
143
- # Arguments: Name, year, month, day, hour, minutes, city, nation
144
- john = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
145
-
146
- # Retrieve information about the Sun:
147
- print(john.sun.model_dump_json())
148
- # > {"name":"Sun","quality":"Cardinal","element":"Air","sign":"Lib","sign_num":6,"position":16.26789199474399,"abs_pos":196.267891994744,"emoji":"♎️","point_type":"AstrologicalPoint","house":"Sixth_House","retrograde":false}
149
-
150
- # Retrieve information about the first house:
151
- print(john.first_house.model_dump_json())
152
- # > {"name":"First_House","quality":"Cardinal","element":"Fire","sign":"Ari","sign_num":0,"position":19.74676624176799,"abs_pos":19.74676624176799,"emoji":"♈️","point_type":"House","house":null,"retrograde":null}
153
-
154
- # Retrieve the element of the Moon sign:
155
- print(john.moon.element)
156
- # > 'Air'
157
- ```
158
-
159
- **To avoid using GeoNames online, specify longitude, latitude, and timezone instead of city and nation:**
160
-
161
- ```python
162
- john = AstrologicalSubjectFactory.from_birth_data(
163
- "John Lennon", 1940, 10, 9, 18, 30,
164
- lng=-2.9833, # Longitude for Liverpool
165
- lat=53.4000, # Latitude for Liverpool
166
- tz_str="Europe/London", # Timezone for Liverpool
167
- city="Liverpool",
168
- )
169
- ```
170
-
171
- ## Generate a SVG Chart
172
-
173
- To generate a chart, use the `KerykeionChartSVG` class. You can create various types of charts, including birth, synastry, transit, and composite charts.
174
-
175
- **Tip:**
176
- The optimized way to open the generated SVG files is with a web browser (e.g., Chrome, Firefox).
177
- To improve compatibility across different applications, you can use the `remove_css_variables` parameter when generating the SVG. This will inline all styles and eliminate CSS variables, resulting in an SVG that is more broadly supported.
178
-
179
- ### Birth Chart
180
-
181
- ```python
182
- from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
183
-
184
- john = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
185
- birth_chart_svg = KerykeionChartSVG(john)
186
- birth_chart_svg.makeSVG()
187
- ```
188
-
189
- ```python
190
- birth_chart_svg.makeSVG()
191
- ```
192
-
193
- The SVG file will be saved in the home directory.
194
- ![John Lennon Birth Chart](https://raw.githubusercontent.com/g-battaglia/kerykeion/refs/heads/master/tests/charts/svg/John%20Lennon%20-%20Natal%20Chart.svg)
195
-
196
- ### External Birth Chart
197
-
198
- ```python
199
- from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
200
- birth_chart = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
201
- birth_chart_svg = KerykeionChartSVG(birth_chart, chart_type="ExternalNatal")
202
- birth_chart_svg.makeSVG()
203
- ```
204
- ![John Lennon External Birth Chart](https://raw.githubusercontent.com/g-battaglia/kerykeion/refs/heads/master/tests/charts/svg/John%20Lennon%20-%20ExternalNatal%20Chart.svg)
205
-
206
- ### Synastry Chart
207
-
208
- ```python
209
- from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
210
-
211
- first = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
212
- second = AstrologicalSubjectFactory.from_birth_data("Paul McCartney", 1942, 6, 18, 15, 30, "Liverpool", "GB")
213
-
214
- synastry_chart = KerykeionChartSVG(first, "Synastry", second)
215
- synastry_chart.makeSVG()
216
- ```
217
-
218
- ![John Lennon and Paul McCartney Synastry](https://www.kerykeion.net/img/examples/synastry-chart.svg)
219
-
220
-
221
- ### Transit Chart
222
-
223
- ```python
224
- from kerykeion import AstrologicalSubjectFactory
225
-
226
- transit = AstrologicalSubjectFactory.from_birth_data("Transit", 2025, 6, 8, 8, 45, "Atlanta", "US")
227
- subject = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
228
-
229
- transit_chart = KerykeionChartSVG(subject, "Transit", transit)
230
- transit_chart.makeSVG()
231
- ```
232
-
233
- ![John Lennon Transit Chart](https://raw.githubusercontent.com/g-battaglia/kerykeion/refs/heads/master/tests/charts/svg/John%20Lennon%20-%20Transit%20Chart.svg)
234
-
235
- ### Composite Chart
236
-
237
- ```python
238
- from kerykeion import CompositeSubjectFactory, AstrologicalSubjectFactory, KerykeionChartSVG
239
-
240
- angelina = AstrologicalSubjectFactory.from_birth_data("Angelina Jolie", 1975, 6, 4, 9, 9, "Los Angeles", "US", lng=-118.15, lat=34.03, tz_str="America/Los_Angeles")
241
-
242
- brad = AstrologicalSubjectFactory.from_birth_data("Brad Pitt", 1963, 12, 18, 6, 31, "Shawnee", "US", lng=-96.56, lat=35.20, tz_str="America/Chicago")
243
-
244
- factory = CompositeSubjectFactory(angelina, brad)
245
- composite_model = factory.get_midpoint_composite_subject_model()
246
-
247
- composite_chart = KerykeionChartSVG(composite_model, "Composite")
248
- composite_chart.makeSVG()
249
- ```
250
-
251
- ![Angelina Jolie and Brad Pitt Composite Chart](https://raw.githubusercontent.com/g-battaglia/kerykeion/refs/heads/master/tests/charts/svg/Angelina%20Jolie%20and%20Brad%20Pitt%20Composite%20Chart%20-%20Composite%20Chart.svg)
252
-
253
- ## Wheel Only Charts
254
-
255
- For *all* the charts, you can generate a wheel-only chart by using the method `makeWheelOnlySVG()`:
256
-
257
- ### Birth Chart
258
- ```python
259
- from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
260
-
261
- birth_chart = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
262
- birth_chart_svg = KerykeionChartSVG(birth_chart)
263
- birth_chart_svg.makeWheelOnlySVG()
264
- ```
265
- ![John Lennon Birth Chart](https://raw.githubusercontent.com/g-battaglia/kerykeion/refs/heads/master/tests/charts/svg/John%20Lennon%20-%20Wheel%20Only%20-%20Natal%20Chart%20-%20Wheel%20Only.svg)
266
-
267
- ### Wheel Only Birth Chart (External)
268
-
269
- ```python
270
- from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
271
- birth_chart = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
272
- birth_chart_svg = KerykeionChartSVG(birth_chart, chart_type="ExternalNatal")
273
- birth_chart_svg.makeWheelOnlySVG(
274
- wheel_only=True,
275
- wheel_only_external=True
276
- )
277
- ```
278
-
279
- ![John Lennon Birth Chart](https://raw.githubusercontent.com/g-battaglia/kerykeion/refs/heads/master/tests/charts/svg/John%20Lennon%20-%20Wheel%20External%20Only%20-%20ExternalNatal%20Chart%20-%20Wheel%20Only.svg)
280
-
281
- ### Synastry Chart
282
- ```python
283
- from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
284
- first = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
285
- second = AstrologicalSubjectFactory.from_birth_data("Paul McCartney", 1942, 6, 18, 15, 30, "Liverpool", "GB")
286
- synastry_chart = KerykeionChartSVG(
287
- first, "Synastry", second
288
- )
289
- synastry_chart.makeWheelOnlySVG()
290
- ```
291
-
292
- ![John Lennon and Paul McCartney Synastry](https://raw.githubusercontent.com/g-battaglia/kerykeion/refs/heads/master/tests/charts/svg/John%20Lennon%20-%20Wheel%20Synastry%20Only%20-%20Synastry%20Chart%20-%20Wheel%20Only.svg)
293
-
294
- ### Change the Output Directory
295
-
296
- To save the SVG file in a custom location, specify `new_output_directory`:
297
-
298
- ```python
299
- from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
300
-
301
- first = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
302
- second = AstrologicalSubjectFactory.from_birth_data("Paul McCartney", 1942, 6, 18, 15, 30, "Liverpool", "GB")
303
-
304
- synastry_chart = KerykeionChartSVG(
305
- first, "Synastry", second,
306
- new_output_directory="."
307
- )
308
- synastry_chart.makeSVG()
309
- ```
310
-
311
- ### Change Language
312
-
313
- You can switch chart language by passing `chart_language` to the `KerykeionChartSVG` class:
314
-
315
- ```python
316
- from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
317
-
318
- first = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
319
- birth_chart_svg = KerykeionChartSVG(
320
- birth_chart,
321
- chart_language="IT" # Change to Italian
322
- )
323
- birth_chart_svg.makeSVG()
324
- ```
325
-
326
- More details [here](https://www.kerykeion.net/docs/chart-language).
327
-
328
- The available languages are:
329
- - EN (English)
330
- - FR (French)
331
- - PT (Portuguese)
332
- - ES (Spanish)
333
- - TR (Turkish)
334
- - RU (Russian)
335
- - IT (Italian)
336
- - CN (Chinese)
337
- - DE (German)
338
-
339
-
340
- ### Minified SVG
341
- To generate a minified SVG, set `minify_svg=True` in the `makeSVG()` method:
342
-
343
- ```python
344
- from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
345
- first = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
346
- birth_chart_svg = KerykeionChartSVG(birth_chart)
347
- birth_chart_svg.makeSVG(
348
- minify=True
349
- )
350
- ```
351
-
352
- ### SVG without CSS Variables
353
- To generate an SVG without CSS variables, set `remove_css_variables=True` in the `makeSVG()` method:
354
-
355
- ```python
356
- from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
357
-
358
- first = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
359
- birth_chart_svg = KerykeionChartSVG(birth_chart)
360
- birth_chart_svg.makeSVG(
361
- remove_css_variables=True
362
- )
363
- ```
364
- This will inline all styles and eliminate CSS variables, resulting in an SVG that is more broadly supported.
365
-
366
-
367
- ### Grid Only SVG
368
-
369
- It's possible to generate a grid-only SVG, useful for creating a custom layout. To do this, use the `makeGridOnlySVG()` method:
370
-
371
- ```python
372
- from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
373
- birth_chart = AstrologicalSubjectFactory.from_birth_data("John Lennon - Aspect Grid Dark Synastry", 1977, 6, 8, 8, 45, "Atlanta", "US")
374
- aspect_grid_dark_synastry_chart = KerykeionChartSVG(aspect_grid_dark_synastry_subject, "Synastry", second, theme="dark")
375
- aspect_grid_dark_synastry_chart.makeAspectGridOnlySVG()
376
- ```
377
- ![John Lennon Birth Chart](https://raw.githubusercontent.com/g-battaglia/kerykeion/refs/heads/master/tests/charts/svg/John%20Lennon%20-%20Aspect%20Grid%20Only%20-%20Natal%20Chart%20-%20Aspect%20Grid%20Only.svg)
378
-
379
- ## Report
380
-
381
- ```python
382
- from kerykeion import Report, AstrologicalSubjectFactory
383
-
384
- john = AstrologicalSubjectFactory.from_birth_data(
385
- "John Lennon", 1940, 10, 9, 18, 30,
386
- lng=-2.9833, # Longitude for Liverpool
387
- lat=53.4000, # Latitude for Liverpool
388
- tz_str="Europe/London", # Timezone for Liverpool
389
- city="Liverpool",
390
- )
391
- report = Report(john)
392
- report.print_report()
393
- ```
394
-
395
- Report output:
396
- ```plaintext
397
- +- Kerykeion report for John Lennon -+
398
- +-----------+-------+---------------+-----------+----------+
399
- | Date | Time | Location | Longitude | Latitude |
400
- +-----------+-------+---------------+-----------+----------+
401
- | 9/10/1940 | 18:30 | Liverpool, GB | -2.9833 | 53.4 |
402
- +-----------+-------+---------------+-----------+----------+
403
- +-------------------+------+-------+------+----------------+
404
- | AstrologicalPoint | Sign | Pos. | Ret. | House |
405
- +-------------------+------+-------+------+----------------+
406
- | Sun | Lib | 16.27 | - | Sixth_House |
407
- | Moon | Aqu | 3.55 | - | Eleventh_House |
408
- | Mercury | Sco | 8.56 | - | Seventh_House |
409
- | Venus | Vir | 3.22 | - | Sixth_House |
410
- | Mars | Lib | 2.66 | - | Sixth_House |
411
- | Jupiter | Tau | 13.69 | R | First_House |
412
- | Saturn | Tau | 13.22 | R | First_House |
413
- | Uranus | Tau | 25.55 | R | First_House |
414
- | Neptune | Vir | 26.03 | - | Sixth_House |
415
- | Pluto | Leo | 4.19 | - | Fifth_House |
416
- | Mean_Node | Lib | 10.58 | R | Sixth_House |
417
- | Mean_South_Node | Ari | 10.58 | R | Twelfth_House |
418
- | Mean_Lilith | Ari | 13.37 | - | Twelfth_House |
419
- | Chiron | Leo | 0.57 | - | Fifth_House |
420
- +-------------------+------+-------+------+----------------+
421
- +----------------+------+----------+
422
- | House | Sign | Position |
423
- +----------------+------+----------+
424
- | First_House | Ari | 19.72 |
425
- | Second_House | Tau | 29.52 |
426
- | Third_House | Gem | 20.23 |
427
- | Fourth_House | Can | 7.07 |
428
- | Fifth_House | Can | 25.31 |
429
- | Sixth_House | Leo | 22.11 |
430
- | Seventh_House | Lib | 19.72 |
431
- | Eighth_House | Sco | 29.52 |
432
- | Ninth_House | Sag | 20.23 |
433
- | Tenth_House | Cap | 7.07 |
434
- | Eleventh_House | Cap | 25.31 |
435
- | Twelfth_House | Aqu | 22.11 |
436
- +----------------+------+----------+
437
- ```
438
-
439
- To export to a file:
440
-
441
- ```bash
442
- python3 your_script_name.py > file.txt
443
- ```
444
-
445
- ## Example: Retrieving Aspects
446
-
447
- ```python
448
- from kerykeion import SynastryAspects, AstrologicalSubject
449
-
450
- first = AstrologicalSubjectFactory.from_birth_data("Jack", 1990, 6, 15, 15, 15, "Roma", "IT")
451
- second = AstrologicalSubjectFactory.from_birth_data("Jane", 1991, 10, 25, 21, 0, "Roma", "IT")
452
-
453
- name = SynastryAspects(first, second)
454
- aspect_list = name.get_relevant_aspects()
455
- print(aspect_list[0])
456
- #> {'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}
457
-
458
- ```
459
-
460
- ## Ayanamsa (Sidereal Modes)
461
-
462
- By default, the zodiac type is **Tropical**. To use **Sidereal**, specify the sidereal mode:
463
-
464
- ```python
465
- johnny = AstrologicalSubjectFactory.from_birth_data(
466
- "Johnny Depp", 1963, 6, 9, 0, 0,
467
- "Owensboro", "US",
468
- zodiac_type="Sidereal",
469
- sidereal_mode="LAHIRI"
470
- )
471
- ```
472
-
473
- More examples [here](https://www.kerykeion.net/docs//sidereal-modes/).
474
-
475
- Full list of supported sidereal modes [here](https://www.kerykeion.net/pydocs/kerykeion/kr_types/kr_literals.html#SiderealMode).
476
-
477
- ## House Systems
478
-
479
- By default, houses are calculated using **Placidus**. Configure a different house system as follows:
480
-
481
- ```python
482
- johnny = AstrologicalSubjectFactory.from_birth_data(
483
- "Johnny Depp", 1963, 6, 9, 0, 0,
484
- "Owensboro", "US",
485
- houses_system="M"
486
- )
487
- ```
488
-
489
- More examples [here](https://www.kerykeion.net/docs//houses-systems/).
490
-
491
- Full list of supported house systems [here](https://www.kerykeion.net/pydocs/kerykeion/kr_types/kr_literals.html#HousesSystem).
492
-
493
- So far all the available houses system in the Swiss Ephemeris are supported but the Gauquelin Sectors.
494
-
495
- ## Perspective Type
496
-
497
- By default, Kerykeion uses the **Apparent Geocentric** perspective (the most standard in astrology). Other perspectives (e.g., **Heliocentric**) can be set this way:
498
-
499
- ```python
500
- johnny = AstrologicalSubjectFactory.from_birth_data(
501
- "Johnny Depp", 1963, 6, 9, 0, 0,
502
- "Owensboro", "US",
503
- perspective_type="Heliocentric"
504
- )
505
- ```
506
-
507
- More examples [here](https://www.kerykeion.net/docs//perspective-type/).
508
-
509
- Full list of supported perspective types [here](https://www.kerykeion.net/pydocs/kerykeion/kr_types/kr_literals.html#PerspectiveType).
510
-
511
- ## Themes
512
-
513
- Kerykeion provides several chart themes:
514
-
515
- - **Classic** (default)
516
- - **Dark**
517
- - **Dark High Contrast**
518
- - **Light**
519
-
520
- Each theme offers a distinct visual style, allowing you to choose the one that best suits your preferences or presentation needs. If you prefer more control over the appearance, you can opt not to set any theme, making it easier to customize the chart by overriding the default CSS variables. For more detailed instructions on how to apply themes, check the [documentation](https://www.kerykeion.net/docs/theming)
521
-
522
- Here's an example of how to set the theme:
523
-
524
- ```python
525
- from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
526
-
527
- dark_theme_subject = AstrologicalSubjectFactory.from_birth_data("John Lennon - Dark Theme", 1940, 10, 9, 18, 30, "Liverpool", "GB")
528
- dark_theme_natal_chart = KerykeionChartSVG(dark_high_contrast_theme_subject, theme="dark_high_contrast")
529
- dark_theme_natal_chart.makeSVG()
530
- ```
531
-
532
- ![John Lennon](https://www.kerykeion.net/img/showcase/John%20Lennon%20-%20Dark%20-%20Natal%20Chart.svg)
533
-
534
- ## Alternative Initialization
535
-
536
- Create an `AstrologicalSubject` from a UTC ISO 8601 string:
537
-
538
- ```python
539
- subject = AstrologicalSubject.get_from_iso_utc_time(
540
- "Johnny Depp", "1963-06-09T05:00:00Z", "Owensboro", "US"
541
- )
542
- ```
543
-
544
- If you set `online=True`, provide a `geonames_username` to allow city-based geolocation:
545
-
546
- ```python
547
- from kerykeion.astrological_subject import AstrologicalSubjectFactory
548
-
549
- subject = AstrologicalSubject.get_from_iso_utc_time(
550
- "Johnny Depp", "1963-06-09T05:00:00Z", "Owensboro", "US", online=True
551
- )
552
- ```
553
-
554
- ## Lunar Nodes (Rahu & Ketu)
555
-
556
- Kerykeion supports both **True** and **Mean** Lunar Nodes:
557
-
558
- - **True North Lunar Node**: `"true_node"` (name kept without "north" for backward compatibility).
559
- - **True South Lunar Node**: `"true_south_node"`.
560
- - **Mean North Lunar Node**: `"mean_node"` (name kept without "north" for backward compatibility).
561
- - **Mean South Lunar Node**: `"mean_south_node"`.
562
-
563
- In instances of the classes used to generate aspects and SVG charts, only the mean nodes are active. To activate the true nodes, you need to pass the `active_points` parameter to the `KerykeionChartSVG` class.
564
-
565
- Example:
566
-
567
- ```python
568
- from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
569
-
570
- subject = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
571
-
572
- chart = KerykeionChartSVG(
573
- subject,
574
- active_points=[
575
- "Sun",
576
- "Moon",
577
- "Mercury",
578
- "Venus",
579
- "Mars",
580
- "Jupiter",
581
- "Saturn",
582
- "Uranus",
583
- "Neptune",
584
- "Pluto",
585
- "Mean_Node",
586
- "Mean_South_Node",
587
- "True_Node", # Activates True North Node
588
- "True_South_Node", # Activates True South Node
589
- "Ascendant",
590
- "Medium_Coeli",
591
- "Descendant",
592
- "Imum_Coeli"
593
- ]
594
- )
595
- chart.makeSVG()
596
- ```
597
-
598
- ## JSON Support
599
-
600
- You can serialize the astrological subject (the base data used throughout the library) to JSON:
601
-
602
- ```python
603
- from kerykeion import AstrologicalSubjectFactory
604
-
605
- johnny = AstrologicalSubjectFactory.from_birth_data("Johnny Depp", 1963, 6, 9, 0, 0, "Owensboro", "US")
606
-
607
- print(johnny.json(dump=False, indent=2))
608
- ```
609
-
610
- ## Auto Generated Documentation
611
-
612
- You can find auto-generated documentation [here](https://www.kerykeion.net/pydocs/kerykeion.html). Most classes and functions include docstrings.
613
-
614
- ## Development
615
-
616
- Clone the repository or download the ZIP via the GitHub interface.
617
-
618
- ## Integrating Kerykeion into Your Project
619
-
620
- If you would like to incorporate Kerykeion’s astrological features into your application, please reach out via [email](mailto:kerykeion.astrology@gmail.com?subject=Integration%20Request). Whether you need custom features, support, or specialized consulting, I am happy to discuss potential collaborations.
621
-
622
- ## License
623
-
624
- This project is covered under the AGPL-3.0 License. For detailed information, please see the [LICENSE](LICENSE) file. If you have questions, feel free to contact me at [kerykeion.astrology@gmail.com](mailto:kerykeion.astrology@gmail.com?subject=Kerykeion).
625
-
626
- As a rule of thumb, if you use this library in a project, you should open-source that project under a compatible license. Alternatively, if you wish to keep your source closed, consider using the [AstrologerAPI](https://rapidapi.com/gbattaglia/api/astrologer/), which is AGPL-3.0 compliant and also helps support the project.
627
-
628
- Since the AstrologerAPI is an external third-party service, using it does *not* require your code to be open-source.
629
-
630
- ## Contributing
631
-
632
- Contributions are welcome! Feel free to submit pull requests or report issues.
633
-
634
- ## Citations
635
-
636
- If using Kerykeion in published or academic work, please cite as follows:
637
-
638
- ```
639
- Battaglia, G. (2025). Kerykeion: A Python Library for Astrological Calculations and Chart Generation.
640
- https://github.com/g-battaglia/kerykeion
641
- ```