celestial-astrology¶
A Python library for reproducible Western astrology charts and knowledge queries. It uses celestial-calendar for astronomy and keeps astrological rules, their sources, and their variants in this repository.
Calculate a tropical, geocentric natal chart from a known birth time and location, or query the knowledge catalog without a chart. Start with the examples below; the guides and API reference explain further uses and parameters.
The library provides:
Solar and lunar returns: find every event in an explicit interval, then build its chart at a supplied location.
Moment charts and fixed-instant transit-to-natal aspects, including direct construction from a retained exact hit and bilingual text.
Traditional sign rulers, four statuses and dispositor chains.
Explicit axis aspects for natal and static cross-chart queries.
Static cross-chart aspects between natal or moment charts, retaining both source charts and distinct left/right objects, without applying/separating labels.
Exact transit hits over a UTC interval, retaining repeated retrograde hits, native rates and directions.
ashmand_sign_group(Sign.ARIES)queries the twelve signs’ four groups in Ashmand’s 1822 edition. See the source and lookup example.
Axes (Ascendant, Midheaven, Descendant and Imum Coeli) participate in aspects only when explicitly selected.
Install a release¶
The celestial-calendar dependency publishes wheels for Linux x86_64 and aarch64, macOS arm64 and Windows amd64, and no source distribution. On any other platform this package cannot be installed, and knowledge browsing is not available either. Release-specific minimum operating-system versions are recorded in the release notes.
celestial-astrology is the distribution name; the Python import is astrology.
Do not install the unrelated PyPI project named astrology.
Use Python 3.11–3.14 on one of the platforms listed above.
Install the latest release on PyPI with the commands below. To try newer source changes, install from source.
Linux/macOS (replace python3.14 with your supported Python version):
python3.14 -m venv .venv
.venv/bin/python -m pip install celestial-astrology
Windows PowerShell:
py -3.14 -m venv .venv
.venv\Scripts\python.exe -m pip install celestial-astrology
Runtime dependencies are exactly pinned. This can conflict with applications requiring another version. See the release notes.
Install from source¶
This source checkout requires macOS 15+ on arm64; the other platforms listed above are unchanged.
For the exact source
revision used by the documentation, use the snapshot command on the
documentation home. To install your downloaded
or cloned source checkout instead, run these commands from its root. Use a freshly
downloaded or cloned copy when switching revisions: files left in build/ can
otherwise reappear in the installed package. Installation needs network access for
build dependencies and the pinned runtime packages.
Linux/macOS (replace python3.14 with your supported Python version):
python3.14 -m venv .venv
.venv/bin/python -m pip install .
Windows PowerShell:
py -3.14 -m venv .venv
.venv\Scripts\python.exe -m pip install .
These commands install your source checkout. Development checks use uv sync --locked as
described in the contribution guide.
First chart¶
Save this Python script as first_chart.py.
Run .venv/bin/python first_chart.py on Linux/macOS, or
.venv\Scripts\python.exe first_chart.py in PowerShell.
The input has an explicit UTC offset and synthetic coordinates. No aspects are requested.
from datetime import date, time, timedelta
from astrology import (
BirthRecord,
Body,
ChartConfig,
FixedOffset,
HouseSystem,
Location,
TimePrecision,
natal_chart,
prepare_natal_input,
)
record = BirthRecord(
date(2000, 1, 1),
time(12, 0),
FixedOffset(timedelta(0)),
Location(0, 0),
TimePrecision.MINUTE,
{"example": "synthetic"},
)
config = ChartConfig(HouseSystem.WHOLE_SIGN, (Body.SUN, Body.MOON), ())
chart = natal_chart(prepare_natal_input(record), config)
print(chart.resolved.utc.isoformat())
for placement in chart.placements:
print(f"{placement.identity.value}: {placement.sign.value}")
Output:
2000-01-01T12:00:00+00:00
sun: capricorn
moon: scorpio
Unknown time or missing location is rejected, not replaced with noon or an inferred
place. Undefined requested house geometry raises ChartDomainError without a
fallback. See the chart guide
for admitted domains, and the result guide
for structured results and bilingual text tables.
The output lists the resolved UTC instant and the signs of the Sun and Moon.
To include other bodies or nodes, set objects when constructing ChartConfig.
To calculate aspects, supply orb rules in aspects and select participants with aspect_objects.
Next task |
Guide |
|---|---|
Resolve a local clock or select a repeated time |
|
Select objects, participants and orbs |
|
Compare two charts |
|
Search an interval for exact transits |
|
Find solar/lunar returns and build their charts |
First knowledge lookup¶
Save this separate script as first_knowledge.py and run it with the same
virtual-environment Python. This example retrieves the Sun by its stable ID,
then finds the same concept by its alias “Sol”:
from astrology import load_catalog
catalog = load_catalog()
print(catalog.concept("body.sun").name.text("en"))
print(catalog.lookup("Sol")[0].identifier)
Output:
Sun
body.sun
The knowledge guide explains lookup, citations and editorial status. Browse the complete catalog for definitions and sources.
Supported chart¶
The chart supports Whole Sign, Equal and Placidus houses, the Sun, Moon and eight planets, and explicitly selected lunar-node definitions. House placement uses longitude only, without object latitude. The five major aspects use caller-supplied orbs; applying/separating describes local motion, not a future-event prediction. Results keep the four axes separately from the twelve house cusps. Immutable results retain the original input, resolved time scales, configuration, unrounded astronomy and named models.
Design boundaries¶
Later work¶
Techniques and presentation: orb windows and other planetary returns, relationship charts, tradition-specific rules, additional objects, and chart views.
Advanced and historical research: directions, progressions, uncertain birth times, historical inputs, spatial house placement, and sourced interpretation.
These milestones track directions without assigning release dates.
License¶
MIT covers project code, translations and authored explanations. Historical excerpts retain the reproduction status recorded in their source records.