kerykeion
A Python library for astrological calculations, including natal charts, houses, planetary aspects, and SVG chart generation.
What it is and what it does
Kerykeion is a Python library for computing astrological data and rendering charts. It wraps Swiss Ephemeris calculations (via pyswisseph) to derive planetary positions, house cusps, and aspects, then uses SVG rendering to visualize birth charts, synastry (relationship) charts, transits, composites, and returns. The library is data-driven: it exposes astrological objects (planets, houses, aspects) as structured Pydantic models, making calculations programmable and suitable for integration with APIs and AI applications.
The package supports both online and offline modes—online uses GeoNames to resolve city coordinates, while offline requires explicit longitude, latitude, and timezone. It offers customization of planets, house systems, ayanamsa modes, and chart styling. The description emphasizes a hosted API alternative for commercial or closed-source projects to sidestep AGPL copyleft concerns.
Use it for:
- Generate natal charts as SVG for astrology websites or mobile apps without server setup
- Compute synastry and composite charts to analyze relationship compatibility programmatically
- Retrieve planetary positions and aspects as JSON for integration with LLM or AI analysis workflows
- Build batch reports of transit forecasts or lunar return charts for multiple birth dates
- Embed astrological calculations in a closed-source SaaS via the hosted Astrologer API
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Kerykeion computes planetary and house positions, detects astrological aspects, and generates SVG birth, synastry, transit, and composite charts with customizable planet selections.
Yes, if you are building an open-source or AGPL-compatible astrology application and want precise, programmable chart generation. The library is actively maintained, has low install friction, and integrates cleanly with modern Python stacks. No if your project is proprietary or closed-source—use the hosted API instead. No if you need only simple zodiac sign lookups; this is a full ephemeris and rendering system.
Install
kerykeion on PyPI
pip
pip install kerykeionuv
uv add kerykeionpoetry
poetry add kerykeionInstalling kerykeion
Before you install
Low install friction with a pure-Python wheel distribution. Active maintenance with a recent release and 686 GitHub stars. Eight runtime dependencies are all well-established packages (pydantic, pytz, requests, pyswisseph for ephemeris data).
License in practice
Licensed under AGPL-3.0 (copyleft). Any application that imports and uses kerykeion directly must also be AGPL-3.0 or compatible; proprietary or closed-source projects should use the hosted Astrologer API instead to avoid copyleft obligations.
Quickstart
from kerykeion import AstrologicalSubjectFactory
from kerykeion.chart_data_factory import ChartDataFactory
from kerykeion.charts.chart_drawer import ChartDrawer
subject = AstrologicalSubjectFactory.from_birth_data(
name="Example", year=1990, month=7, day=15,
hour=10, minute=30, lng=12.4964, lat=41.9028,
tz_str="Europe/Rome", online=False
)
chart_data = ChartDataFactory.create_natal_chart_data(subject)
ChartDrawer(chart_data=chart_data).save_svg(output_path=".", filename="natal")
Requires Python 3.10 or higher. pyswisseph may require a C compiler on some systems; pre-built wheels are available for common platforms.
Verify before relying
- Precision claims for astrological calculations—what reference ephemeris or algorithm standard is used
- Performance characteristics for large-scale batch chart generation or API workloads
- Completeness of house system and ayanamsa (sidereal mode) implementations relative to standard astrological practice
Package facts
| License | AGPL-3.0 (copyleft) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 8 — pydantic, pyswisseph, pytz, requests-cache, requests, scour, simple-ascii-tables, typing-extensions |
| Maintenance | actively maintained — 81 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 133,564/month — #11,504 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: kerykeion-5.12.9-py3-none-any.whl
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
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
ephemPyEphem computes high-precision positions of…
permissive · top 5,000 on PyPI
lunar_pythonConverts between Gregorian (solar) and Chinese…
permissive · top 15,000 on PyPI
spiceypySpiceyPy wraps the NAIF C SPICE Toolkit to…
permissive · top 15,000 on PyPI
suntimesCalculates sunrise and sunset times for any…
permissive · top 15,000 on PyPI
jplephemLoads and queries JPL ephemeris files (SPK…
permissive · top 5,000 on PyPI
haversineCalculates great-circle distances between…
permissive · top 5,000 on PyPI
skyfieldSkyfield computes high-precision positions for…
permissive · top 15,000 on PyPI