Skip to main content

celestial-astrology

English | 简体中文

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.

Further features include element/modality distributions and natal lunar phase, traditional sign rulers and four statuses, explicit axis aspects for natal and static cross-chart queries, and cross-chart house overlays and bilingual comparison text. Axes (Ascendant, Midheaven, Descendant and Imum Coeli) participate in aspects only when explicitly selected.

The library also provides:

  • Static cross-chart aspects between two natal charts, retaining both source charts and distinct left/right objects, without applying/separating labels.
  • ashmand_sign_group(Sign.ARIES) queries the twelve signs' four groups in Ashmand's 1822 edition. See the source and lookup example.

Install a release

This library depends on celestial-calendar 0.8.0, which publishes wheels for Linux x86_64 and aarch64, macOS 14+ arm64 and Windows amd64, and no source distribution. On any other platform this package cannot be installed, and knowledge browsing is not available either.

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 remain exactly pinned to celestial-calendar==0.8.0 and tzdata==2026.5. This can conflict with applications requiring another version. See the release notes.

Install from source

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 Birth inputs
Select objects, participants and orbs Configuration
Compare two charts Cross-chart aspects and house overlays

First knowledge lookup

Save this separate script as first_knowledge.py and run it with the same virtual-environment Python. This example finds the Sun by name and alias:

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. Chart persistence is removed in the current source; see the release notes for the difference from the published v0.1.0 API.

Design boundaries

Later work

These milestones track directions without assigning release dates. Each technique needs a named definition, sources, and reference cases before implementation.

License

MIT covers project code, translations and authored explanations. Historical excerpts retain the reproduction status recorded in their source records.

Metadata

Release files for celestial-astrology 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for celestial-astrology 0.3.0
File Size Uploaded Provenance Actions
celestial_astrology-0.3.0.tar.gz 447.7 kB With provenance Details for celestial_astrology-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for celestial-astrology 0.3.0
File Interpreter ABI Platform Actions
celestial_astrology-0.3.0-py3-none-any.whl Python 3 none any Details for celestial_astrology-0.3.0-py3-none-any.whl

Total release size: 555.8 kB

Release files / celestial_astrology-0.3.0.tar.gz

Download URL celestial_astrology-0.3.0.tar.gz
Size 447.7 kB
Tags Source
SHA-256 checksum
How to use checksums
be5aabcb167267345acd9acd8f88cf03ac724e097d7bf7679f9cfe5b86847ddd
BLAKE2b-256 checksum
How to use checksums
1ca8ada5253850f60ccafb1c3297c02e31ead032517f6284110d56e4ee7090a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / celestial_astrology-0.3.0-py3-none-any.whl

Download URL celestial_astrology-0.3.0-py3-none-any.whl
Size 108.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
201a5b2bc0bcc67aa036f0aa6e34fe6c97b107cbd09b5545ff3f35eb8bd9b817
BLAKE2b-256 checksum
How to use checksums
be6c1391eefcf9a56e50acf68db25645c5c1b639f4ba25ca5df205e537edac4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Security for celestial-astrology 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for celestial_astrology-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page