kpastro 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.
- kpastro-0.1.0/LICENSE +21 -0
- kpastro-0.1.0/PKG-INFO +212 -0
- kpastro-0.1.0/README.md +180 -0
- kpastro-0.1.0/pyproject.toml +57 -0
- kpastro-0.1.0/setup.cfg +4 -0
- kpastro-0.1.0/src/kpastro/__init__.py +72 -0
- kpastro-0.1.0/src/kpastro/__main__.py +7 -0
- kpastro-0.1.0/src/kpastro/chart.py +288 -0
- kpastro-0.1.0/src/kpastro/cli.py +209 -0
- kpastro-0.1.0/src/kpastro/constants.py +116 -0
- kpastro-0.1.0/src/kpastro/dasha.py +254 -0
- kpastro-0.1.0/src/kpastro/ephemeris.py +187 -0
- kpastro-0.1.0/src/kpastro/horary.py +122 -0
- kpastro-0.1.0/src/kpastro/significators.py +193 -0
- kpastro-0.1.0/src/kpastro/vedic.py +253 -0
- kpastro-0.1.0/src/kpastro.egg-info/PKG-INFO +212 -0
- kpastro-0.1.0/src/kpastro.egg-info/SOURCES.txt +24 -0
- kpastro-0.1.0/src/kpastro.egg-info/dependency_links.txt +1 -0
- kpastro-0.1.0/src/kpastro.egg-info/entry_points.txt +2 -0
- kpastro-0.1.0/src/kpastro.egg-info/requires.txt +4 -0
- kpastro-0.1.0/src/kpastro.egg-info/top_level.txt +1 -0
- kpastro-0.1.0/tests/test_chart.py +133 -0
- kpastro-0.1.0/tests/test_dasha.py +155 -0
- kpastro-0.1.0/tests/test_ephemeris.py +119 -0
- kpastro-0.1.0/tests/test_horary.py +92 -0
- kpastro-0.1.0/tests/test_vedic.py +197 -0
kpastro-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rituparno Majumdar
|
|
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.
|
kpastro-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kpastro
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Precise Krishnamurti Paddhati (KP) astrology engine: ayanamsa, nakshatra, sub-lord chain, Placidus cusps, Vimshottari dasha, significators, ruling planets and KP horary.
|
|
5
|
+
Author: Rituparno Majumdar
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Rituparno-Majumdar/kp-astrology
|
|
8
|
+
Project-URL: Repository, https://github.com/Rituparno-Majumdar/kp-astrology
|
|
9
|
+
Project-URL: Changelog, https://github.com/Rituparno-Majumdar/kp-astrology/blob/main/CHANGELOG.md
|
|
10
|
+
Project-URL: Issues, https://github.com/Rituparno-Majumdar/kp-astrology/issues
|
|
11
|
+
Keywords: astrology,kp,krishnamurti,paddhati,vedic,jyotish,nakshatra,sub-lord,vimshottari,dasha,horary,swisseph,sidereal,stellar
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
24
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
+
Requires-Python: >=3.9
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Requires-Dist: pyswisseph>=2.10.3
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
# kpastro
|
|
34
|
+
|
|
35
|
+
A precise Krishnamurti Paddhati (KP) Vedic astrology engine in pure Python, powered by the Swiss Ephemeris for arc-second accuracy.
|
|
36
|
+
|
|
37
|
+
[](LICENSE)
|
|
38
|
+
[](https://www.python.org/)
|
|
39
|
+
[](https://en.wikipedia.org/wiki/Krishnamurti_Paddhati)
|
|
40
|
+
[](https://github.com/Rituparno-Majumdar/kp-astrology)
|
|
41
|
+
[](https://www.astro.com/swisseph/)
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## What is KP Astrology?
|
|
46
|
+
|
|
47
|
+
Krishnamurti Paddhati (KP) is a stellar system of Vedic astrology developed by Prof. K. S. Krishnamurti that refines the 27 nakshatras into smaller **sub-lord** and **sub-sub-lord** divisions, so every chart point carries a precise ruling chain: *star-lord, sub-lord, sub-sub-lord*. Because a birth Moon sits inside one of 249 narrow zodiacal divisions, KP timing (Vimshottari dasha) and event judgment (significators, horary) reach a granularity classical jyotish does not.
|
|
48
|
+
|
|
49
|
+
**Why Swiss Ephemeris precision** — the engine computes every planet and house cusp with the industry-standard Swiss Ephemeris (arc-second accurate), then converts to the sidereal zodiac with a configurable ayanamsa. A silent Moshier fallback keeps the package working even with no data files installed; downloading the official ephemeris files unlocks full JPL/VSOP87 precision.
|
|
50
|
+
|
|
51
|
+
## Key features
|
|
52
|
+
|
|
53
|
+
- **Ayanamsa** — Lahiri (Chitrapaksha, KP default), KP (`SE_SIDM_KRISHNAMURTI_VP291`) and KP-old (Krishnamurti's table).
|
|
54
|
+
- **Nakshatra subdivision** — star-lord, sub-lord and sub-sub-lord chains for every planet and house cusp.
|
|
55
|
+
- **Placidus cusps** — computed sidereally from the Swiss Ephemeris, with full KP lord chains on each cusp.
|
|
56
|
+
- **Vimshottari dasha** — mahadasha / antardasha / pratyantar-dasha with birth balances computed at all three levels (MD/AD/PD).
|
|
57
|
+
- **Significators** — Grah and Bhaav Nirdeshan: house and planet significators with 4-tier ranking.
|
|
58
|
+
- **Ruling planets** — day-lord, ascendant-lord and Moon-lord for the moment.
|
|
59
|
+
- **KP horary** — the 1-249 division number system with the horary ascendant taken as the division midpoint.
|
|
60
|
+
- **CLI + Python API** — everything available as a typed library *and* as a `kpastro` command-line tool.
|
|
61
|
+
|
|
62
|
+
## Install
|
|
63
|
+
|
|
64
|
+
Requires **Python 3.9+**.
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# editable install for development
|
|
68
|
+
pip install -e .
|
|
69
|
+
|
|
70
|
+
# with the dev/test extras
|
|
71
|
+
pip install -e .[dev]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`pyswisseph` is the only runtime dependency. On very new CPython releases a source build may be needed; ensure a C compiler is available (or install a pre-built wheel) if the binary wheel is not yet published.
|
|
75
|
+
|
|
76
|
+
## Quick start (CLI)
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Complete KP birth chart (New Delhi)
|
|
80
|
+
python -m kpastro natal --date 1990-01-15 --time 14:30 --tz 5.5 \
|
|
81
|
+
--lat 28.6139 --lon 77.2090 --place "New Delhi"
|
|
82
|
+
|
|
83
|
+
# KP horary (Prashna) from number 45
|
|
84
|
+
python -m kpastro horary --number 45 --date 2026-08-20 --time 10:30 \
|
|
85
|
+
--tz 5.5 --lat 28.61 --lon 77.20
|
|
86
|
+
|
|
87
|
+
# Ayanamsa value on a date
|
|
88
|
+
python -m kpastro ayanamsa --date 2026-08-20
|
|
89
|
+
|
|
90
|
+
# Download the Swiss Ephemeris data files for full precision
|
|
91
|
+
python -m kpastro download-ephemeris
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Other subcommands: `dasha`, `rulings`. Run `python -m kpastro --help` for all options.
|
|
95
|
+
|
|
96
|
+
## Python API
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
from datetime import date, time
|
|
100
|
+
from kpastro import BirthInfo, compute_chart, render_chart, ascendant_from_kp_number
|
|
101
|
+
|
|
102
|
+
birth = BirthInfo(
|
|
103
|
+
date=date(1990, 1, 15), time=time(14, 30),
|
|
104
|
+
latitude=28.6139, longitude=77.2090,
|
|
105
|
+
tz_hours=5.5, place="New Delhi",
|
|
106
|
+
)
|
|
107
|
+
chart = compute_chart(birth, ayanamsa="lahiri")
|
|
108
|
+
print(render_chart(chart))
|
|
109
|
+
|
|
110
|
+
# KP horary: all 249 divisions, or the ascendant for one number
|
|
111
|
+
divs = kp_divisions() # list of 249 HoraryDiv
|
|
112
|
+
q = ascendant_from_kp_number(45) # dict with ascendant + lord chain
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
`chart.planets`, `chart.cusps`, `chart.balance`, `chart.mahadashas`, `chart.current`,
|
|
116
|
+
`chart.planet_significators` and `chart.ruling` give typed access to every KP layer.
|
|
117
|
+
|
|
118
|
+
## The mathematics
|
|
119
|
+
|
|
120
|
+
**Ayanamsa** — the sidereal zodiac is the tropical zodiac minus the ayanamsa:
|
|
121
|
+
|
|
122
|
+
```text
|
|
123
|
+
sidereal longitude = tropical longitude - ayanamsa
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
The Chitrapaksha (Lahiri) zero point anchors the sidereal origin to the star Spica (Chitra) at 0° Libra. Lahiri and KP modes differ only in the exact reference and precession model used; around **2026 the ayanamsa is approximately 24.14°**.
|
|
127
|
+
|
|
128
|
+
**Nakshatra** — the zodiac is divided into 27 nakshatras of **13°20' = 800'** each.
|
|
129
|
+
|
|
130
|
+
**Sub-lords** — each nakshatra is split into 9 sub-lords whose spans are proportional to the Vimshottari years:
|
|
131
|
+
|
|
132
|
+
```text
|
|
133
|
+
sub span (arcmin) = (lord's years / 120) * 800'
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
The sub-lord sequence starts at the star-lord and cycles through the Vimshottari order; the sub-sub-lord divides the sub again with the same proportions.
|
|
137
|
+
|
|
138
|
+
**Vimshottari years** — the total cycle is 120 years:
|
|
139
|
+
|
|
140
|
+
| Planet | Years |
|
|
141
|
+
|--------|-------|
|
|
142
|
+
| Ketu | 7 |
|
|
143
|
+
| Venus | 20 |
|
|
144
|
+
| Sun | 6 |
|
|
145
|
+
| Moon | 10 |
|
|
146
|
+
| Mars | 7 |
|
|
147
|
+
| Rahu | 18 |
|
|
148
|
+
| Jupiter| 16 |
|
|
149
|
+
| Saturn | 19 |
|
|
150
|
+
| Mercury| 17 |
|
|
151
|
+
|
|
152
|
+
**Nakshatra lord mapping** — the star-lord of nakshatra `i` (0-26) is:
|
|
153
|
+
|
|
154
|
+
```text
|
|
155
|
+
star_lord(i) = VIMSHOTTARI_ORDER[i % 9]
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
so the 9-planet Vimshottari cycle repeats every 9 nakshatras: Ketu, Venus, Sun, Moon, Mars, Rahu, Jupiter, Saturn, Mercury, then repeats.
|
|
159
|
+
|
|
160
|
+
**Dasha balance at birth** — anchored to the birth Moon's nakshatra (span `star` = 13°20'), with 1 year = 365.25 days:
|
|
161
|
+
|
|
162
|
+
```text
|
|
163
|
+
MD_bal = (star_end - Moon) / star * Y_star * 365.25 # mahadasha balance
|
|
164
|
+
AD_bal = (sub_end - Moon) / star * Y_star * 365.25 # antardasha balance
|
|
165
|
+
PD_bal = (subsub_end - Moon) / star * Y_star * 365.25 # pratyantar-dasha balance
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
where `star_end` is the end of the Moon's nakshatra, `sub_end` / `subsub_end` the ends of the Moon's sub / sub-sub, and `Y_star` the mahadasha years of the star-lord. Every subsequent sub-period is `Y_parent * Y_child / 120` years.
|
|
169
|
+
|
|
170
|
+
**Why 249 divisions for horary** — 27 nakshatras × 9 sub-lords = 243 subs. Six of the twelve sign boundaries fall *inside* a sub and split it in two (the sub-lord is unchanged but the sign changes), giving exactly **249 numbered KP divisions** from 0° Aries. A querent's number 1-249 selects division *n*; the horary ascendant is that division's midpoint.
|
|
171
|
+
|
|
172
|
+
## Accuracy & data files
|
|
173
|
+
|
|
174
|
+
- **Moshier fallback (default, no downloads)** — planets to about **1 arc-second**, Moon about **0.5"**. More than adequate for KP sub-lord work.
|
|
175
|
+
- **Full Swiss Ephemeris precision** — run `python -m kpastro download-ephemeris` (or `download_ephemeris()`), which places `sepl_18.se1`, `semo_18.se1` and `seas_18.se1` into `~/.kpastro/ephe`. The engine then uses the compressed **VSOP87 / JPL DE431** ephemeris at full precision. The files are also picked up from `SE_EPHE_PATH`.
|
|
176
|
+
|
|
177
|
+
## Project layout
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
src/kpastro/
|
|
181
|
+
__init__.py public API surface + version
|
|
182
|
+
__main__.py python -m kpastro entry point
|
|
183
|
+
constants.py Vimshottari tables, signs, nakshatras, sign-lords
|
|
184
|
+
vedic.py pure-Python KP subdivision math (star / sub / sub-sub)
|
|
185
|
+
ephemeris.py Swiss Ephemeris wrapper, ayanamsa, houses, downloads
|
|
186
|
+
chart.py BirthInfo, compute_chart, render_chart
|
|
187
|
+
dasha.py Vimshottari balances, timelines, sub-periods
|
|
188
|
+
significators.py Grah & Bhaav Nirdeshan, ruling planets
|
|
189
|
+
horary.py the 249-division KP number system
|
|
190
|
+
cli.py argparse CLI (natal / horary / dasha / ayanamsa / ...)
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Roadmap
|
|
194
|
+
|
|
195
|
+
- [ ] Full dasha view with all 120 sub-periods and transit overlays.
|
|
196
|
+
- [ ] Navamsa and other vargas in the KP scheme.
|
|
197
|
+
- [ ] KP year (KPY) and Saturn-return timing helpers.
|
|
198
|
+
- [ ] Western-style event chart export (JSON / CSV).
|
|
199
|
+
- [ ] Optional TinyDB/Pandas output and Jupyter notebooks.
|
|
200
|
+
- [ ] Contribution-driven: more ayanamsa modes, house systems, node options.
|
|
201
|
+
|
|
202
|
+
## Contributing
|
|
203
|
+
|
|
204
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, tests and style. Feedback and pull requests are welcome — file issues at the [issue tracker](https://github.com/Rituparno-Majumdar/kp-astrology/issues).
|
|
205
|
+
|
|
206
|
+
## License
|
|
207
|
+
|
|
208
|
+
MIT — see [LICENSE](LICENSE). Copyright (c) 2026 Rituparno Majumdar.
|
|
209
|
+
|
|
210
|
+
## Disclaimer
|
|
211
|
+
|
|
212
|
+
This software is provided for **educational and scientific** purposes only. Astrological interpretations are not scientific predictions, and nothing here should be used to make financial, medical or legal decisions.
|
kpastro-0.1.0/README.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# kpastro
|
|
2
|
+
|
|
3
|
+
A precise Krishnamurti Paddhati (KP) Vedic astrology engine in pure Python, powered by the Swiss Ephemeris for arc-second accuracy.
|
|
4
|
+
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://www.python.org/)
|
|
7
|
+
[](https://en.wikipedia.org/wiki/Krishnamurti_Paddhati)
|
|
8
|
+
[](https://github.com/Rituparno-Majumdar/kp-astrology)
|
|
9
|
+
[](https://www.astro.com/swisseph/)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## What is KP Astrology?
|
|
14
|
+
|
|
15
|
+
Krishnamurti Paddhati (KP) is a stellar system of Vedic astrology developed by Prof. K. S. Krishnamurti that refines the 27 nakshatras into smaller **sub-lord** and **sub-sub-lord** divisions, so every chart point carries a precise ruling chain: *star-lord, sub-lord, sub-sub-lord*. Because a birth Moon sits inside one of 249 narrow zodiacal divisions, KP timing (Vimshottari dasha) and event judgment (significators, horary) reach a granularity classical jyotish does not.
|
|
16
|
+
|
|
17
|
+
**Why Swiss Ephemeris precision** — the engine computes every planet and house cusp with the industry-standard Swiss Ephemeris (arc-second accurate), then converts to the sidereal zodiac with a configurable ayanamsa. A silent Moshier fallback keeps the package working even with no data files installed; downloading the official ephemeris files unlocks full JPL/VSOP87 precision.
|
|
18
|
+
|
|
19
|
+
## Key features
|
|
20
|
+
|
|
21
|
+
- **Ayanamsa** — Lahiri (Chitrapaksha, KP default), KP (`SE_SIDM_KRISHNAMURTI_VP291`) and KP-old (Krishnamurti's table).
|
|
22
|
+
- **Nakshatra subdivision** — star-lord, sub-lord and sub-sub-lord chains for every planet and house cusp.
|
|
23
|
+
- **Placidus cusps** — computed sidereally from the Swiss Ephemeris, with full KP lord chains on each cusp.
|
|
24
|
+
- **Vimshottari dasha** — mahadasha / antardasha / pratyantar-dasha with birth balances computed at all three levels (MD/AD/PD).
|
|
25
|
+
- **Significators** — Grah and Bhaav Nirdeshan: house and planet significators with 4-tier ranking.
|
|
26
|
+
- **Ruling planets** — day-lord, ascendant-lord and Moon-lord for the moment.
|
|
27
|
+
- **KP horary** — the 1-249 division number system with the horary ascendant taken as the division midpoint.
|
|
28
|
+
- **CLI + Python API** — everything available as a typed library *and* as a `kpastro` command-line tool.
|
|
29
|
+
|
|
30
|
+
## Install
|
|
31
|
+
|
|
32
|
+
Requires **Python 3.9+**.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# editable install for development
|
|
36
|
+
pip install -e .
|
|
37
|
+
|
|
38
|
+
# with the dev/test extras
|
|
39
|
+
pip install -e .[dev]
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`pyswisseph` is the only runtime dependency. On very new CPython releases a source build may be needed; ensure a C compiler is available (or install a pre-built wheel) if the binary wheel is not yet published.
|
|
43
|
+
|
|
44
|
+
## Quick start (CLI)
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Complete KP birth chart (New Delhi)
|
|
48
|
+
python -m kpastro natal --date 1990-01-15 --time 14:30 --tz 5.5 \
|
|
49
|
+
--lat 28.6139 --lon 77.2090 --place "New Delhi"
|
|
50
|
+
|
|
51
|
+
# KP horary (Prashna) from number 45
|
|
52
|
+
python -m kpastro horary --number 45 --date 2026-08-20 --time 10:30 \
|
|
53
|
+
--tz 5.5 --lat 28.61 --lon 77.20
|
|
54
|
+
|
|
55
|
+
# Ayanamsa value on a date
|
|
56
|
+
python -m kpastro ayanamsa --date 2026-08-20
|
|
57
|
+
|
|
58
|
+
# Download the Swiss Ephemeris data files for full precision
|
|
59
|
+
python -m kpastro download-ephemeris
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Other subcommands: `dasha`, `rulings`. Run `python -m kpastro --help` for all options.
|
|
63
|
+
|
|
64
|
+
## Python API
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
from datetime import date, time
|
|
68
|
+
from kpastro import BirthInfo, compute_chart, render_chart, ascendant_from_kp_number
|
|
69
|
+
|
|
70
|
+
birth = BirthInfo(
|
|
71
|
+
date=date(1990, 1, 15), time=time(14, 30),
|
|
72
|
+
latitude=28.6139, longitude=77.2090,
|
|
73
|
+
tz_hours=5.5, place="New Delhi",
|
|
74
|
+
)
|
|
75
|
+
chart = compute_chart(birth, ayanamsa="lahiri")
|
|
76
|
+
print(render_chart(chart))
|
|
77
|
+
|
|
78
|
+
# KP horary: all 249 divisions, or the ascendant for one number
|
|
79
|
+
divs = kp_divisions() # list of 249 HoraryDiv
|
|
80
|
+
q = ascendant_from_kp_number(45) # dict with ascendant + lord chain
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`chart.planets`, `chart.cusps`, `chart.balance`, `chart.mahadashas`, `chart.current`,
|
|
84
|
+
`chart.planet_significators` and `chart.ruling` give typed access to every KP layer.
|
|
85
|
+
|
|
86
|
+
## The mathematics
|
|
87
|
+
|
|
88
|
+
**Ayanamsa** — the sidereal zodiac is the tropical zodiac minus the ayanamsa:
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
sidereal longitude = tropical longitude - ayanamsa
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The Chitrapaksha (Lahiri) zero point anchors the sidereal origin to the star Spica (Chitra) at 0° Libra. Lahiri and KP modes differ only in the exact reference and precession model used; around **2026 the ayanamsa is approximately 24.14°**.
|
|
95
|
+
|
|
96
|
+
**Nakshatra** — the zodiac is divided into 27 nakshatras of **13°20' = 800'** each.
|
|
97
|
+
|
|
98
|
+
**Sub-lords** — each nakshatra is split into 9 sub-lords whose spans are proportional to the Vimshottari years:
|
|
99
|
+
|
|
100
|
+
```text
|
|
101
|
+
sub span (arcmin) = (lord's years / 120) * 800'
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The sub-lord sequence starts at the star-lord and cycles through the Vimshottari order; the sub-sub-lord divides the sub again with the same proportions.
|
|
105
|
+
|
|
106
|
+
**Vimshottari years** — the total cycle is 120 years:
|
|
107
|
+
|
|
108
|
+
| Planet | Years |
|
|
109
|
+
|--------|-------|
|
|
110
|
+
| Ketu | 7 |
|
|
111
|
+
| Venus | 20 |
|
|
112
|
+
| Sun | 6 |
|
|
113
|
+
| Moon | 10 |
|
|
114
|
+
| Mars | 7 |
|
|
115
|
+
| Rahu | 18 |
|
|
116
|
+
| Jupiter| 16 |
|
|
117
|
+
| Saturn | 19 |
|
|
118
|
+
| Mercury| 17 |
|
|
119
|
+
|
|
120
|
+
**Nakshatra lord mapping** — the star-lord of nakshatra `i` (0-26) is:
|
|
121
|
+
|
|
122
|
+
```text
|
|
123
|
+
star_lord(i) = VIMSHOTTARI_ORDER[i % 9]
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
so the 9-planet Vimshottari cycle repeats every 9 nakshatras: Ketu, Venus, Sun, Moon, Mars, Rahu, Jupiter, Saturn, Mercury, then repeats.
|
|
127
|
+
|
|
128
|
+
**Dasha balance at birth** — anchored to the birth Moon's nakshatra (span `star` = 13°20'), with 1 year = 365.25 days:
|
|
129
|
+
|
|
130
|
+
```text
|
|
131
|
+
MD_bal = (star_end - Moon) / star * Y_star * 365.25 # mahadasha balance
|
|
132
|
+
AD_bal = (sub_end - Moon) / star * Y_star * 365.25 # antardasha balance
|
|
133
|
+
PD_bal = (subsub_end - Moon) / star * Y_star * 365.25 # pratyantar-dasha balance
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
where `star_end` is the end of the Moon's nakshatra, `sub_end` / `subsub_end` the ends of the Moon's sub / sub-sub, and `Y_star` the mahadasha years of the star-lord. Every subsequent sub-period is `Y_parent * Y_child / 120` years.
|
|
137
|
+
|
|
138
|
+
**Why 249 divisions for horary** — 27 nakshatras × 9 sub-lords = 243 subs. Six of the twelve sign boundaries fall *inside* a sub and split it in two (the sub-lord is unchanged but the sign changes), giving exactly **249 numbered KP divisions** from 0° Aries. A querent's number 1-249 selects division *n*; the horary ascendant is that division's midpoint.
|
|
139
|
+
|
|
140
|
+
## Accuracy & data files
|
|
141
|
+
|
|
142
|
+
- **Moshier fallback (default, no downloads)** — planets to about **1 arc-second**, Moon about **0.5"**. More than adequate for KP sub-lord work.
|
|
143
|
+
- **Full Swiss Ephemeris precision** — run `python -m kpastro download-ephemeris` (or `download_ephemeris()`), which places `sepl_18.se1`, `semo_18.se1` and `seas_18.se1` into `~/.kpastro/ephe`. The engine then uses the compressed **VSOP87 / JPL DE431** ephemeris at full precision. The files are also picked up from `SE_EPHE_PATH`.
|
|
144
|
+
|
|
145
|
+
## Project layout
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
src/kpastro/
|
|
149
|
+
__init__.py public API surface + version
|
|
150
|
+
__main__.py python -m kpastro entry point
|
|
151
|
+
constants.py Vimshottari tables, signs, nakshatras, sign-lords
|
|
152
|
+
vedic.py pure-Python KP subdivision math (star / sub / sub-sub)
|
|
153
|
+
ephemeris.py Swiss Ephemeris wrapper, ayanamsa, houses, downloads
|
|
154
|
+
chart.py BirthInfo, compute_chart, render_chart
|
|
155
|
+
dasha.py Vimshottari balances, timelines, sub-periods
|
|
156
|
+
significators.py Grah & Bhaav Nirdeshan, ruling planets
|
|
157
|
+
horary.py the 249-division KP number system
|
|
158
|
+
cli.py argparse CLI (natal / horary / dasha / ayanamsa / ...)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Roadmap
|
|
162
|
+
|
|
163
|
+
- [ ] Full dasha view with all 120 sub-periods and transit overlays.
|
|
164
|
+
- [ ] Navamsa and other vargas in the KP scheme.
|
|
165
|
+
- [ ] KP year (KPY) and Saturn-return timing helpers.
|
|
166
|
+
- [ ] Western-style event chart export (JSON / CSV).
|
|
167
|
+
- [ ] Optional TinyDB/Pandas output and Jupyter notebooks.
|
|
168
|
+
- [ ] Contribution-driven: more ayanamsa modes, house systems, node options.
|
|
169
|
+
|
|
170
|
+
## Contributing
|
|
171
|
+
|
|
172
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, tests and style. Feedback and pull requests are welcome — file issues at the [issue tracker](https://github.com/Rituparno-Majumdar/kp-astrology/issues).
|
|
173
|
+
|
|
174
|
+
## License
|
|
175
|
+
|
|
176
|
+
MIT — see [LICENSE](LICENSE). Copyright (c) 2026 Rituparno Majumdar.
|
|
177
|
+
|
|
178
|
+
## Disclaimer
|
|
179
|
+
|
|
180
|
+
This software is provided for **educational and scientific** purposes only. Astrological interpretations are not scientific predictions, and nothing here should be used to make financial, medical or legal decisions.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "kpastro"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Precise Krishnamurti Paddhati (KP) astrology engine: ayanamsa, nakshatra, sub-lord chain, Placidus cusps, Vimshottari dasha, significators, ruling planets and KP horary."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [{ name = "Rituparno Majumdar" }]
|
|
14
|
+
keywords = [
|
|
15
|
+
"astrology", "kp", "krishnamurti", "paddhati", "vedic", "jyotish",
|
|
16
|
+
"nakshatra", "sub-lord", "vimshottari", "dasha", "horary", "swisseph",
|
|
17
|
+
"sidereal", "stellar",
|
|
18
|
+
]
|
|
19
|
+
classifiers = [
|
|
20
|
+
"Development Status :: 3 - Alpha",
|
|
21
|
+
"Intended Audience :: Developers",
|
|
22
|
+
"Intended Audience :: Science/Research",
|
|
23
|
+
"Operating System :: OS Independent",
|
|
24
|
+
"Programming Language :: Python :: 3",
|
|
25
|
+
"Programming Language :: Python :: 3.9",
|
|
26
|
+
"Programming Language :: Python :: 3.10",
|
|
27
|
+
"Programming Language :: Python :: 3.11",
|
|
28
|
+
"Programming Language :: Python :: 3.12",
|
|
29
|
+
"Programming Language :: Python :: 3.13",
|
|
30
|
+
"Programming Language :: Python :: 3.14",
|
|
31
|
+
"Topic :: Scientific/Engineering :: Astronomy",
|
|
32
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
33
|
+
]
|
|
34
|
+
dependencies = [
|
|
35
|
+
"pyswisseph>=2.10.3",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[project.optional-dependencies]
|
|
39
|
+
dev = [
|
|
40
|
+
"pytest>=7.0",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[project.scripts]
|
|
44
|
+
kpastro = "kpastro.cli:main"
|
|
45
|
+
|
|
46
|
+
[project.urls]
|
|
47
|
+
Homepage = "https://github.com/Rituparno-Majumdar/kp-astrology"
|
|
48
|
+
Repository = "https://github.com/Rituparno-Majumdar/kp-astrology"
|
|
49
|
+
Changelog = "https://github.com/Rituparno-Majumdar/kp-astrology/blob/main/CHANGELOG.md"
|
|
50
|
+
Issues = "https://github.com/Rituparno-Majumdar/kp-astrology/issues"
|
|
51
|
+
|
|
52
|
+
[tool.setuptools.packages.find]
|
|
53
|
+
where = ["src"]
|
|
54
|
+
|
|
55
|
+
[tool.pytest.ini_options]
|
|
56
|
+
testpaths = ["tests"]
|
|
57
|
+
addopts = "-q"
|
kpastro-0.1.0/setup.cfg
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""kpastro - a precise Krishnamurti Paddhati (KP) astrology engine.
|
|
2
|
+
|
|
3
|
+
Highlights
|
|
4
|
+
----------
|
|
5
|
+
* Swiss Ephemeris backend (arc-second accuracy) for planets, ayanamsa and
|
|
6
|
+
Placidus cusps, with an automatic Moshier fallback when no data files exist.
|
|
7
|
+
* Pure-Python KP subdivision math: nakshatra, sub-lord, sub-sub-lord.
|
|
8
|
+
* Vimshottari dasha with nested birth balances (MD/AD/PD).
|
|
9
|
+
* Planet -> house and house -> planet significators, ruling planets.
|
|
10
|
+
* KP horary: the 249-division number system.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from . import vedic # noqa: F401
|
|
14
|
+
from .dasha import ( # noqa: F401
|
|
15
|
+
Balance,
|
|
16
|
+
Period,
|
|
17
|
+
antardashas_of,
|
|
18
|
+
current_periods,
|
|
19
|
+
dasha_balance,
|
|
20
|
+
mahadasha_timeline,
|
|
21
|
+
)
|
|
22
|
+
from .ephemeris import SwissEphemeris, download_ephemeris, ephemeris_version # noqa: F401
|
|
23
|
+
from .chart import ( # noqa: F401
|
|
24
|
+
BirthInfo,
|
|
25
|
+
Chart,
|
|
26
|
+
compute_chart,
|
|
27
|
+
render_chart,
|
|
28
|
+
)
|
|
29
|
+
from .horary import ( # noqa: F401
|
|
30
|
+
HoraryDiv,
|
|
31
|
+
ascendant_from_kp_number,
|
|
32
|
+
kp_divisions,
|
|
33
|
+
kp_number_for_longitude,
|
|
34
|
+
)
|
|
35
|
+
from .significators import ( # noqa: F401
|
|
36
|
+
RulingPlanet,
|
|
37
|
+
house_significations,
|
|
38
|
+
planet_significations,
|
|
39
|
+
ruling_planets,
|
|
40
|
+
)
|
|
41
|
+
from .vedic import format_longitude, point_info, sub_info, sub_sub_info # noqa: F401
|
|
42
|
+
|
|
43
|
+
__version__ = "0.1.0"
|
|
44
|
+
|
|
45
|
+
__all__ = [
|
|
46
|
+
"Balance",
|
|
47
|
+
"BirthInfo",
|
|
48
|
+
"Chart",
|
|
49
|
+
"HoraryDiv",
|
|
50
|
+
"Period",
|
|
51
|
+
"RulingPlanet",
|
|
52
|
+
"SwissEphemeris",
|
|
53
|
+
"antardashas_of",
|
|
54
|
+
"ascendant_from_kp_number",
|
|
55
|
+
"compute_chart",
|
|
56
|
+
"current_periods",
|
|
57
|
+
"dasha_balance",
|
|
58
|
+
"download_ephemeris",
|
|
59
|
+
"ephemeris_version",
|
|
60
|
+
"format_longitude",
|
|
61
|
+
"house_significations",
|
|
62
|
+
"kp_divisions",
|
|
63
|
+
"kp_number_for_longitude",
|
|
64
|
+
"mahadasha_timeline",
|
|
65
|
+
"planet_significations",
|
|
66
|
+
"point_info",
|
|
67
|
+
"render_chart",
|
|
68
|
+
"ruling_planets",
|
|
69
|
+
"sub_info",
|
|
70
|
+
"sub_sub_info",
|
|
71
|
+
"vedic",
|
|
72
|
+
]
|