ketu 0.2.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.
- ketu-0.2.0/CHANGELOG.md +86 -0
- ketu-0.2.0/LICENSE +21 -0
- ketu-0.2.0/MANIFEST.in +9 -0
- ketu-0.2.0/PKG-INFO +231 -0
- ketu-0.2.0/README.md +203 -0
- ketu-0.2.0/docs/en/api.md +344 -0
- ketu-0.2.0/docs/en/changelog.md +88 -0
- ketu-0.2.0/docs/en/concepts.md +296 -0
- ketu-0.2.0/docs/en/conf.py +109 -0
- ketu-0.2.0/docs/en/contributing.md +139 -0
- ketu-0.2.0/docs/en/examples.md +292 -0
- ketu-0.2.0/docs/en/index.md +94 -0
- ketu-0.2.0/docs/en/installation.md +81 -0
- ketu-0.2.0/docs/en/quickstart.md +222 -0
- ketu-0.2.0/docs/fr/api.md +344 -0
- ketu-0.2.0/docs/fr/changelog.md +88 -0
- ketu-0.2.0/docs/fr/concepts.md +294 -0
- ketu-0.2.0/docs/fr/conf.py +109 -0
- ketu-0.2.0/docs/fr/contributing.md +139 -0
- ketu-0.2.0/docs/fr/examples.md +292 -0
- ketu-0.2.0/docs/fr/index.md +94 -0
- ketu-0.2.0/docs/fr/installation.md +81 -0
- ketu-0.2.0/docs/fr/quickstart.md +230 -0
- ketu-0.2.0/docs/requirements-docs.txt +6 -0
- ketu-0.2.0/fr/CHANGELOG.md +86 -0
- ketu-0.2.0/fr/CONTRIBUTING.md +149 -0
- ketu-0.2.0/fr/README.md +206 -0
- ketu-0.2.0/ketu/__init__.py +118 -0
- ketu-0.2.0/ketu/ketu.py +273 -0
- ketu-0.2.0/ketu.egg-info/PKG-INFO +231 -0
- ketu-0.2.0/ketu.egg-info/SOURCES.txt +38 -0
- ketu-0.2.0/ketu.egg-info/dependency_links.txt +1 -0
- ketu-0.2.0/ketu.egg-info/entry_points.txt +2 -0
- ketu-0.2.0/ketu.egg-info/requires.txt +2 -0
- ketu-0.2.0/ketu.egg-info/top_level.txt +1 -0
- ketu-0.2.0/pyproject.toml +75 -0
- ketu-0.2.0/requirements.txt +2 -0
- ketu-0.2.0/res/screen.png +0 -0
- ketu-0.2.0/setup.cfg +4 -0
- ketu-0.2.0/tests/test_ketu.py +313 -0
ketu-0.2.0/CHANGELOG.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
> 🇫🇷 Consultez la version française dans `fr/CHANGELOG.md`.
|
|
4
|
+
|
|
5
|
+
All notable changes to Ketu are documented here.
|
|
6
|
+
|
|
7
|
+
This project follows the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
8
|
+
format and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
9
|
+
|
|
10
|
+
## [0.2.0] - 2025-10-27
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Full packaging setup for a PyPI release
|
|
15
|
+
- `pyproject.toml` metadata and dependencies
|
|
16
|
+
- `requirements.txt` for a minimal install
|
|
17
|
+
- Public exports in `ketu/__init__.py`
|
|
18
|
+
- Expanded README with usage examples
|
|
19
|
+
- PyPI, Python versions, and license badges
|
|
20
|
+
- `MANIFEST.in` to ship data files
|
|
21
|
+
- GitHub Actions workflow for automated tests
|
|
22
|
+
- GitHub Actions workflow for PyPI publishing
|
|
23
|
+
- CI coverage for Python 3.9 through 3.13
|
|
24
|
+
- `ketu` CLI entry point
|
|
25
|
+
- Support for 13 celestial bodies (added True Node)
|
|
26
|
+
- English and French documentation
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- Fixed and hardened the unit tests
|
|
31
|
+
- Removed the obsolete `_timea.py` profiling helper
|
|
32
|
+
- Optimised package structure for distribution
|
|
33
|
+
- Aligned the documentation with the new layout
|
|
34
|
+
|
|
35
|
+
### Technical
|
|
36
|
+
|
|
37
|
+
- Official support for Python 3.10–3.13
|
|
38
|
+
- Pytest configuration embedded in `pyproject.toml`
|
|
39
|
+
- Coverage configuration for CI analysis
|
|
40
|
+
- Package installable via `pip install ketu`
|
|
41
|
+
- Works seamlessly in virtual environments
|
|
42
|
+
|
|
43
|
+
## [0.1.0] - 2024-01-XX
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
|
|
47
|
+
- Interactive CLI to compute positions and aspects
|
|
48
|
+
- Planetary position computations through pyswisseph
|
|
49
|
+
- Detection of major aspects with orb handling
|
|
50
|
+
- Conversion helpers between UTC and Julian Day
|
|
51
|
+
- Retrogradation detection
|
|
52
|
+
- Complete documentation with Sphinx and MyST
|
|
53
|
+
- Initial PyPI-ready packaging
|
|
54
|
+
- Foundational unit tests
|
|
55
|
+
|
|
56
|
+
### Features
|
|
57
|
+
|
|
58
|
+
- Support for 12 initial celestial bodies
|
|
59
|
+
- Seven major aspects (conjunction to opposition)
|
|
60
|
+
- Zodiac sign computations
|
|
61
|
+
- Orb system inspired by Abu Ma'shar
|
|
62
|
+
- LRU cache to improve performance
|
|
63
|
+
- Requires Python 3.9+
|
|
64
|
+
- Dependencies: numpy, pyswisseph
|
|
65
|
+
- Modular, documented codebase
|
|
66
|
+
|
|
67
|
+
## [0.0.1] - 2023-01-XX
|
|
68
|
+
|
|
69
|
+
### Initial
|
|
70
|
+
|
|
71
|
+
- Prototype groundwork
|
|
72
|
+
- Basic position calculations
|
|
73
|
+
- Command-line interface
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Versioning Convention
|
|
78
|
+
|
|
79
|
+
- **MAJOR**: Incompatible API changes
|
|
80
|
+
- **MINOR**: Backward-compatible feature additions
|
|
81
|
+
- **PATCH**: Backward-compatible bug fixes
|
|
82
|
+
|
|
83
|
+
## Links
|
|
84
|
+
|
|
85
|
+
- [Version comparison](https://github.com/alkimya/ketu/compare/)
|
|
86
|
+
- [All releases](https://github.com/alkimya/ketu/releases)
|
ketu-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Loc Cosnier
|
|
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.
|
ketu-0.2.0/MANIFEST.in
ADDED
ketu-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ketu
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Library to compute astronomical bodies positions and planetary aspects between them
|
|
5
|
+
Author-email: Loc Cosnier <loc.cosnier@pm.me>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/alkimya/ketu
|
|
8
|
+
Project-URL: Documentation, https://ketu.readthedocs.io
|
|
9
|
+
Project-URL: Repository, https://github.com/alkimya/ketu
|
|
10
|
+
Project-URL: Issues, https://github.com/alkimya/ketu/issues
|
|
11
|
+
Keywords: astrology,astronomy,ephemeris,aspects,planets,zodiac,swiss ephemeris
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: numpy>=1.20.0
|
|
26
|
+
Requires-Dist: pyswisseph>=2.10.0
|
|
27
|
+
Dynamic: license-file
|
|
28
|
+
|
|
29
|
+
# Ketu
|
|
30
|
+
|
|
31
|
+
[](https://badge.fury.io/py/ketu)
|
|
32
|
+
[](https://pypi.org/project/ketu/)
|
|
33
|
+
[](https://opensource.org/licenses/MIT)
|
|
34
|
+
|
|
35
|
+
> 🇫🇷 Vous préférez le français ? [Consultez README.md](fr/README.md)
|
|
36
|
+
|
|
37
|
+
**Ketu** is a lightweight Python library for computing the positions of astronomical bodies (Sun, Moon, planets, and the mean Node a.k.a. Rahu) and generating calendars driven by astrological aspects.
|
|
38
|
+
|
|
39
|
+
This library was originally designed to generate biodynamic calendars and time series based on astrological aspects. It can be used as a basis for building astrology software.
|
|
40
|
+
|
|
41
|
+

|
|
42
|
+
|
|
43
|
+
## ✨ Features
|
|
44
|
+
|
|
45
|
+
- 🌍 **Planetary positions** for 13 bodies (Sun, Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto, Rahu/Mean Node, True North Node, Lilith)
|
|
46
|
+
- ⭐ **Detection of the 7 major aspects** (Conjunction, Semi-sextile, Sextile, Square, Trine, Quincunx, Opposition)
|
|
47
|
+
- 🔄 **Retrogradation detection** and planet motion helpers
|
|
48
|
+
- 🕐 **Time system conversions** (UTC, Julian Day)
|
|
49
|
+
- 🎯 **Orb system** based on Abu Ma'shar (787-886) and Al-Biruni (973-1050)
|
|
50
|
+
- 🖥️ **Interactive CLI** for a non-programmatic workflow
|
|
51
|
+
- 📊 **Python API** that fits into your own tooling
|
|
52
|
+
|
|
53
|
+
## 📦 Installation
|
|
54
|
+
|
|
55
|
+
### From PyPI (recommended)
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pip install ketu
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### From source
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
git clone https://github.com/alkimya/ketu.git
|
|
65
|
+
cd ketu
|
|
66
|
+
pip install -e .
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## 🚀 Quick Start
|
|
70
|
+
|
|
71
|
+
### Interactive mode (CLI)
|
|
72
|
+
|
|
73
|
+
Run the command below and answer the prompts:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
ketu
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
You will be asked for:
|
|
80
|
+
|
|
81
|
+
- A date (ISO format: `2020-12-21`)
|
|
82
|
+
- A time (ISO format: `19:20`)
|
|
83
|
+
- A timezone (for example `Europe/Paris`)
|
|
84
|
+
|
|
85
|
+
The program prints:
|
|
86
|
+
|
|
87
|
+
- Positions of every celestial body with zodiac signs
|
|
88
|
+
- All inter-planet aspects with their orbs
|
|
89
|
+
|
|
90
|
+
### Programmatic usage
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
from datetime import datetime
|
|
94
|
+
from zoneinfo import ZoneInfo
|
|
95
|
+
import ketu
|
|
96
|
+
|
|
97
|
+
# Define a datetime
|
|
98
|
+
dtime = datetime(2020, 12, 21, 19, 20, tzinfo=ZoneInfo("Europe/Paris"))
|
|
99
|
+
jday = ketu.utc_to_julian(dtime)
|
|
100
|
+
|
|
101
|
+
# Display planetary positions
|
|
102
|
+
ketu.print_positions(jday)
|
|
103
|
+
|
|
104
|
+
# Display aspects
|
|
105
|
+
ketu.print_aspects(jday)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Additional examples
|
|
109
|
+
|
|
110
|
+
#### Compute a planet position
|
|
111
|
+
|
|
112
|
+
```python
|
|
113
|
+
from datetime import datetime
|
|
114
|
+
from zoneinfo import ZoneInfo
|
|
115
|
+
import ketu
|
|
116
|
+
|
|
117
|
+
dtime = datetime(2024, 10, 26, 12, 0, tzinfo=ZoneInfo("UTC"))
|
|
118
|
+
jday = ketu.utc_to_julian(dtime)
|
|
119
|
+
|
|
120
|
+
sun_long = ketu.long(jday, 0)
|
|
121
|
+
print(f"Sun longitude: {sun_long:.2f}°")
|
|
122
|
+
|
|
123
|
+
sign, deg, mins, secs = ketu.body_sign(sun_long)
|
|
124
|
+
print(f"Position: {ketu.signs[sign]} {deg}°{mins}'{secs}\"")
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
#### Check whether a planet is retrograde
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
import ketu
|
|
131
|
+
|
|
132
|
+
# Mars (body id = 4)
|
|
133
|
+
if ketu.is_retrograde(jday, 4):
|
|
134
|
+
print("Mars is retrograde")
|
|
135
|
+
else:
|
|
136
|
+
print("Mars is direct")
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
#### Calculate all aspects for a given day
|
|
140
|
+
|
|
141
|
+
```python
|
|
142
|
+
import ketu
|
|
143
|
+
|
|
144
|
+
aspects_data = ketu.calculate_aspects(jday)
|
|
145
|
+
|
|
146
|
+
for aspect in aspects_data:
|
|
147
|
+
body1, body2, i_asp, orb = aspect
|
|
148
|
+
print(f"{ketu.body_name(body1)} - {ketu.body_name(body2)}: "
|
|
149
|
+
f"{ketu.aspects['name'][i_asp].decode()} (orb: {orb:.2f}°)")
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## 📚 Documentation
|
|
153
|
+
|
|
154
|
+
The full documentation is hosted on [Read the Docs](https://ketu.readthedocs.io) (French by default, English via the language toggle).
|
|
155
|
+
|
|
156
|
+
Included sections:
|
|
157
|
+
|
|
158
|
+
- **Installation**: detailed setup instructions
|
|
159
|
+
- **Quickstart**: guided tour of the basics
|
|
160
|
+
- **Concepts**: astrological and astronomical background
|
|
161
|
+
- **API Reference**: all functions documented
|
|
162
|
+
- **Examples**: advanced usage patterns
|
|
163
|
+
|
|
164
|
+
## 🛠️ Requirements
|
|
165
|
+
|
|
166
|
+
- Python 3.10 or higher
|
|
167
|
+
- `numpy` ≥ 1.20.0 — numerical routines and arrays
|
|
168
|
+
- `pyswisseph` ≥ 2.10.0 — Swiss Ephemeris bindings
|
|
169
|
+
|
|
170
|
+
> The dependency on `pyswisseph` is scheduled for removal in a future release, replaced by pure NumPy implementation.
|
|
171
|
+
|
|
172
|
+
## 📋 Supported bodies
|
|
173
|
+
|
|
174
|
+
| Body | ID | Orb | Average speed (°/day) |
|
|
175
|
+
|------|----|-----|-----------------------|
|
|
176
|
+
| Sun | 0 | 12° | 0.986 |
|
|
177
|
+
| Moon | 1 | 12° | 13.176 |
|
|
178
|
+
| Mercury | 2 | 8° | 1.383 |
|
|
179
|
+
| Venus | 3 | 10° | 1.200 |
|
|
180
|
+
| Mars | 4 | 8° | 0.524 |
|
|
181
|
+
| Jupiter | 5 | 10° | 0.083 |
|
|
182
|
+
| Saturn | 6 | 10° | 0.034 |
|
|
183
|
+
| Uranus | 7 | 6° | 0.012 |
|
|
184
|
+
| Neptune | 8 | 6° | 0.007 |
|
|
185
|
+
| Pluto | 9 | 4° | 0.004 |
|
|
186
|
+
| Rahu (Mean Node) | 10 | 0° | -0.013 |
|
|
187
|
+
| True North Node | 11 | 0° | -0.013 |
|
|
188
|
+
| Lilith (Black Moon) | 12 | 0° | -0.113 |
|
|
189
|
+
|
|
190
|
+
## 🎯 Supported aspects
|
|
191
|
+
|
|
192
|
+
| Aspect | Angle | Orb coefficient |
|
|
193
|
+
|--------|-------|-------------------|
|
|
194
|
+
| Conjunction | 0° | 1 |
|
|
195
|
+
| Semi-sextile | 30° | 1/6 |
|
|
196
|
+
| Sextile | 60° | 1/3 |
|
|
197
|
+
| Square | 90° | 1/2 |
|
|
198
|
+
| Trine | 120° | 2/3 |
|
|
199
|
+
| Quincunx | 150° | 5/6 |
|
|
200
|
+
| Opposition | 180° | 1 |
|
|
201
|
+
|
|
202
|
+
## 🗺️ Roadmap
|
|
203
|
+
|
|
204
|
+
- [ ] Removal of dependency on pyswisseph
|
|
205
|
+
- [ ] Pure numpy implementation of planetary calculations
|
|
206
|
+
- [ ] Search for exact aspects between two dates
|
|
207
|
+
- [ ] Generation of aspect calendars
|
|
208
|
+
- [ ] API for progressions and directions
|
|
209
|
+
- [ ] Support for more celestial bodies (asteroids, etc.)
|
|
210
|
+
|
|
211
|
+
## 🤝 Contribution
|
|
212
|
+
|
|
213
|
+
Contributions are welcome! Feel free to:
|
|
214
|
+
|
|
215
|
+
- Open an issue to report a bug or suggest a feature
|
|
216
|
+
- Submit a pull request
|
|
217
|
+
- Improve the documentation
|
|
218
|
+
|
|
219
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for more details.
|
|
220
|
+
|
|
221
|
+
## 📄 License
|
|
222
|
+
|
|
223
|
+
This project is licensed under MIT. See the [LICENSE](LICENSE) file for more details.
|
|
224
|
+
|
|
225
|
+
## 📧 Contact
|
|
226
|
+
|
|
227
|
+
Loc Cosnier - [@alkimya](https://github.com/alkimya)
|
|
228
|
+
|
|
229
|
+
Project: [https://github.com/alkimya/ketu](https://github.com/alkimya/ketu)
|
|
230
|
+
|
|
231
|
+
Translated with DeepL.com (free version)
|
ketu-0.2.0/README.md
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# Ketu
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/py/ketu)
|
|
4
|
+
[](https://pypi.org/project/ketu/)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
> 🇫🇷 Vous préférez le français ? [Consultez README.md](fr/README.md)
|
|
8
|
+
|
|
9
|
+
**Ketu** is a lightweight Python library for computing the positions of astronomical bodies (Sun, Moon, planets, and the mean Node a.k.a. Rahu) and generating calendars driven by astrological aspects.
|
|
10
|
+
|
|
11
|
+
This library was originally designed to generate biodynamic calendars and time series based on astrological aspects. It can be used as a basis for building astrology software.
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
## ✨ Features
|
|
16
|
+
|
|
17
|
+
- 🌍 **Planetary positions** for 13 bodies (Sun, Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto, Rahu/Mean Node, True North Node, Lilith)
|
|
18
|
+
- ⭐ **Detection of the 7 major aspects** (Conjunction, Semi-sextile, Sextile, Square, Trine, Quincunx, Opposition)
|
|
19
|
+
- 🔄 **Retrogradation detection** and planet motion helpers
|
|
20
|
+
- 🕐 **Time system conversions** (UTC, Julian Day)
|
|
21
|
+
- 🎯 **Orb system** based on Abu Ma'shar (787-886) and Al-Biruni (973-1050)
|
|
22
|
+
- 🖥️ **Interactive CLI** for a non-programmatic workflow
|
|
23
|
+
- 📊 **Python API** that fits into your own tooling
|
|
24
|
+
|
|
25
|
+
## 📦 Installation
|
|
26
|
+
|
|
27
|
+
### From PyPI (recommended)
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install ketu
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### From source
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
git clone https://github.com/alkimya/ketu.git
|
|
37
|
+
cd ketu
|
|
38
|
+
pip install -e .
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## 🚀 Quick Start
|
|
42
|
+
|
|
43
|
+
### Interactive mode (CLI)
|
|
44
|
+
|
|
45
|
+
Run the command below and answer the prompts:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
ketu
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
You will be asked for:
|
|
52
|
+
|
|
53
|
+
- A date (ISO format: `2020-12-21`)
|
|
54
|
+
- A time (ISO format: `19:20`)
|
|
55
|
+
- A timezone (for example `Europe/Paris`)
|
|
56
|
+
|
|
57
|
+
The program prints:
|
|
58
|
+
|
|
59
|
+
- Positions of every celestial body with zodiac signs
|
|
60
|
+
- All inter-planet aspects with their orbs
|
|
61
|
+
|
|
62
|
+
### Programmatic usage
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
from datetime import datetime
|
|
66
|
+
from zoneinfo import ZoneInfo
|
|
67
|
+
import ketu
|
|
68
|
+
|
|
69
|
+
# Define a datetime
|
|
70
|
+
dtime = datetime(2020, 12, 21, 19, 20, tzinfo=ZoneInfo("Europe/Paris"))
|
|
71
|
+
jday = ketu.utc_to_julian(dtime)
|
|
72
|
+
|
|
73
|
+
# Display planetary positions
|
|
74
|
+
ketu.print_positions(jday)
|
|
75
|
+
|
|
76
|
+
# Display aspects
|
|
77
|
+
ketu.print_aspects(jday)
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Additional examples
|
|
81
|
+
|
|
82
|
+
#### Compute a planet position
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
from datetime import datetime
|
|
86
|
+
from zoneinfo import ZoneInfo
|
|
87
|
+
import ketu
|
|
88
|
+
|
|
89
|
+
dtime = datetime(2024, 10, 26, 12, 0, tzinfo=ZoneInfo("UTC"))
|
|
90
|
+
jday = ketu.utc_to_julian(dtime)
|
|
91
|
+
|
|
92
|
+
sun_long = ketu.long(jday, 0)
|
|
93
|
+
print(f"Sun longitude: {sun_long:.2f}°")
|
|
94
|
+
|
|
95
|
+
sign, deg, mins, secs = ketu.body_sign(sun_long)
|
|
96
|
+
print(f"Position: {ketu.signs[sign]} {deg}°{mins}'{secs}\"")
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
#### Check whether a planet is retrograde
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
import ketu
|
|
103
|
+
|
|
104
|
+
# Mars (body id = 4)
|
|
105
|
+
if ketu.is_retrograde(jday, 4):
|
|
106
|
+
print("Mars is retrograde")
|
|
107
|
+
else:
|
|
108
|
+
print("Mars is direct")
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
#### Calculate all aspects for a given day
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
import ketu
|
|
115
|
+
|
|
116
|
+
aspects_data = ketu.calculate_aspects(jday)
|
|
117
|
+
|
|
118
|
+
for aspect in aspects_data:
|
|
119
|
+
body1, body2, i_asp, orb = aspect
|
|
120
|
+
print(f"{ketu.body_name(body1)} - {ketu.body_name(body2)}: "
|
|
121
|
+
f"{ketu.aspects['name'][i_asp].decode()} (orb: {orb:.2f}°)")
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## 📚 Documentation
|
|
125
|
+
|
|
126
|
+
The full documentation is hosted on [Read the Docs](https://ketu.readthedocs.io) (French by default, English via the language toggle).
|
|
127
|
+
|
|
128
|
+
Included sections:
|
|
129
|
+
|
|
130
|
+
- **Installation**: detailed setup instructions
|
|
131
|
+
- **Quickstart**: guided tour of the basics
|
|
132
|
+
- **Concepts**: astrological and astronomical background
|
|
133
|
+
- **API Reference**: all functions documented
|
|
134
|
+
- **Examples**: advanced usage patterns
|
|
135
|
+
|
|
136
|
+
## 🛠️ Requirements
|
|
137
|
+
|
|
138
|
+
- Python 3.10 or higher
|
|
139
|
+
- `numpy` ≥ 1.20.0 — numerical routines and arrays
|
|
140
|
+
- `pyswisseph` ≥ 2.10.0 — Swiss Ephemeris bindings
|
|
141
|
+
|
|
142
|
+
> The dependency on `pyswisseph` is scheduled for removal in a future release, replaced by pure NumPy implementation.
|
|
143
|
+
|
|
144
|
+
## 📋 Supported bodies
|
|
145
|
+
|
|
146
|
+
| Body | ID | Orb | Average speed (°/day) |
|
|
147
|
+
|------|----|-----|-----------------------|
|
|
148
|
+
| Sun | 0 | 12° | 0.986 |
|
|
149
|
+
| Moon | 1 | 12° | 13.176 |
|
|
150
|
+
| Mercury | 2 | 8° | 1.383 |
|
|
151
|
+
| Venus | 3 | 10° | 1.200 |
|
|
152
|
+
| Mars | 4 | 8° | 0.524 |
|
|
153
|
+
| Jupiter | 5 | 10° | 0.083 |
|
|
154
|
+
| Saturn | 6 | 10° | 0.034 |
|
|
155
|
+
| Uranus | 7 | 6° | 0.012 |
|
|
156
|
+
| Neptune | 8 | 6° | 0.007 |
|
|
157
|
+
| Pluto | 9 | 4° | 0.004 |
|
|
158
|
+
| Rahu (Mean Node) | 10 | 0° | -0.013 |
|
|
159
|
+
| True North Node | 11 | 0° | -0.013 |
|
|
160
|
+
| Lilith (Black Moon) | 12 | 0° | -0.113 |
|
|
161
|
+
|
|
162
|
+
## 🎯 Supported aspects
|
|
163
|
+
|
|
164
|
+
| Aspect | Angle | Orb coefficient |
|
|
165
|
+
|--------|-------|-------------------|
|
|
166
|
+
| Conjunction | 0° | 1 |
|
|
167
|
+
| Semi-sextile | 30° | 1/6 |
|
|
168
|
+
| Sextile | 60° | 1/3 |
|
|
169
|
+
| Square | 90° | 1/2 |
|
|
170
|
+
| Trine | 120° | 2/3 |
|
|
171
|
+
| Quincunx | 150° | 5/6 |
|
|
172
|
+
| Opposition | 180° | 1 |
|
|
173
|
+
|
|
174
|
+
## 🗺️ Roadmap
|
|
175
|
+
|
|
176
|
+
- [ ] Removal of dependency on pyswisseph
|
|
177
|
+
- [ ] Pure numpy implementation of planetary calculations
|
|
178
|
+
- [ ] Search for exact aspects between two dates
|
|
179
|
+
- [ ] Generation of aspect calendars
|
|
180
|
+
- [ ] API for progressions and directions
|
|
181
|
+
- [ ] Support for more celestial bodies (asteroids, etc.)
|
|
182
|
+
|
|
183
|
+
## 🤝 Contribution
|
|
184
|
+
|
|
185
|
+
Contributions are welcome! Feel free to:
|
|
186
|
+
|
|
187
|
+
- Open an issue to report a bug or suggest a feature
|
|
188
|
+
- Submit a pull request
|
|
189
|
+
- Improve the documentation
|
|
190
|
+
|
|
191
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for more details.
|
|
192
|
+
|
|
193
|
+
## 📄 License
|
|
194
|
+
|
|
195
|
+
This project is licensed under MIT. See the [LICENSE](LICENSE) file for more details.
|
|
196
|
+
|
|
197
|
+
## 📧 Contact
|
|
198
|
+
|
|
199
|
+
Loc Cosnier - [@alkimya](https://github.com/alkimya)
|
|
200
|
+
|
|
201
|
+
Project: [https://github.com/alkimya/ketu](https://github.com/alkimya/ketu)
|
|
202
|
+
|
|
203
|
+
Translated with DeepL.com (free version)
|