kerykeion 5.0.0a9__py3-none-any.whl → 5.1.8__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 +50 -9
- kerykeion/aspects/__init__.py +5 -2
- kerykeion/aspects/aspects_factory.py +568 -0
- kerykeion/aspects/aspects_utils.py +78 -11
- kerykeion/astrological_subject_factory.py +1032 -275
- kerykeion/backword.py +820 -0
- kerykeion/chart_data_factory.py +552 -0
- kerykeion/charts/chart_drawer.py +2661 -0
- kerykeion/charts/charts_utils.py +652 -399
- kerykeion/charts/draw_planets.py +603 -353
- kerykeion/charts/templates/aspect_grid_only.xml +326 -198
- kerykeion/charts/templates/chart.xml +306 -256
- kerykeion/charts/templates/wheel_only.xml +330 -200
- kerykeion/charts/themes/black-and-white.css +148 -0
- kerykeion/charts/themes/classic.css +11 -0
- kerykeion/charts/themes/dark-high-contrast.css +11 -0
- kerykeion/charts/themes/dark.css +11 -0
- kerykeion/charts/themes/light.css +11 -0
- kerykeion/charts/themes/strawberry.css +10 -0
- kerykeion/composite_subject_factory.py +232 -13
- kerykeion/ephemeris_data_factory.py +443 -0
- kerykeion/fetch_geonames.py +78 -21
- kerykeion/house_comparison/__init__.py +4 -1
- kerykeion/house_comparison/house_comparison_factory.py +52 -19
- kerykeion/house_comparison/house_comparison_utils.py +37 -9
- kerykeion/kr_types/__init__.py +66 -6
- kerykeion/kr_types/chart_template_model.py +20 -0
- kerykeion/kr_types/kerykeion_exception.py +15 -9
- kerykeion/kr_types/kr_literals.py +14 -160
- kerykeion/kr_types/kr_models.py +14 -291
- kerykeion/kr_types/settings_models.py +15 -167
- kerykeion/planetary_return_factory.py +545 -40
- kerykeion/relationship_score_factory.py +137 -63
- kerykeion/report.py +749 -64
- kerykeion/schemas/__init__.py +106 -0
- kerykeion/schemas/chart_template_model.py +367 -0
- kerykeion/schemas/kerykeion_exception.py +20 -0
- kerykeion/schemas/kr_literals.py +181 -0
- kerykeion/schemas/kr_models.py +603 -0
- kerykeion/schemas/settings_models.py +188 -0
- kerykeion/settings/__init__.py +20 -1
- kerykeion/settings/chart_defaults.py +444 -0
- kerykeion/settings/config_constants.py +88 -12
- kerykeion/settings/kerykeion_settings.py +32 -75
- kerykeion/settings/translation_strings.py +1499 -0
- kerykeion/settings/translations.py +74 -0
- kerykeion/sweph/ast136/s136108s.se1 +0 -0
- kerykeion/sweph/ast136/s136199s.se1 +0 -0
- kerykeion/sweph/ast136/s136472s.se1 +0 -0
- kerykeion/sweph/ast28/se28978s.se1 +0 -0
- kerykeion/sweph/ast50/se50000s.se1 +0 -0
- kerykeion/sweph/ast90/se90377s.se1 +0 -0
- kerykeion/sweph/ast90/se90482s.se1 +0 -0
- kerykeion/sweph/sefstars.txt +1602 -0
- kerykeion/transits_time_range_factory.py +302 -0
- kerykeion/utilities.py +289 -204
- kerykeion-5.1.8.dist-info/METADATA +1793 -0
- kerykeion-5.1.8.dist-info/RECORD +63 -0
- kerykeion/aspects/natal_aspects.py +0 -181
- kerykeion/aspects/synastry_aspects.py +0 -141
- kerykeion/aspects/transits_time_range.py +0 -41
- kerykeion/charts/draw_planets_v2.py +0 -649
- kerykeion/charts/draw_planets_v3.py +0 -679
- kerykeion/charts/kerykeion_chart_svg.py +0 -2038
- kerykeion/enums.py +0 -57
- kerykeion/ephemeris_data.py +0 -238
- kerykeion/house_comparison/house_comparison_models.py +0 -38
- kerykeion/kr_types/chart_types.py +0 -106
- kerykeion/settings/kr.config.json +0 -1304
- kerykeion/settings/legacy/__init__.py +0 -0
- kerykeion/settings/legacy/legacy_celestial_points_settings.py +0 -299
- kerykeion/settings/legacy/legacy_chart_aspects_settings.py +0 -71
- kerykeion/settings/legacy/legacy_color_settings.py +0 -42
- kerykeion/transits_time_range.py +0 -128
- kerykeion-5.0.0a9.dist-info/METADATA +0 -636
- kerykeion-5.0.0a9.dist-info/RECORD +0 -55
- kerykeion-5.0.0a9.dist-info/entry_points.txt +0 -2
- {kerykeion-5.0.0a9.dist-info → kerykeion-5.1.8.dist-info}/WHEEL +0 -0
- {kerykeion-5.0.0a9.dist-info → kerykeion-5.1.8.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,636 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: kerykeion
|
|
3
|
-
Version: 5.0.0a9
|
|
4
|
-
Summary: A python library for astrology.
|
|
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 library,astrology-calculator,astronomical-algorithms,birtchart,ephemeris,svg,synastry,zodiac,zodiac-sing
|
|
11
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
-
Classifier: Intended Audience :: Developers
|
|
13
|
-
Classifier: Intended Audience :: Information Technology
|
|
14
|
-
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
|
|
15
|
-
Classifier: Operating System :: OS Independent
|
|
16
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
-
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
21
|
-
Classifier: Topic :: Software Development
|
|
22
|
-
Classifier: Topic :: Software Development :: Libraries
|
|
23
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
-
Classifier: Typing :: Typed
|
|
25
|
-
Requires-Python: >=3.9
|
|
26
|
-
Requires-Dist: pydantic>=2.5
|
|
27
|
-
Requires-Dist: pyswisseph>=2.10.3.1
|
|
28
|
-
Requires-Dist: pytz>=2024.2
|
|
29
|
-
Requires-Dist: requests-cache>=1.2.1
|
|
30
|
-
Requires-Dist: requests>=2.32.3
|
|
31
|
-
Requires-Dist: scour>=0.38.2
|
|
32
|
-
Requires-Dist: simple-ascii-tables>=1.0.0
|
|
33
|
-
Requires-Dist: typing-extensions>=4.12.2
|
|
34
|
-
Description-Content-Type: text/markdown
|
|
35
|
-
|
|
36
|
-
<h1 align="center">Kerykeion</h1>
|
|
37
|
-
|
|
38
|
-
<div align="center">
|
|
39
|
-
<img src="https://img.shields.io/github/stars/g-battaglia/kerykeion.svg?logo=github" alt="stars">
|
|
40
|
-
<img src="https://img.shields.io/github/forks/g-battaglia/kerykeion.svg?logo=github" alt="forks">
|
|
41
|
-
</div>
|
|
42
|
-
<div align="center">
|
|
43
|
-
<img src="https://static.pepy.tech/badge/kerykeion/month" alt="PyPI Downloads">
|
|
44
|
-
<img src="https://static.pepy.tech/badge/kerykeion/week" alt="PyPI Downloads">
|
|
45
|
-
<img src="https://img.shields.io/github/contributors/g-battaglia/kerykeion?color=blue&logo=github" alt="contributors">
|
|
46
|
-
<img src="https://img.shields.io/pypi/v/kerykeion?label=pypi%20package" alt="Package version">
|
|
47
|
-
<img src="https://img.shields.io/pypi/pyversions/kerykeion.svg" alt="Supported Python versions">
|
|
48
|
-
</div>
|
|
49
|
-
<p align="center">⭐ Like this project? Star it on GitHub and help it grow! ⭐</p>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
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.
|
|
53
|
-
|
|
54
|
-
The main goal of this project is to offer a clean, data-driven approach to astrology, making it accessible and programmable.
|
|
55
|
-
|
|
56
|
-
Kerykeion also integrates seamlessly with LLM and AI applications.
|
|
57
|
-
|
|
58
|
-
Here is an example of a birthchart:
|
|
59
|
-
|
|
60
|
-

|
|
61
|
-
|
|
62
|
-
**Web API**
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
If you want to use Kerykeion in a web application, you can try the dedicated web API:
|
|
66
|
-
|
|
67
|
-
**[AstrologerAPI](https://rapidapi.com/gbattaglia/api/astrologer/pricing)**
|
|
68
|
-
|
|
69
|
-
It is [open source](https://github.com/g-battaglia/Astrologer-API) and directly supports this project.
|
|
70
|
-
|
|
71
|
-
**Donate**
|
|
72
|
-
--
|
|
73
|
-
|
|
74
|
-
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:
|
|
75
|
-
|
|
76
|
-
[](https://ko-fi.com/kerykeion)
|
|
77
|
-
|
|
78
|
-
## ⚠️ Development Branch Notice
|
|
79
|
-
|
|
80
|
-
This branch (`next`) is **not the stable version** of Kerykeion. It is the **development branch for the upcoming V5 release**.
|
|
81
|
-
|
|
82
|
-
If you're looking for the latest stable version, please check out the [`master`](https://github.com/g-battaglia/kerykeion/tree/master) branch instead.
|
|
83
|
-
|
|
84
|
-
## Table of Contents
|
|
85
|
-
- [**Web API**](#web-api)
|
|
86
|
-
- [**Donate**](#donate)
|
|
87
|
-
- [⚠️ Development Branch Notice](#️-development-branch-notice)
|
|
88
|
-
- [Table of Contents](#table-of-contents)
|
|
89
|
-
- [Installation](#installation)
|
|
90
|
-
- [Basic Usage](#basic-usage)
|
|
91
|
-
- [Generate a SVG Chart](#generate-a-svg-chart)
|
|
92
|
-
- [Birth Chart](#birth-chart)
|
|
93
|
-
- [External Birth Chart](#external-birth-chart)
|
|
94
|
-
- [Synastry Chart](#synastry-chart)
|
|
95
|
-
- [Transit Chart](#transit-chart)
|
|
96
|
-
- [Composite Chart](#composite-chart)
|
|
97
|
-
- [Wheel Only Charts](#wheel-only-charts)
|
|
98
|
-
- [Birth Chart](#birth-chart-1)
|
|
99
|
-
- [Wheel Only Birth Chart (External)](#wheel-only-birth-chart-external)
|
|
100
|
-
- [Synastry Chart](#synastry-chart-1)
|
|
101
|
-
- [Change the Output Directory](#change-the-output-directory)
|
|
102
|
-
- [Change Language](#change-language)
|
|
103
|
-
- [Minified SVG](#minified-svg)
|
|
104
|
-
- [SVG without CSS Variables](#svg-without-css-variables)
|
|
105
|
-
- [Grid Only SVG](#grid-only-svg)
|
|
106
|
-
- [Report](#report)
|
|
107
|
-
- [Example: Retrieving Aspects](#example-retrieving-aspects)
|
|
108
|
-
- [Ayanamsa (Sidereal Modes)](#ayanamsa-sidereal-modes)
|
|
109
|
-
- [House Systems](#house-systems)
|
|
110
|
-
- [Perspective Type](#perspective-type)
|
|
111
|
-
- [Themes](#themes)
|
|
112
|
-
- [Alternative Initialization](#alternative-initialization)
|
|
113
|
-
- [Lunar Nodes (Rahu \& Ketu)](#lunar-nodes-rahu--ketu)
|
|
114
|
-
- [JSON Support](#json-support)
|
|
115
|
-
- [Auto Generated Documentation](#auto-generated-documentation)
|
|
116
|
-
- [Development](#development)
|
|
117
|
-
- [Integrating Kerykeion into Your Project](#integrating-kerykeion-into-your-project)
|
|
118
|
-
- [License](#license)
|
|
119
|
-
- [Contributing](#contributing)
|
|
120
|
-
- [Citations](#citations)
|
|
121
|
-
|
|
122
|
-
## Installation
|
|
123
|
-
|
|
124
|
-
Kerykeion requires **Python 3.9** or higher.
|
|
125
|
-
|
|
126
|
-
```bash
|
|
127
|
-
pip3 install kerykeion
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
## Basic Usage
|
|
131
|
-
|
|
132
|
-
Below is a simple example illustrating the creation of an astrological subject and retrieving astrological details:
|
|
133
|
-
|
|
134
|
-
```python
|
|
135
|
-
from kerykeion import AstrologicalSubjectFactory
|
|
136
|
-
|
|
137
|
-
# Create an instance of the AstrologicalSubjectFactory class.
|
|
138
|
-
# Arguments: Name, year, month, day, hour, minutes, city, nation
|
|
139
|
-
john = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
|
|
140
|
-
|
|
141
|
-
# Retrieve information about the Sun:
|
|
142
|
-
print(john.sun.model_dump_json())
|
|
143
|
-
# > {"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}
|
|
144
|
-
|
|
145
|
-
# Retrieve information about the first house:
|
|
146
|
-
print(john.first_house.model_dump_json())
|
|
147
|
-
# > {"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}
|
|
148
|
-
|
|
149
|
-
# Retrieve the element of the Moon sign:
|
|
150
|
-
print(john.moon.element)
|
|
151
|
-
# > 'Air'
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
**To avoid using GeoNames online, specify longitude, latitude, and timezone instead of city and nation:**
|
|
155
|
-
|
|
156
|
-
```python
|
|
157
|
-
john = AstrologicalSubjectFactory.from_birth_data(
|
|
158
|
-
"John Lennon", 1940, 10, 9, 18, 30,
|
|
159
|
-
lng=-2.9833, # Longitude for Liverpool
|
|
160
|
-
lat=53.4000, # Latitude for Liverpool
|
|
161
|
-
tz_str="Europe/London", # Timezone for Liverpool
|
|
162
|
-
city="Liverpool",
|
|
163
|
-
)
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
## Generate a SVG Chart
|
|
167
|
-
|
|
168
|
-
To generate a chart, use the `KerykeionChartSVG` class. You can create various types of charts, including birth, synastry, transit, and composite charts.
|
|
169
|
-
|
|
170
|
-
**Tip:**
|
|
171
|
-
The optimized way to open the generated SVG files is with a web browser (e.g., Chrome, Firefox).
|
|
172
|
-
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.
|
|
173
|
-
|
|
174
|
-
### Birth Chart
|
|
175
|
-
|
|
176
|
-
```python
|
|
177
|
-
from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
|
|
178
|
-
|
|
179
|
-
john = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
|
|
180
|
-
birth_chart_svg = KerykeionChartSVG(john)
|
|
181
|
-
birth_chart_svg.makeSVG()
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
```python
|
|
185
|
-
birth_chart_svg.makeSVG()
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
The SVG file will be saved in the home directory.
|
|
189
|
-

|
|
190
|
-
|
|
191
|
-
### External Birth Chart
|
|
192
|
-
|
|
193
|
-
```python
|
|
194
|
-
from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
|
|
195
|
-
birth_chart = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
|
|
196
|
-
birth_chart_svg = KerykeionChartSVG(birth_chart, chart_type="ExternalNatal")
|
|
197
|
-
birth_chart_svg.makeSVG()
|
|
198
|
-
```
|
|
199
|
-

|
|
200
|
-
|
|
201
|
-
### Synastry Chart
|
|
202
|
-
|
|
203
|
-
```python
|
|
204
|
-
from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
|
|
205
|
-
|
|
206
|
-
first = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
|
|
207
|
-
second = AstrologicalSubjectFactory.from_birth_data("Paul McCartney", 1942, 6, 18, 15, 30, "Liverpool", "GB")
|
|
208
|
-
|
|
209
|
-
synastry_chart = KerykeionChartSVG(first, "Synastry", second)
|
|
210
|
-
synastry_chart.makeSVG()
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-

|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
### Transit Chart
|
|
217
|
-
|
|
218
|
-
```python
|
|
219
|
-
from kerykeion import AstrologicalSubjectFactory
|
|
220
|
-
|
|
221
|
-
transit = AstrologicalSubjectFactory.from_birth_data("Transit", 2025, 6, 8, 8, 45, "Atlanta", "US")
|
|
222
|
-
subject = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
|
|
223
|
-
|
|
224
|
-
transit_chart = KerykeionChartSVG(subject, "Transit", transit)
|
|
225
|
-
transit_chart.makeSVG()
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-

|
|
229
|
-
|
|
230
|
-
### Composite Chart
|
|
231
|
-
|
|
232
|
-
```python
|
|
233
|
-
from kerykeion import CompositeSubjectFactory, AstrologicalSubjectFactory, KerykeionChartSVG
|
|
234
|
-
|
|
235
|
-
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")
|
|
236
|
-
|
|
237
|
-
brad = AstrologicalSubjectFactory.from_birth_data("Brad Pitt", 1963, 12, 18, 6, 31, "Shawnee", "US", lng=-96.56, lat=35.20, tz_str="America/Chicago")
|
|
238
|
-
|
|
239
|
-
factory = CompositeSubjectFactory(angelina, brad)
|
|
240
|
-
composite_model = factory.get_midpoint_composite_subject_model()
|
|
241
|
-
|
|
242
|
-
composite_chart = KerykeionChartSVG(composite_model, "Composite")
|
|
243
|
-
composite_chart.makeSVG()
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-

|
|
247
|
-
|
|
248
|
-
## Wheel Only Charts
|
|
249
|
-
|
|
250
|
-
For *all* the charts, you can generate a wheel-only chart by using the method `makeWheelOnlySVG()`:
|
|
251
|
-
|
|
252
|
-
### Birth Chart
|
|
253
|
-
```python
|
|
254
|
-
from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
|
|
255
|
-
|
|
256
|
-
birth_chart = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
|
|
257
|
-
birth_chart_svg = KerykeionChartSVG(birth_chart)
|
|
258
|
-
birth_chart_svg.makeWheelOnlySVG()
|
|
259
|
-
```
|
|
260
|
-

|
|
261
|
-
|
|
262
|
-
### Wheel Only Birth Chart (External)
|
|
263
|
-
|
|
264
|
-
```python
|
|
265
|
-
from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
|
|
266
|
-
birth_chart = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
|
|
267
|
-
birth_chart_svg = KerykeionChartSVG(birth_chart, chart_type="ExternalNatal")
|
|
268
|
-
birth_chart_svg.makeWheelOnlySVG(
|
|
269
|
-
wheel_only=True,
|
|
270
|
-
wheel_only_external=True
|
|
271
|
-
)
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-

|
|
275
|
-
|
|
276
|
-
### Synastry Chart
|
|
277
|
-
```python
|
|
278
|
-
from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
|
|
279
|
-
first = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
|
|
280
|
-
second = AstrologicalSubjectFactory.from_birth_data("Paul McCartney", 1942, 6, 18, 15, 30, "Liverpool", "GB")
|
|
281
|
-
synastry_chart = KerykeionChartSVG(
|
|
282
|
-
first, "Synastry", second
|
|
283
|
-
)
|
|
284
|
-
synastry_chart.makeWheelOnlySVG()
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-

|
|
288
|
-
|
|
289
|
-
### Change the Output Directory
|
|
290
|
-
|
|
291
|
-
To save the SVG file in a custom location, specify `new_output_directory`:
|
|
292
|
-
|
|
293
|
-
```python
|
|
294
|
-
from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
|
|
295
|
-
|
|
296
|
-
first = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
|
|
297
|
-
second = AstrologicalSubjectFactory.from_birth_data("Paul McCartney", 1942, 6, 18, 15, 30, "Liverpool", "GB")
|
|
298
|
-
|
|
299
|
-
synastry_chart = KerykeionChartSVG(
|
|
300
|
-
first, "Synastry", second,
|
|
301
|
-
new_output_directory="."
|
|
302
|
-
)
|
|
303
|
-
synastry_chart.makeSVG()
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
### Change Language
|
|
307
|
-
|
|
308
|
-
You can switch chart language by passing `chart_language` to the `KerykeionChartSVG` class:
|
|
309
|
-
|
|
310
|
-
```python
|
|
311
|
-
from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
|
|
312
|
-
|
|
313
|
-
first = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
|
|
314
|
-
birth_chart_svg = KerykeionChartSVG(
|
|
315
|
-
birth_chart,
|
|
316
|
-
chart_language="IT" # Change to Italian
|
|
317
|
-
)
|
|
318
|
-
birth_chart_svg.makeSVG()
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
More details [here](https://www.kerykeion.net/docs/chart-language).
|
|
322
|
-
|
|
323
|
-
The available languages are:
|
|
324
|
-
- EN (English)
|
|
325
|
-
- FR (French)
|
|
326
|
-
- PT (Portuguese)
|
|
327
|
-
- ES (Spanish)
|
|
328
|
-
- TR (Turkish)
|
|
329
|
-
- RU (Russian)
|
|
330
|
-
- IT (Italian)
|
|
331
|
-
- CN (Chinese)
|
|
332
|
-
- DE (German)
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
### Minified SVG
|
|
336
|
-
To generate a minified SVG, set `minify_svg=True` in the `makeSVG()` method:
|
|
337
|
-
|
|
338
|
-
```python
|
|
339
|
-
from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
|
|
340
|
-
first = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
|
|
341
|
-
birth_chart_svg = KerykeionChartSVG(birth_chart)
|
|
342
|
-
birth_chart_svg.makeSVG(
|
|
343
|
-
minify=True
|
|
344
|
-
)
|
|
345
|
-
```
|
|
346
|
-
|
|
347
|
-
### SVG without CSS Variables
|
|
348
|
-
To generate an SVG without CSS variables, set `remove_css_variables=True` in the `makeSVG()` method:
|
|
349
|
-
|
|
350
|
-
```python
|
|
351
|
-
from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
|
|
352
|
-
|
|
353
|
-
first = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
|
|
354
|
-
birth_chart_svg = KerykeionChartSVG(birth_chart)
|
|
355
|
-
birth_chart_svg.makeSVG(
|
|
356
|
-
remove_css_variables=True
|
|
357
|
-
)
|
|
358
|
-
```
|
|
359
|
-
This will inline all styles and eliminate CSS variables, resulting in an SVG that is more broadly supported.
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
### Grid Only SVG
|
|
363
|
-
|
|
364
|
-
It's possible to generate a grid-only SVG, useful for creating a custom layout. To do this, use the `makeGridOnlySVG()` method:
|
|
365
|
-
|
|
366
|
-
```python
|
|
367
|
-
from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
|
|
368
|
-
birth_chart = AstrologicalSubjectFactory.from_birth_data("John Lennon - Aspect Grid Dark Synastry", 1977, 6, 8, 8, 45, "Atlanta", "US")
|
|
369
|
-
aspect_grid_dark_synastry_chart = KerykeionChartSVG(aspect_grid_dark_synastry_subject, "Synastry", second, theme="dark")
|
|
370
|
-
aspect_grid_dark_synastry_chart.makeAspectGridOnlySVG()
|
|
371
|
-
```
|
|
372
|
-

|
|
373
|
-
|
|
374
|
-
## Report
|
|
375
|
-
|
|
376
|
-
```python
|
|
377
|
-
from kerykeion import Report, AstrologicalSubjectFactory
|
|
378
|
-
|
|
379
|
-
john = AstrologicalSubjectFactory.from_birth_data(
|
|
380
|
-
"John Lennon", 1940, 10, 9, 18, 30,
|
|
381
|
-
lng=-2.9833, # Longitude for Liverpool
|
|
382
|
-
lat=53.4000, # Latitude for Liverpool
|
|
383
|
-
tz_str="Europe/London", # Timezone for Liverpool
|
|
384
|
-
city="Liverpool",
|
|
385
|
-
)
|
|
386
|
-
report = Report(john)
|
|
387
|
-
report.print_report()
|
|
388
|
-
```
|
|
389
|
-
|
|
390
|
-
Report output:
|
|
391
|
-
```plaintext
|
|
392
|
-
+- Kerykeion report for John Lennon -+
|
|
393
|
-
+-----------+-------+---------------+-----------+----------+
|
|
394
|
-
| Date | Time | Location | Longitude | Latitude |
|
|
395
|
-
+-----------+-------+---------------+-----------+----------+
|
|
396
|
-
| 9/10/1940 | 18:30 | Liverpool, GB | -2.9833 | 53.4 |
|
|
397
|
-
+-----------+-------+---------------+-----------+----------+
|
|
398
|
-
+-------------------+------+-------+------+----------------+
|
|
399
|
-
| AstrologicalPoint | Sign | Pos. | Ret. | House |
|
|
400
|
-
+-------------------+------+-------+------+----------------+
|
|
401
|
-
| Sun | Lib | 16.27 | - | Sixth_House |
|
|
402
|
-
| Moon | Aqu | 3.55 | - | Eleventh_House |
|
|
403
|
-
| Mercury | Sco | 8.56 | - | Seventh_House |
|
|
404
|
-
| Venus | Vir | 3.22 | - | Sixth_House |
|
|
405
|
-
| Mars | Lib | 2.66 | - | Sixth_House |
|
|
406
|
-
| Jupiter | Tau | 13.69 | R | First_House |
|
|
407
|
-
| Saturn | Tau | 13.22 | R | First_House |
|
|
408
|
-
| Uranus | Tau | 25.55 | R | First_House |
|
|
409
|
-
| Neptune | Vir | 26.03 | - | Sixth_House |
|
|
410
|
-
| Pluto | Leo | 4.19 | - | Fifth_House |
|
|
411
|
-
| Mean_Node | Lib | 10.58 | R | Sixth_House |
|
|
412
|
-
| Mean_South_Node | Ari | 10.58 | R | Twelfth_House |
|
|
413
|
-
| Mean_Lilith | Ari | 13.37 | - | Twelfth_House |
|
|
414
|
-
| Chiron | Leo | 0.57 | - | Fifth_House |
|
|
415
|
-
+-------------------+------+-------+------+----------------+
|
|
416
|
-
+----------------+------+----------+
|
|
417
|
-
| House | Sign | Position |
|
|
418
|
-
+----------------+------+----------+
|
|
419
|
-
| First_House | Ari | 19.72 |
|
|
420
|
-
| Second_House | Tau | 29.52 |
|
|
421
|
-
| Third_House | Gem | 20.23 |
|
|
422
|
-
| Fourth_House | Can | 7.07 |
|
|
423
|
-
| Fifth_House | Can | 25.31 |
|
|
424
|
-
| Sixth_House | Leo | 22.11 |
|
|
425
|
-
| Seventh_House | Lib | 19.72 |
|
|
426
|
-
| Eighth_House | Sco | 29.52 |
|
|
427
|
-
| Ninth_House | Sag | 20.23 |
|
|
428
|
-
| Tenth_House | Cap | 7.07 |
|
|
429
|
-
| Eleventh_House | Cap | 25.31 |
|
|
430
|
-
| Twelfth_House | Aqu | 22.11 |
|
|
431
|
-
+----------------+------+----------+
|
|
432
|
-
```
|
|
433
|
-
|
|
434
|
-
To export to a file:
|
|
435
|
-
|
|
436
|
-
```bash
|
|
437
|
-
python3 your_script_name.py > file.txt
|
|
438
|
-
```
|
|
439
|
-
|
|
440
|
-
## Example: Retrieving Aspects
|
|
441
|
-
|
|
442
|
-
```python
|
|
443
|
-
from kerykeion import SynastryAspects, AstrologicalSubject
|
|
444
|
-
|
|
445
|
-
first = AstrologicalSubjectFactory.from_birth_data("Jack", 1990, 6, 15, 15, 15, "Roma", "IT")
|
|
446
|
-
second = AstrologicalSubjectFactory.from_birth_data("Jane", 1991, 10, 25, 21, 0, "Roma", "IT")
|
|
447
|
-
|
|
448
|
-
name = SynastryAspects(first, second)
|
|
449
|
-
aspect_list = name.get_relevant_aspects()
|
|
450
|
-
print(aspect_list[0])
|
|
451
|
-
#> {'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}
|
|
452
|
-
|
|
453
|
-
```
|
|
454
|
-
|
|
455
|
-
## Ayanamsa (Sidereal Modes)
|
|
456
|
-
|
|
457
|
-
By default, the zodiac type is **Tropical**. To use **Sidereal**, specify the sidereal mode:
|
|
458
|
-
|
|
459
|
-
```python
|
|
460
|
-
johnny = AstrologicalSubjectFactory.from_birth_data(
|
|
461
|
-
"Johnny Depp", 1963, 6, 9, 0, 0,
|
|
462
|
-
"Owensboro", "US",
|
|
463
|
-
zodiac_type="Sidereal",
|
|
464
|
-
sidereal_mode="LAHIRI"
|
|
465
|
-
)
|
|
466
|
-
```
|
|
467
|
-
|
|
468
|
-
More examples [here](https://www.kerykeion.net/docs//sidereal-modes/).
|
|
469
|
-
|
|
470
|
-
Full list of supported sidereal modes [here](https://www.kerykeion.net/pydocs/kerykeion/kr_types/kr_literals.html#SiderealMode).
|
|
471
|
-
|
|
472
|
-
## House Systems
|
|
473
|
-
|
|
474
|
-
By default, houses are calculated using **Placidus**. Configure a different house system as follows:
|
|
475
|
-
|
|
476
|
-
```python
|
|
477
|
-
johnny = AstrologicalSubjectFactory.from_birth_data(
|
|
478
|
-
"Johnny Depp", 1963, 6, 9, 0, 0,
|
|
479
|
-
"Owensboro", "US",
|
|
480
|
-
houses_system="M"
|
|
481
|
-
)
|
|
482
|
-
```
|
|
483
|
-
|
|
484
|
-
More examples [here](https://www.kerykeion.net/docs//houses-systems/).
|
|
485
|
-
|
|
486
|
-
Full list of supported house systems [here](https://www.kerykeion.net/pydocs/kerykeion/kr_types/kr_literals.html#HousesSystem).
|
|
487
|
-
|
|
488
|
-
So far all the available houses system in the Swiss Ephemeris are supported but the Gauquelin Sectors.
|
|
489
|
-
|
|
490
|
-
## Perspective Type
|
|
491
|
-
|
|
492
|
-
By default, Kerykeion uses the **Apparent Geocentric** perspective (the most standard in astrology). Other perspectives (e.g., **Heliocentric**) can be set this way:
|
|
493
|
-
|
|
494
|
-
```python
|
|
495
|
-
johnny = AstrologicalSubjectFactory.from_birth_data(
|
|
496
|
-
"Johnny Depp", 1963, 6, 9, 0, 0,
|
|
497
|
-
"Owensboro", "US",
|
|
498
|
-
perspective_type="Heliocentric"
|
|
499
|
-
)
|
|
500
|
-
```
|
|
501
|
-
|
|
502
|
-
More examples [here](https://www.kerykeion.net/docs//perspective-type/).
|
|
503
|
-
|
|
504
|
-
Full list of supported perspective types [here](https://www.kerykeion.net/pydocs/kerykeion/kr_types/kr_literals.html#PerspectiveType).
|
|
505
|
-
|
|
506
|
-
## Themes
|
|
507
|
-
|
|
508
|
-
Kerykeion provides several chart themes:
|
|
509
|
-
|
|
510
|
-
- **Classic** (default)
|
|
511
|
-
- **Dark**
|
|
512
|
-
- **Dark High Contrast**
|
|
513
|
-
- **Light**
|
|
514
|
-
|
|
515
|
-
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)
|
|
516
|
-
|
|
517
|
-
Here's an example of how to set the theme:
|
|
518
|
-
|
|
519
|
-
```python
|
|
520
|
-
from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
|
|
521
|
-
|
|
522
|
-
dark_theme_subject = AstrologicalSubjectFactory.from_birth_data("John Lennon - Dark Theme", 1940, 10, 9, 18, 30, "Liverpool", "GB")
|
|
523
|
-
dark_theme_natal_chart = KerykeionChartSVG(dark_high_contrast_theme_subject, theme="dark_high_contrast")
|
|
524
|
-
dark_theme_natal_chart.makeSVG()
|
|
525
|
-
```
|
|
526
|
-
|
|
527
|
-

|
|
528
|
-
|
|
529
|
-
## Alternative Initialization
|
|
530
|
-
|
|
531
|
-
Create an `AstrologicalSubject` from a UTC ISO 8601 string:
|
|
532
|
-
|
|
533
|
-
```python
|
|
534
|
-
subject = AstrologicalSubject.get_from_iso_utc_time(
|
|
535
|
-
"Johnny Depp", "1963-06-09T05:00:00Z", "Owensboro", "US"
|
|
536
|
-
)
|
|
537
|
-
```
|
|
538
|
-
|
|
539
|
-
If you set `online=True`, provide a `geonames_username` to allow city-based geolocation:
|
|
540
|
-
|
|
541
|
-
```python
|
|
542
|
-
from kerykeion.astrological_subject import AstrologicalSubjectFactory
|
|
543
|
-
|
|
544
|
-
subject = AstrologicalSubject.get_from_iso_utc_time(
|
|
545
|
-
"Johnny Depp", "1963-06-09T05:00:00Z", "Owensboro", "US", online=True
|
|
546
|
-
)
|
|
547
|
-
```
|
|
548
|
-
|
|
549
|
-
## Lunar Nodes (Rahu & Ketu)
|
|
550
|
-
|
|
551
|
-
Kerykeion supports both **True** and **Mean** Lunar Nodes:
|
|
552
|
-
|
|
553
|
-
- **True North Lunar Node**: `"true_node"` (name kept without "north" for backward compatibility).
|
|
554
|
-
- **True South Lunar Node**: `"true_south_node"`.
|
|
555
|
-
- **Mean North Lunar Node**: `"mean_node"` (name kept without "north" for backward compatibility).
|
|
556
|
-
- **Mean South Lunar Node**: `"mean_south_node"`.
|
|
557
|
-
|
|
558
|
-
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.
|
|
559
|
-
|
|
560
|
-
Example:
|
|
561
|
-
|
|
562
|
-
```python
|
|
563
|
-
from kerykeion import AstrologicalSubjectFactory, KerykeionChartSVG
|
|
564
|
-
|
|
565
|
-
subject = AstrologicalSubjectFactory.from_birth_data("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
|
|
566
|
-
|
|
567
|
-
chart = KerykeionChartSVG(
|
|
568
|
-
subject,
|
|
569
|
-
active_points=[
|
|
570
|
-
"Sun",
|
|
571
|
-
"Moon",
|
|
572
|
-
"Mercury",
|
|
573
|
-
"Venus",
|
|
574
|
-
"Mars",
|
|
575
|
-
"Jupiter",
|
|
576
|
-
"Saturn",
|
|
577
|
-
"Uranus",
|
|
578
|
-
"Neptune",
|
|
579
|
-
"Pluto",
|
|
580
|
-
"Mean_Node",
|
|
581
|
-
"Mean_South_Node",
|
|
582
|
-
"True_Node", # Activates True North Node
|
|
583
|
-
"True_South_Node", # Activates True South Node
|
|
584
|
-
"Ascendant",
|
|
585
|
-
"Medium_Coeli",
|
|
586
|
-
"Descendant",
|
|
587
|
-
"Imum_Coeli"
|
|
588
|
-
]
|
|
589
|
-
)
|
|
590
|
-
chart.makeSVG()
|
|
591
|
-
```
|
|
592
|
-
|
|
593
|
-
## JSON Support
|
|
594
|
-
|
|
595
|
-
You can serialize the astrological subject (the base data used throughout the library) to JSON:
|
|
596
|
-
|
|
597
|
-
```python
|
|
598
|
-
from kerykeion import AstrologicalSubjectFactory
|
|
599
|
-
|
|
600
|
-
johnny = AstrologicalSubjectFactory.from_birth_data("Johnny Depp", 1963, 6, 9, 0, 0, "Owensboro", "US")
|
|
601
|
-
|
|
602
|
-
print(johnny.json(dump=False, indent=2))
|
|
603
|
-
```
|
|
604
|
-
|
|
605
|
-
## Auto Generated Documentation
|
|
606
|
-
|
|
607
|
-
You can find auto-generated documentation [here](https://www.kerykeion.net/pydocs/kerykeion.html). Most classes and functions include docstrings.
|
|
608
|
-
|
|
609
|
-
## Development
|
|
610
|
-
|
|
611
|
-
Clone the repository or download the ZIP via the GitHub interface.
|
|
612
|
-
|
|
613
|
-
## Integrating Kerykeion into Your Project
|
|
614
|
-
|
|
615
|
-
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.
|
|
616
|
-
|
|
617
|
-
## License
|
|
618
|
-
|
|
619
|
-
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).
|
|
620
|
-
|
|
621
|
-
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.
|
|
622
|
-
|
|
623
|
-
Since the AstrologerAPI is an external third-party service, using it does *not* require your code to be open-source.
|
|
624
|
-
|
|
625
|
-
## Contributing
|
|
626
|
-
|
|
627
|
-
Contributions are welcome! Feel free to submit pull requests or report issues.
|
|
628
|
-
|
|
629
|
-
## Citations
|
|
630
|
-
|
|
631
|
-
If using Kerykeion in published or academic work, please cite as follows:
|
|
632
|
-
|
|
633
|
-
```
|
|
634
|
-
Battaglia, G. (2025). Kerykeion: A Python Library for Astrological Calculations and Chart Generation.
|
|
635
|
-
https://github.com/g-battaglia/kerykeion
|
|
636
|
-
```
|