celestial-astrology 0.1.0__tar.gz
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.
- celestial_astrology-0.1.0/.gitattributes +1 -0
- celestial_astrology-0.1.0/.github/workflows/checks.yml +55 -0
- celestial_astrology-0.1.0/.github/workflows/release.yml +176 -0
- celestial_astrology-0.1.0/AGENTS.md +87 -0
- celestial_astrology-0.1.0/LICENSE +21 -0
- celestial_astrology-0.1.0/MANIFEST.in +7 -0
- celestial_astrology-0.1.0/PKG-INFO +220 -0
- celestial_astrology-0.1.0/README.md +205 -0
- celestial_astrology-0.1.0/README.zh-CN.md +179 -0
- celestial_astrology-0.1.0/docs/_templates/site_index.html +30 -0
- celestial_astrology-0.1.0/docs/conf.py +82 -0
- celestial_astrology-0.1.0/docs/en/architecture.md +118 -0
- celestial_astrology-0.1.0/docs/en/aspects.md +207 -0
- celestial_astrology-0.1.0/docs/en/birth.md +159 -0
- celestial_astrology-0.1.0/docs/en/catalog.md +14 -0
- celestial_astrology-0.1.0/docs/en/chart.md +261 -0
- celestial_astrology-0.1.0/docs/en/configuration.md +105 -0
- celestial_astrology-0.1.0/docs/en/contributing.md +284 -0
- celestial_astrology-0.1.0/docs/en/index.md +27 -0
- celestial_astrology-0.1.0/docs/en/knowledge.md +265 -0
- celestial_astrology-0.1.0/docs/en/records.md +197 -0
- celestial_astrology-0.1.0/docs/en/reference.md +90 -0
- celestial_astrology-0.1.0/docs/en/releases.md +72 -0
- celestial_astrology-0.1.0/docs/en/releasing.md +102 -0
- celestial_astrology-0.1.0/docs/index.md +10 -0
- celestial_astrology-0.1.0/docs/zh-CN/architecture.md +92 -0
- celestial_astrology-0.1.0/docs/zh-CN/aspects.md +179 -0
- celestial_astrology-0.1.0/docs/zh-CN/birth.md +137 -0
- celestial_astrology-0.1.0/docs/zh-CN/catalog.md +11 -0
- celestial_astrology-0.1.0/docs/zh-CN/chart.md +237 -0
- celestial_astrology-0.1.0/docs/zh-CN/configuration.md +88 -0
- celestial_astrology-0.1.0/docs/zh-CN/contributing.md +209 -0
- celestial_astrology-0.1.0/docs/zh-CN/index.md +25 -0
- celestial_astrology-0.1.0/docs/zh-CN/knowledge.md +211 -0
- celestial_astrology-0.1.0/docs/zh-CN/records.md +161 -0
- celestial_astrology-0.1.0/docs/zh-CN/reference.md +96 -0
- celestial_astrology-0.1.0/docs/zh-CN/releases.md +56 -0
- celestial_astrology-0.1.0/docs/zh-CN/releasing.md +78 -0
- celestial_astrology-0.1.0/pyproject.toml +73 -0
- celestial_astrology-0.1.0/setup.cfg +4 -0
- celestial_astrology-0.1.0/src/astrology/__init__.py +112 -0
- celestial_astrology-0.1.0/src/astrology/_distribution.py +17 -0
- celestial_astrology-0.1.0/src/astrology/_validation.py +16 -0
- celestial_astrology-0.1.0/src/astrology/aspects.py +289 -0
- celestial_astrology-0.1.0/src/astrology/birth.py +369 -0
- celestial_astrology-0.1.0/src/astrology/celestial.py +178 -0
- celestial_astrology-0.1.0/src/astrology/chart.py +391 -0
- celestial_astrology-0.1.0/src/astrology/config.py +253 -0
- celestial_astrology-0.1.0/src/astrology/houses.py +73 -0
- celestial_astrology-0.1.0/src/astrology/knowledge/__init__.py +32 -0
- celestial_astrology-0.1.0/src/astrology/knowledge/catalog.json +78 -0
- celestial_astrology-0.1.0/src/astrology/knowledge/catalog.py +369 -0
- celestial_astrology-0.1.0/src/astrology/knowledge/records.py +337 -0
- celestial_astrology-0.1.0/src/astrology/py.typed +0 -0
- celestial_astrology-0.1.0/src/astrology/serialization.py +520 -0
- celestial_astrology-0.1.0/src/astrology/text.py +263 -0
- celestial_astrology-0.1.0/src/astrology/zodiac.py +92 -0
- celestial_astrology-0.1.0/src/celestial_astrology.egg-info/PKG-INFO +220 -0
- celestial_astrology-0.1.0/src/celestial_astrology.egg-info/SOURCES.txt +96 -0
- celestial_astrology-0.1.0/src/celestial_astrology.egg-info/dependency_links.txt +1 -0
- celestial_astrology-0.1.0/src/celestial_astrology.egg-info/requires.txt +2 -0
- celestial_astrology-0.1.0/src/celestial_astrology.egg-info/top_level.txt +1 -0
- celestial_astrology-0.1.0/tests/conftest.py +43 -0
- celestial_astrology-0.1.0/tests/reference/chart_record_v1.json +401 -0
- celestial_astrology-0.1.0/tests/reference/complete_chart_reference.json +2168 -0
- celestial_astrology-0.1.0/tests/reference/constructed_chart.en.txt +47 -0
- celestial_astrology-0.1.0/tests/reference/constructed_chart.zh-CN.txt +47 -0
- celestial_astrology-0.1.0/tests/reference/natal_reference.json +174 -0
- celestial_astrology-0.1.0/tests/test_api_html.py +99 -0
- celestial_astrology-0.1.0/tests/test_aspects.py +603 -0
- celestial_astrology-0.1.0/tests/test_birth.py +595 -0
- celestial_astrology-0.1.0/tests/test_build_inputs.py +142 -0
- celestial_astrology-0.1.0/tests/test_chart.py +680 -0
- celestial_astrology-0.1.0/tests/test_checks.py +631 -0
- celestial_astrology-0.1.0/tests/test_complete_reference.py +183 -0
- celestial_astrology-0.1.0/tests/test_config.py +262 -0
- celestial_astrology-0.1.0/tests/test_distribution_identity.py +78 -0
- celestial_astrology-0.1.0/tests/test_fetch_reference.py +120 -0
- celestial_astrology-0.1.0/tests/test_houses.py +138 -0
- celestial_astrology-0.1.0/tests/test_installed_check.py +504 -0
- celestial_astrology-0.1.0/tests/test_knowledge.py +635 -0
- celestial_astrology-0.1.0/tests/test_knowledge_docs.py +308 -0
- celestial_astrology-0.1.0/tests/test_reader_checks.py +241 -0
- celestial_astrology-0.1.0/tests/test_reference.py +740 -0
- celestial_astrology-0.1.0/tests/test_release.py +508 -0
- celestial_astrology-0.1.0/tests/test_release_documents.py +103 -0
- celestial_astrology-0.1.0/tests/test_release_workflow.py +262 -0
- celestial_astrology-0.1.0/tests/test_result_validation.py +207 -0
- celestial_astrology-0.1.0/tests/test_serialization.py +408 -0
- celestial_astrology-0.1.0/tests/test_text.py +457 -0
- celestial_astrology-0.1.0/tests/test_zodiac.py +125 -0
- celestial_astrology-0.1.0/tools/catalog_docs.py +203 -0
- celestial_astrology-0.1.0/tools/check.py +799 -0
- celestial_astrology-0.1.0/tools/docs_search.py +136 -0
- celestial_astrology-0.1.0/tools/fetch_reference.py +272 -0
- celestial_astrology-0.1.0/tools/installed_check.py +366 -0
- celestial_astrology-0.1.0/tools/release.py +387 -0
- celestial_astrology-0.1.0/uv.lock +1135 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* text=auto eol=lf
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
name: Checks
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
quality:
|
|
12
|
+
name: quality (${{ matrix.os }}, ${{ matrix.python }})
|
|
13
|
+
runs-on: ${{ matrix.os }}
|
|
14
|
+
timeout-minutes: 15
|
|
15
|
+
strategy:
|
|
16
|
+
fail-fast: false
|
|
17
|
+
matrix:
|
|
18
|
+
include:
|
|
19
|
+
- os: ubuntu-latest
|
|
20
|
+
python: "3.11"
|
|
21
|
+
uv-artifact: uv-x86_64-unknown-linux-gnu.tar.gz
|
|
22
|
+
uv-checksum: 68a509da24b06b4223a1c0175fb5eb5bc79342b76cbeff0cfe51ac3f5b17b6b2
|
|
23
|
+
- os: ubuntu-latest
|
|
24
|
+
python: "3.14"
|
|
25
|
+
uv-artifact: uv-x86_64-unknown-linux-gnu.tar.gz
|
|
26
|
+
uv-checksum: 68a509da24b06b4223a1c0175fb5eb5bc79342b76cbeff0cfe51ac3f5b17b6b2
|
|
27
|
+
- os: macos-latest
|
|
28
|
+
python: "3.14"
|
|
29
|
+
uv-artifact: uv-aarch64-apple-darwin.tar.gz
|
|
30
|
+
uv-checksum: 5bb0e5fe008a773c3dbcb97ff79cd89e1241464fe9d2f986d52ad8f1b037bd62
|
|
31
|
+
- os: windows-latest
|
|
32
|
+
python: "3.14"
|
|
33
|
+
uv-artifact: uv-x86_64-pc-windows-msvc.zip
|
|
34
|
+
uv-checksum: 4c4d49d8738847d9b71ba319e49a5688c93eac0fe6204b1df24e98528dddf39a
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
37
|
+
with:
|
|
38
|
+
persist-credentials: false
|
|
39
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
40
|
+
with:
|
|
41
|
+
python-version: ${{ matrix.python }}
|
|
42
|
+
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
|
|
43
|
+
name: Verify and install ${{ matrix.uv-artifact }}
|
|
44
|
+
env:
|
|
45
|
+
# setup-uv skips archive verification on a tool-cache hit.
|
|
46
|
+
# setup-uv 命中工具缓存时会跳过归档校验。
|
|
47
|
+
RUNNER_TOOL_CACHE: ${{ runner.temp }}/astrology-uv-${{ github.run_id }}-${{ github.run_attempt }}
|
|
48
|
+
with:
|
|
49
|
+
version: "0.12.5"
|
|
50
|
+
# Digests cover the named archives from astral-sh/uv release 0.12.5.
|
|
51
|
+
# 摘要对应 astral-sh/uv 0.12.5 发布中上面具名的归档。
|
|
52
|
+
checksum: ${{ matrix.uv-checksum }}
|
|
53
|
+
enable-cache: false
|
|
54
|
+
- run: uv sync --locked --python ${{ matrix.python }}
|
|
55
|
+
- run: uv run --locked python tools/check.py
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [main]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
version:
|
|
9
|
+
description: Release version already committed on main
|
|
10
|
+
required: true
|
|
11
|
+
type: string
|
|
12
|
+
sha:
|
|
13
|
+
description: Full lowercase SHA of current main
|
|
14
|
+
required: true
|
|
15
|
+
type: string
|
|
16
|
+
|
|
17
|
+
permissions: {}
|
|
18
|
+
|
|
19
|
+
concurrency:
|
|
20
|
+
group: astrology-release-${{ github.ref }}
|
|
21
|
+
cancel-in-progress: false
|
|
22
|
+
|
|
23
|
+
env:
|
|
24
|
+
RELEASE_VERSION: ${{ inputs.version }}
|
|
25
|
+
RELEASE_SHA: ${{ inputs.sha || github.sha }}
|
|
26
|
+
|
|
27
|
+
jobs:
|
|
28
|
+
build:
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
timeout-minutes: 15
|
|
31
|
+
permissions:
|
|
32
|
+
contents: read
|
|
33
|
+
outputs:
|
|
34
|
+
version: ${{ steps.release.outputs.version }}
|
|
35
|
+
source_sha: ${{ steps.release.outputs.source_sha }}
|
|
36
|
+
sdist_name: ${{ steps.release.outputs.sdist_name }}
|
|
37
|
+
wheel_name: ${{ steps.release.outputs.wheel_name }}
|
|
38
|
+
sdist_sha256: ${{ steps.release.outputs.sdist_sha256 }}
|
|
39
|
+
wheel_sha256: ${{ steps.release.outputs.wheel_sha256 }}
|
|
40
|
+
artifact_id: ${{ steps.upload.outputs.artifact-id }}
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
43
|
+
with:
|
|
44
|
+
ref: ${{ github.sha }}
|
|
45
|
+
persist-credentials: false
|
|
46
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
47
|
+
with:
|
|
48
|
+
python-version: "3.14"
|
|
49
|
+
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
|
|
50
|
+
env:
|
|
51
|
+
RUNNER_TOOL_CACHE: ${{ runner.temp }}/astrology-release-build-${{ github.run_id }}-${{ github.run_attempt }}
|
|
52
|
+
with:
|
|
53
|
+
version: "0.12.5"
|
|
54
|
+
checksum: "68a509da24b06b4223a1c0175fb5eb5bc79342b76cbeff0cfe51ac3f5b17b6b2"
|
|
55
|
+
enable-cache: false
|
|
56
|
+
- run: uv sync --locked --python 3.14
|
|
57
|
+
- run: uv run --locked python tools/release.py validate
|
|
58
|
+
- run: uv run --locked python tools/check.py --artifacts-dir dist/packages
|
|
59
|
+
env:
|
|
60
|
+
SCRATCH: ${{ runner.temp }}
|
|
61
|
+
- id: release
|
|
62
|
+
run: uv run --locked python tools/release.py prepare
|
|
63
|
+
- id: upload
|
|
64
|
+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
65
|
+
with:
|
|
66
|
+
name: celestial-astrology-${{ steps.release.outputs.version }}-${{ github.run_id }}
|
|
67
|
+
path: dist/
|
|
68
|
+
if-no-files-found: error
|
|
69
|
+
overwrite: false
|
|
70
|
+
retention-days: 14
|
|
71
|
+
|
|
72
|
+
consume:
|
|
73
|
+
needs: build
|
|
74
|
+
runs-on: ${{ matrix.os }}
|
|
75
|
+
timeout-minutes: 15
|
|
76
|
+
permissions:
|
|
77
|
+
contents: read
|
|
78
|
+
strategy:
|
|
79
|
+
fail-fast: false
|
|
80
|
+
matrix:
|
|
81
|
+
include:
|
|
82
|
+
- os: ubuntu-latest
|
|
83
|
+
python: "3.11"
|
|
84
|
+
uv-checksum: "68a509da24b06b4223a1c0175fb5eb5bc79342b76cbeff0cfe51ac3f5b17b6b2"
|
|
85
|
+
- os: ubuntu-latest
|
|
86
|
+
python: "3.12"
|
|
87
|
+
uv-checksum: "68a509da24b06b4223a1c0175fb5eb5bc79342b76cbeff0cfe51ac3f5b17b6b2"
|
|
88
|
+
- os: ubuntu-latest
|
|
89
|
+
python: "3.13"
|
|
90
|
+
uv-checksum: "68a509da24b06b4223a1c0175fb5eb5bc79342b76cbeff0cfe51ac3f5b17b6b2"
|
|
91
|
+
- os: ubuntu-latest
|
|
92
|
+
python: "3.14"
|
|
93
|
+
uv-checksum: "68a509da24b06b4223a1c0175fb5eb5bc79342b76cbeff0cfe51ac3f5b17b6b2"
|
|
94
|
+
- os: ubuntu-24.04-arm
|
|
95
|
+
python: "3.14"
|
|
96
|
+
uv-checksum: "9bf43b4d1a07665bf64d4c4e710930b382321a785e0eb10aac07f46471f86a31"
|
|
97
|
+
- os: macos-latest
|
|
98
|
+
python: "3.14"
|
|
99
|
+
uv-checksum: "5bb0e5fe008a773c3dbcb97ff79cd89e1241464fe9d2f986d52ad8f1b037bd62"
|
|
100
|
+
- os: windows-latest
|
|
101
|
+
python: "3.14"
|
|
102
|
+
uv-checksum: "4c4d49d8738847d9b71ba319e49a5688c93eac0fe6204b1df24e98528dddf39a"
|
|
103
|
+
env:
|
|
104
|
+
RELEASE_VERSION: ${{ needs.build.outputs.version }}
|
|
105
|
+
RELEASE_SHA: ${{ needs.build.outputs.source_sha }}
|
|
106
|
+
SDIST_SHA256: ${{ needs.build.outputs.sdist_sha256 }}
|
|
107
|
+
WHEEL_SHA256: ${{ needs.build.outputs.wheel_sha256 }}
|
|
108
|
+
PYTHON_VERSION: ${{ matrix.python }}
|
|
109
|
+
steps:
|
|
110
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
111
|
+
with:
|
|
112
|
+
ref: ${{ needs.build.outputs.source_sha }}
|
|
113
|
+
persist-credentials: false
|
|
114
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
115
|
+
with:
|
|
116
|
+
python-version: ${{ matrix.python }}
|
|
117
|
+
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
|
|
118
|
+
env:
|
|
119
|
+
RUNNER_TOOL_CACHE: ${{ runner.temp }}/astrology-release-consume-${{ github.run_id }}-${{ github.run_attempt }}
|
|
120
|
+
with:
|
|
121
|
+
version: "0.12.5"
|
|
122
|
+
checksum: ${{ matrix.uv-checksum }}
|
|
123
|
+
enable-cache: false
|
|
124
|
+
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
125
|
+
with:
|
|
126
|
+
artifact-ids: ${{ needs.build.outputs.artifact_id }}
|
|
127
|
+
path: dist
|
|
128
|
+
digest-mismatch: error
|
|
129
|
+
- run: uv sync --locked --python "$PYTHON_VERSION"
|
|
130
|
+
shell: bash
|
|
131
|
+
- run: uv run --locked python tools/release.py consume
|
|
132
|
+
env:
|
|
133
|
+
SCRATCH: ${{ runner.temp }}
|
|
134
|
+
|
|
135
|
+
publish-pypi:
|
|
136
|
+
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
|
|
137
|
+
needs: [build, consume]
|
|
138
|
+
runs-on: ubuntu-latest
|
|
139
|
+
timeout-minutes: 10
|
|
140
|
+
environment: pypi
|
|
141
|
+
permissions:
|
|
142
|
+
id-token: write
|
|
143
|
+
steps:
|
|
144
|
+
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
145
|
+
with:
|
|
146
|
+
artifact-ids: ${{ needs.build.outputs.artifact_id }}
|
|
147
|
+
path: dist
|
|
148
|
+
digest-mismatch: error
|
|
149
|
+
- name: Verify exact publication files
|
|
150
|
+
shell: bash
|
|
151
|
+
env:
|
|
152
|
+
DIST_DIR: dist
|
|
153
|
+
RELEASE_VERSION: ${{ needs.build.outputs.version }}
|
|
154
|
+
SDIST_NAME: ${{ needs.build.outputs.sdist_name }}
|
|
155
|
+
WHEEL_NAME: ${{ needs.build.outputs.wheel_name }}
|
|
156
|
+
SDIST_SHA256: ${{ needs.build.outputs.sdist_sha256 }}
|
|
157
|
+
WHEEL_SHA256: ${{ needs.build.outputs.wheel_sha256 }}
|
|
158
|
+
run: |
|
|
159
|
+
set -euo pipefail
|
|
160
|
+
[[ "$RELEASE_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit 1
|
|
161
|
+
[[ "$SDIST_NAME" == "celestial_astrology-${RELEASE_VERSION}.tar.gz" ]] || exit 1
|
|
162
|
+
[[ "$WHEEL_NAME" == "celestial_astrology-${RELEASE_VERSION}-py3-none-any.whl" ]] || exit 1
|
|
163
|
+
[[ "$SDIST_SHA256" =~ ^[0-9a-f]{64}$ && "$WHEEL_SHA256" =~ ^[0-9a-f]{64}$ ]] || exit 1
|
|
164
|
+
[[ -d "$DIST_DIR" && ! -L "$DIST_DIR" ]] || exit 1
|
|
165
|
+
[[ -d "$DIST_DIR/packages" && ! -L "$DIST_DIR/packages" ]] || exit 1
|
|
166
|
+
[[ $(find "$DIST_DIR/packages" -mindepth 1 -maxdepth 1 | wc -l) -eq 2 ]] || exit 1
|
|
167
|
+
[[ -f "$DIST_DIR/packages/$SDIST_NAME" && ! -L "$DIST_DIR/packages/$SDIST_NAME" ]] || exit 1
|
|
168
|
+
[[ -f "$DIST_DIR/packages/$WHEEL_NAME" && ! -L "$DIST_DIR/packages/$WHEEL_NAME" ]] || exit 1
|
|
169
|
+
printf '%s %s\n' "$SDIST_SHA256" "$DIST_DIR/packages/$SDIST_NAME" \
|
|
170
|
+
"$WHEEL_SHA256" "$DIST_DIR/packages/$WHEEL_NAME" | sha256sum -c -
|
|
171
|
+
- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
|
|
172
|
+
with:
|
|
173
|
+
repository-url: https://upload.pypi.org/legacy/
|
|
174
|
+
packages-dir: dist/packages
|
|
175
|
+
attestations: true
|
|
176
|
+
skip-existing: false
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Agent instructions
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
|
|
5
|
+
This is a Python Western astrology library in its initialization stage. Read
|
|
6
|
+
`README.md`, `docs/en/architecture.md`, `docs/en/knowledge.md`, and the relevant
|
|
7
|
+
issue before implementing a feature. GitHub issues hold the implementation scope
|
|
8
|
+
and acceptance criteria.
|
|
9
|
+
|
|
10
|
+
Use celestial-calendar for time scales, ephemerides, and house geometry. This
|
|
11
|
+
repository owns birth-input interpretation, astrological classifications, rule
|
|
12
|
+
variants, chart composition, and serialization.
|
|
13
|
+
|
|
14
|
+
## Domain contracts
|
|
15
|
+
|
|
16
|
+
- Preserve original birth records separately from resolved calculation instants.
|
|
17
|
+
Missing time and location remain explicit; do not manufacture noon or a location.
|
|
18
|
+
- Distinguish physical objects, mathematical points, and constructed chart points.
|
|
19
|
+
Name node and apogee definitions rather than using an ambiguous accuracy switch.
|
|
20
|
+
- Keep astronomical values separate from signs, house placement, and aspects.
|
|
21
|
+
- Record resolved models, versions, and configuration. A failed requested house
|
|
22
|
+
system must not silently become another system.
|
|
23
|
+
- Cite the sources and applicability of astrological rules. Represent conflicting
|
|
24
|
+
traditions as named variants; confirm unresolved definitions before encoding them.
|
|
25
|
+
- Begin with a concrete celestial adapter. Add shared abstractions only when
|
|
26
|
+
actual implementations or callers need them.
|
|
27
|
+
|
|
28
|
+
## Python
|
|
29
|
+
|
|
30
|
+
Use complete type annotations, snake_case modules and functions, PascalCase types,
|
|
31
|
+
and two-space indentation. Inputs, configuration, rules, and results are immutable
|
|
32
|
+
by default; frozen dataclasses must also isolate mutable members and caller-owned
|
|
33
|
+
data. Prefer ordinary pure functions and declarative tables for data-shaped rules.
|
|
34
|
+
Keep I/O, native initialization, caches, and other effects explicit at their
|
|
35
|
+
owning boundary. Avoid global mutable configuration and silent substitutions.
|
|
36
|
+
|
|
37
|
+
Definitions belong to their domain; entry points compose them. Add shared
|
|
38
|
+
abstractions only for concrete callers. Names and types carry meaning; comments
|
|
39
|
+
explain reasons or constraints. Public input checks must work under `python -O`.
|
|
40
|
+
|
|
41
|
+
Python 3.11–3.14 is supported. Use `uv sync --locked`, then
|
|
42
|
+
`uv run --locked python tools/check.py` for the same checks as CI. Configuration
|
|
43
|
+
and pinned tool versions live in `pyproject.toml` and `uv.lock`. Change both when
|
|
44
|
+
updating dependencies and verify the minimum and maximum Python versions.
|
|
45
|
+
The development package provides a tropical natal chart API and
|
|
46
|
+
chart-independent knowledge queries. Importing it initializes no native
|
|
47
|
+
astronomy.
|
|
48
|
+
|
|
49
|
+
## Knowledge and documentation
|
|
50
|
+
|
|
51
|
+
Use English for PR and issue titles/bodies, comments, and review replies. English
|
|
52
|
+
is the primary documentation language; maintain matching Chinese pages.
|
|
53
|
+
|
|
54
|
+
The repository is also a knowledge base. Concepts, source records, rule variants,
|
|
55
|
+
and statements need stable, language-independent identities. Knowledge queries
|
|
56
|
+
must work without a chart or native astronomy initialization. Keep source status,
|
|
57
|
+
prerequisite status, default-output eligibility, and chart matching distinct.
|
|
58
|
+
|
|
59
|
+
Keep executable rules in their owning domain; reference them from knowledge and
|
|
60
|
+
generate reference tables from that source. Original quotations, translations,
|
|
61
|
+
and project-authored explanations remain distinguishable. Preserve uncertainty
|
|
62
|
+
and incomplete prerequisites instead of turning them into applicable conclusions.
|
|
63
|
+
|
|
64
|
+
Provide Chinese and English README, guides, and public reference documentation.
|
|
65
|
+
Update matching pages together; public docstring summaries and contracts are
|
|
66
|
+
bilingual. Identifiers, signatures, units, defaults, and machine-readable rule
|
|
67
|
+
definitions have one source. Check translation coverage and review semantic
|
|
68
|
+
equivalence; original quotations are not rewritten to match prose style.
|
|
69
|
+
|
|
70
|
+
This file is the single agent-instruction source; reader documentation follows the
|
|
71
|
+
bilingual paths above. Create source modules only when they contain functionality.
|
|
72
|
+
|
|
73
|
+
## Verification and delivery
|
|
74
|
+
|
|
75
|
+
Test domain boundaries and independently sourced reference cases with explicit
|
|
76
|
+
configuration and tolerances. A serialization round trip checks preservation;
|
|
77
|
+
recomputation and external references check different properties.
|
|
78
|
+
|
|
79
|
+
Run the complete check command before submitting. Demonstrate that new checks
|
|
80
|
+
reject representative defects. Review source fidelity, aliasing, unnecessary
|
|
81
|
+
abstractions, translation meaning, and gaps in the tested domain separately from
|
|
82
|
+
automated results. Record commands actually executed and unresolved limits in
|
|
83
|
+
the PR. Contribution guides in `docs/en/` and `docs/zh-CN/` explain these checks.
|
|
84
|
+
|
|
85
|
+
Use synthetic or appropriately anonymized examples. Public files and discussions
|
|
86
|
+
must contain only project-relevant information. Commit through the maintainer's
|
|
87
|
+
approved signing path. Merges and releases require explicit authorization.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 0xf3cd
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
include .gitattributes AGENTS.md README.zh-CN.md uv.lock
|
|
2
|
+
include .github/workflows/checks.yml .github/workflows/release.yml
|
|
3
|
+
recursive-include docs *.md *.py *.html
|
|
4
|
+
recursive-include tests *.py
|
|
5
|
+
recursive-include tests/reference *.json *.txt
|
|
6
|
+
recursive-include tools *.py
|
|
7
|
+
prune .review
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: celestial-astrology
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Reproducible Western astrology charts and sourced knowledge
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Documentation, https://0xf3cd.github.io/astrology/
|
|
7
|
+
Project-URL: Repository, https://github.com/0xf3cd/astrology
|
|
8
|
+
Project-URL: Issues, https://github.com/0xf3cd/astrology/issues
|
|
9
|
+
Requires-Python: <3.15,>=3.11
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: celestial-calendar==0.8.0
|
|
13
|
+
Requires-Dist: tzdata==2026.5
|
|
14
|
+
Dynamic: license-file
|
|
15
|
+
|
|
16
|
+
# celestial-astrology
|
|
17
|
+
|
|
18
|
+
[English](https://0xf3cd.github.io/astrology/README.html) | [简体中文](https://0xf3cd.github.io/astrology/README.zh-CN.html)
|
|
19
|
+
|
|
20
|
+
A Python library for reproducible Western astrology charts and knowledge queries. It uses
|
|
21
|
+
[celestial-calendar](https://github.com/0xf3cd/celestial-calendar) for astronomy and
|
|
22
|
+
keeps astrological rules, their sources, and their variants in this repository.
|
|
23
|
+
|
|
24
|
+
The package provides immutable [birth records and modern time
|
|
25
|
+
resolution](https://0xf3cd.github.io/astrology/docs/en/birth.html), [requested chart configuration](https://0xf3cd.github.io/astrology/docs/en/configuration.html),
|
|
26
|
+
[tropical natal chart calculation](https://0xf3cd.github.io/astrology/docs/en/chart.html), [chart records and text output](https://0xf3cd.github.io/astrology/docs/en/records.html), an independent
|
|
27
|
+
[knowledge catalog](https://0xf3cd.github.io/astrology/docs/en/knowledge.html), quality checks, and bilingual
|
|
28
|
+
[API documentation](https://0xf3cd.github.io/astrology/docs/en/reference.html). The astronomy library is imported only
|
|
29
|
+
when calculation or replay is requested, so importing the package or querying knowledge never
|
|
30
|
+
initializes it.
|
|
31
|
+
See [Contributing](https://0xf3cd.github.io/astrology/docs/en/contributing.html) to run the checks.
|
|
32
|
+
|
|
33
|
+
Installation follows the astronomy dependency: celestial-calendar 0.8.0 publishes
|
|
34
|
+
wheels for Linux x86_64 and aarch64, macOS 14+ arm64 and Windows amd64, and no source
|
|
35
|
+
distribution. On any other platform this package cannot be installed, and
|
|
36
|
+
knowledge browsing is not available either.
|
|
37
|
+
|
|
38
|
+
## Install a release
|
|
39
|
+
|
|
40
|
+
`celestial-astrology` is the distribution name; the Python import is `astrology`.
|
|
41
|
+
Do not install the unrelated PyPI project named `astrology`.
|
|
42
|
+
|
|
43
|
+
Use **Python 3.11–3.14** on one of the platforms listed above.
|
|
44
|
+
|
|
45
|
+
Linux/macOS (replace `python3.14` with your supported Python version):
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
python3.14 -m venv .venv
|
|
49
|
+
.venv/bin/python -m pip install "celestial-astrology==0.1.0"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Windows PowerShell:
|
|
53
|
+
|
|
54
|
+
```powershell
|
|
55
|
+
py -3.14 -m venv .venv
|
|
56
|
+
.venv\Scripts\python.exe -m pip install "celestial-astrology==0.1.0"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Runtime dependencies remain exactly pinned to `celestial-calendar==0.8.0` and
|
|
60
|
+
`tzdata==2026.5`. This can conflict with applications requiring another version.
|
|
61
|
+
See the [release notes](https://0xf3cd.github.io/astrology/docs/en/releases.html).
|
|
62
|
+
|
|
63
|
+
## Install from source
|
|
64
|
+
|
|
65
|
+
For the exact source
|
|
66
|
+
revision used by the documentation, use the snapshot command on the
|
|
67
|
+
[documentation home](https://0xf3cd.github.io/astrology/). To install your downloaded
|
|
68
|
+
or cloned source checkout instead, run these commands from its root. Installation
|
|
69
|
+
needs network access for build dependencies and the pinned runtime packages.
|
|
70
|
+
|
|
71
|
+
Linux/macOS (replace `python3.14` with your supported Python version):
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
python3.14 -m venv .venv
|
|
75
|
+
.venv/bin/python -m pip install .
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Windows PowerShell:
|
|
79
|
+
|
|
80
|
+
```powershell
|
|
81
|
+
py -3.14 -m venv .venv
|
|
82
|
+
.venv\Scripts\python.exe -m pip install .
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
These commands install your source checkout. Development checks use `uv sync --locked` as
|
|
86
|
+
described in the contribution guide.
|
|
87
|
+
|
|
88
|
+
## First chart
|
|
89
|
+
|
|
90
|
+
Save this Python script as `first_chart.py`; it is not an interactive transcript.
|
|
91
|
+
Run `.venv/bin/python first_chart.py` on Linux/macOS, or
|
|
92
|
+
`.venv\Scripts\python.exe first_chart.py` in PowerShell.
|
|
93
|
+
The input has an explicit UTC offset and synthetic coordinates. No aspects are requested.
|
|
94
|
+
|
|
95
|
+
```python
|
|
96
|
+
from datetime import date, time, timedelta
|
|
97
|
+
from astrology import (
|
|
98
|
+
BirthRecord,
|
|
99
|
+
Body,
|
|
100
|
+
ChartConfig,
|
|
101
|
+
FixedOffset,
|
|
102
|
+
HouseSystem,
|
|
103
|
+
Location,
|
|
104
|
+
TimePrecision,
|
|
105
|
+
natal_chart,
|
|
106
|
+
prepare_natal_input,
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
record = BirthRecord(
|
|
110
|
+
date(2000, 1, 1),
|
|
111
|
+
time(12, 0),
|
|
112
|
+
FixedOffset(timedelta(0)),
|
|
113
|
+
Location(0, 0),
|
|
114
|
+
TimePrecision.MINUTE,
|
|
115
|
+
{"example": "synthetic"},
|
|
116
|
+
)
|
|
117
|
+
config = ChartConfig(HouseSystem.WHOLE_SIGN, (Body.SUN, Body.MOON), ())
|
|
118
|
+
chart = natal_chart(prepare_natal_input(record), config)
|
|
119
|
+
print(chart.provenance.astrology_version)
|
|
120
|
+
print(chart.resolved.utc.isoformat())
|
|
121
|
+
for placement in chart.placements:
|
|
122
|
+
print(f"{placement.identity.value}: {placement.sign.value}")
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Output:
|
|
126
|
+
|
|
127
|
+
```text
|
|
128
|
+
0.1.0
|
|
129
|
+
2000-01-01T12:00:00+00:00
|
|
130
|
+
sun: capricorn
|
|
131
|
+
moon: scorpio
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Unknown time or missing location is rejected, not replaced with noon or an inferred
|
|
135
|
+
place. Undefined requested house geometry raises `ChartDomainError` without a
|
|
136
|
+
fallback. See the [chart guide](https://0xf3cd.github.io/astrology/docs/en/chart.html)
|
|
137
|
+
for admitted domains, and the [record guide](https://0xf3cd.github.io/astrology/docs/en/records.html)
|
|
138
|
+
for save/restore/recompute and bilingual text tables.
|
|
139
|
+
|
|
140
|
+
## First knowledge lookup
|
|
141
|
+
|
|
142
|
+
Save this separate script as `first_knowledge.py` and run it with the same
|
|
143
|
+
virtual-environment Python. It reads the packaged catalog without a chart or
|
|
144
|
+
native astronomy initialization; installation still has the platform limits above.
|
|
145
|
+
|
|
146
|
+
```python
|
|
147
|
+
from astrology import load_catalog
|
|
148
|
+
|
|
149
|
+
catalog = load_catalog()
|
|
150
|
+
print(catalog.concept("body.sun").name.text("en"))
|
|
151
|
+
print(catalog.lookup("Sol")[0].identifier)
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Output:
|
|
155
|
+
|
|
156
|
+
```text
|
|
157
|
+
Sun
|
|
158
|
+
body.sun
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Browse the [complete catalog](https://0xf3cd.github.io/astrology/docs/en/catalog.html)
|
|
162
|
+
or [public API](https://0xf3cd.github.io/astrology/docs/en/reference.html).
|
|
163
|
+
The shared documentation search may return either language; Chinese queries use
|
|
164
|
+
character pairs, not semantic matching or dictionary segmentation.
|
|
165
|
+
|
|
166
|
+
## First release
|
|
167
|
+
|
|
168
|
+
The first target is a modern tropical, geocentric natal chart from a known birth
|
|
169
|
+
time and location:
|
|
170
|
+
|
|
171
|
+
- Preserve the birth record, resolve its timezone explicitly, and retain the
|
|
172
|
+
resulting time scales and calculation provenance.
|
|
173
|
+
- Compute the Sun, Moon, eight planets, and explicitly selected lunar nodes.
|
|
174
|
+
- Support Whole Sign, Equal, and Placidus houses, with explicit failures where a
|
|
175
|
+
requested geometry is undefined.
|
|
176
|
+
- Derive signs, two-dimensional house placement (longitude only, without object latitude), and the five major
|
|
177
|
+
aspects with configurable orbs and local applying/separating status.
|
|
178
|
+
- Return immutable structured results, a text table, and a versioned serialization
|
|
179
|
+
that retains inputs, configuration, astronomical values, and model identities.
|
|
180
|
+
|
|
181
|
+
Positions, axes, cusps, signs, house placement, aspects, text output and versioned
|
|
182
|
+
records are implemented. Restoration preserves stored results without native
|
|
183
|
+
astronomy; replay explicitly checks available versions and models.
|
|
184
|
+
|
|
185
|
+
See the [v0.1.0 milestone](https://github.com/0xf3cd/astrology/milestone/1) for
|
|
186
|
+
delivery tasks and acceptance criteria.
|
|
187
|
+
|
|
188
|
+
## Design boundaries
|
|
189
|
+
|
|
190
|
+
- [Repository structure and calculation boundaries](https://0xf3cd.github.io/astrology/docs/en/architecture.html)
|
|
191
|
+
- [Knowledge organization and bilingual documentation](https://0xf3cd.github.io/astrology/docs/en/knowledge.html)
|
|
192
|
+
- [Development and review conventions](https://0xf3cd.github.io/astrology/docs/en/contributing.html)
|
|
193
|
+
|
|
194
|
+
Knowledge browsing is a first-release goal in its own right: readers should be
|
|
195
|
+
able to find a concept, its rule variants, and its sources without creating a
|
|
196
|
+
chart or loading the native astronomy library. Source status, applicability, and
|
|
197
|
+
display eligibility are recorded separately.
|
|
198
|
+
|
|
199
|
+
Project guides and public reference documentation are provided in Chinese and
|
|
200
|
+
English. Both languages refer to the same identifiers, executable rules, and
|
|
201
|
+
source records. Quotations retain their original language; translations are
|
|
202
|
+
identified as translations.
|
|
203
|
+
|
|
204
|
+
## Later work
|
|
205
|
+
|
|
206
|
+
- [Techniques and presentation](https://github.com/0xf3cd/astrology/milestone/2):
|
|
207
|
+
transits and returns, relationship charts, tradition-specific rules, additional
|
|
208
|
+
objects, and chart views.
|
|
209
|
+
- [Advanced and historical research](https://github.com/0xf3cd/astrology/milestone/3):
|
|
210
|
+
directions, progressions, uncertain birth times, historical inputs, spatial
|
|
211
|
+
house placement, and sourced interpretation.
|
|
212
|
+
|
|
213
|
+
These milestones track directions without assigning release dates. Each technique
|
|
214
|
+
needs a named definition, sources, and reference cases before implementation.
|
|
215
|
+
|
|
216
|
+
## License
|
|
217
|
+
|
|
218
|
+
[MIT](https://github.com/0xf3cd/astrology/blob/main/LICENSE) covers project code, translations and authored explanations.
|
|
219
|
+
Historical excerpts retain the reproduction status recorded in their
|
|
220
|
+
[source records](https://0xf3cd.github.io/astrology/docs/en/knowledge.html#knowledge-source-definitions-en).
|