divineapi 1.0.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.
Files changed (31) hide show
  1. divineapi-1.0.0/PKG-INFO +280 -0
  2. divineapi-1.0.0/README.md +255 -0
  3. divineapi-1.0.0/divineapi/__init__.py +137 -0
  4. divineapi-1.0.0/divineapi/calculators.py +33 -0
  5. divineapi-1.0.0/divineapi/client.py +133 -0
  6. divineapi-1.0.0/divineapi/exceptions.py +46 -0
  7. divineapi-1.0.0/divineapi/horoscope.py +226 -0
  8. divineapi-1.0.0/divineapi/indian/__init__.py +17 -0
  9. divineapi-1.0.0/divineapi/indian/festival.py +115 -0
  10. divineapi-1.0.0/divineapi/indian/kundli.py +235 -0
  11. divineapi-1.0.0/divineapi/indian/match_making.py +81 -0
  12. divineapi-1.0.0/divineapi/indian/panchang.py +310 -0
  13. divineapi-1.0.0/divineapi/lifestyle.py +40 -0
  14. divineapi-1.0.0/divineapi/numerology.py +124 -0
  15. divineapi-1.0.0/divineapi/pdf.py +156 -0
  16. divineapi-1.0.0/divineapi/western/__init__.py +23 -0
  17. divineapi-1.0.0/divineapi/western/composite.py +58 -0
  18. divineapi-1.0.0/divineapi/western/natal.py +133 -0
  19. divineapi-1.0.0/divineapi/western/planet_returns.py +61 -0
  20. divineapi-1.0.0/divineapi/western/prenatal.py +41 -0
  21. divineapi-1.0.0/divineapi/western/progressions.py +62 -0
  22. divineapi-1.0.0/divineapi/western/synastry.py +106 -0
  23. divineapi-1.0.0/divineapi/western/transit.py +92 -0
  24. divineapi-1.0.0/divineapi.egg-info/PKG-INFO +280 -0
  25. divineapi-1.0.0/divineapi.egg-info/SOURCES.txt +29 -0
  26. divineapi-1.0.0/divineapi.egg-info/dependency_links.txt +1 -0
  27. divineapi-1.0.0/divineapi.egg-info/requires.txt +1 -0
  28. divineapi-1.0.0/divineapi.egg-info/top_level.txt +1 -0
  29. divineapi-1.0.0/pyproject.toml +39 -0
  30. divineapi-1.0.0/setup.cfg +4 -0
  31. divineapi-1.0.0/setup.py +5 -0
@@ -0,0 +1,280 @@
1
+ Metadata-Version: 2.4
2
+ Name: divineapi
3
+ Version: 1.0.0
4
+ Summary: Official Python SDK for the Divine API - Astrology, Numerology, Tarot & more
5
+ Author-email: Divine API <support@divineapi.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://divineapi.com
8
+ Project-URL: Documentation, https://divineapi.com/docs
9
+ Project-URL: Repository, https://github.com/niceDevelopers/divine-api-python
10
+ Keywords: astrology,horoscope,numerology,tarot,kundli,divineapi
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Requires-Python: >=3.8
23
+ Description-Content-Type: text/markdown
24
+ Requires-Dist: requests>=2.20.0
25
+
26
+ # DivineAPI Python SDK
27
+
28
+ Official Python SDK for the [Divine API](https://divineapi.com) -- Astrology, Horoscopes, Numerology, Tarot, Kundli, and more.
29
+
30
+ ## Installation
31
+
32
+ ```bash
33
+ pip install divineapi
34
+ ```
35
+
36
+ Or install from source:
37
+
38
+ ```bash
39
+ git clone https://github.com/niceDevelopers/divine-api-python.git
40
+ cd divine-api-python
41
+ pip install -e .
42
+ ```
43
+
44
+ ## Quick Start
45
+
46
+ ```python
47
+ from divineapi import DivineApi
48
+
49
+ client = DivineApi(api_key="your-api-key", auth_token="your-bearer-token")
50
+
51
+ # Daily Horoscope
52
+ result = client.horoscope.daily(
53
+ sign="aries", day=10, month=3, year=2024, tzone=5.5
54
+ )
55
+ print(result)
56
+ ```
57
+
58
+ ## API Categories
59
+
60
+ ### Horoscope & Tarot
61
+
62
+ ```python
63
+ # Daily / Weekly / Monthly / Yearly Horoscope
64
+ client.horoscope.daily(sign="aries", day=10, month=3, year=2024, tzone=5.5)
65
+ client.horoscope.weekly(sign="leo", week="thisweek", tzone=5.5)
66
+ client.horoscope.monthly(sign="cancer", month=3, tzone=5.5)
67
+ client.horoscope.yearly(sign="virgo", year=2024, tzone=5.5)
68
+
69
+ # Chinese & Numerology Horoscope
70
+ client.horoscope.chinese(sign="rat", h_day="today", tzone=5.5)
71
+ client.horoscope.numerology(number=7, day=10, month=3, year=2024, tzone=5.5)
72
+
73
+ # Tarot & Readings
74
+ client.horoscope.yes_or_no_tarot()
75
+ client.horoscope.daily_tarot()
76
+ client.horoscope.fortune_cookie()
77
+ client.horoscope.coffee_cup_reading()
78
+ client.horoscope.love_compatibility(sign_1="aries", sign_2="leo")
79
+ ```
80
+
81
+ ### Indian Astrology - Panchang
82
+
83
+ ```python
84
+ # Panchang, Nakshatra, Tithi, Yoga, Karana
85
+ client.indian.panchang.find_panchang(
86
+ day=10, month=3, year=2024,
87
+ place="Delhi", lat=28.6139, lon=77.2090, tzone=5.5
88
+ )
89
+ client.indian.panchang.find_nakshatra(
90
+ day=10, month=3, year=2024,
91
+ place="Mumbai", lat=19.076, lon=72.8777, tzone=5.5
92
+ )
93
+ client.indian.panchang.auspicious_timings(
94
+ day=10, month=3, year=2024,
95
+ place="Delhi", lat=28.6139, lon=77.2090, tzone=5.5
96
+ )
97
+
98
+ # Planetary transits
99
+ client.indian.panchang.grah_gochar(
100
+ planet="jupiter", month=3, year=2024,
101
+ place="Delhi", lat=28.6139, lon=77.2090, tzone=5.5
102
+ )
103
+ ```
104
+
105
+ ### Indian Astrology - Kundli
106
+
107
+ ```python
108
+ birth = dict(
109
+ full_name="John Doe", day=1, month=1, year=1990,
110
+ hour=10, min=30, sec=0, gender="male",
111
+ place="Mumbai", lat=19.076, lon=72.8777, tzone=5.5,
112
+ )
113
+
114
+ client.indian.kundli.basic_astro_details(**birth)
115
+ client.indian.kundli.planetary_positions(**birth)
116
+ client.indian.kundli.manglik_dosha(**birth)
117
+ client.indian.kundli.vimshottari_dasha(**birth)
118
+ client.indian.kundli.sadhe_sati(**birth)
119
+ client.indian.kundli.yogas(**birth)
120
+ client.indian.kundli.horoscope_chart("D1", **birth)
121
+
122
+ # Dasha analysis (no birth data needed)
123
+ client.indian.kundli.maha_dasha_analysis(maha_dasha="Sun")
124
+ ```
125
+
126
+ ### Indian Astrology - Match Making
127
+
128
+ ```python
129
+ client.indian.match_making.ashtakoot_milan(
130
+ p1_full_name="Groom", p1_day=1, p1_month=1, p1_year=1990,
131
+ p1_hour=10, p1_min=0, p1_sec=0, p1_gender="male",
132
+ p1_place="Delhi", p1_lat=28.6, p1_lon=77.2, p1_tzone=5.5,
133
+ p2_full_name="Bride", p2_day=5, p2_month=5, p2_year=1992,
134
+ p2_hour=14, p2_min=0, p2_sec=0, p2_gender="female",
135
+ p2_place="Mumbai", p2_lat=19.07, p2_lon=72.87, p2_tzone=5.5,
136
+ )
137
+ ```
138
+
139
+ ### Indian Astrology - Festivals
140
+
141
+ ```python
142
+ client.indian.festival.chaitra_festivals(
143
+ year=2024, place="Delhi", lat=28.6, lon=77.2, tzone=5.5
144
+ )
145
+ client.indian.festival.english_calendar(
146
+ year=2024, month=3, place="Delhi", lat=28.6, lon=77.2, tzone=5.5
147
+ )
148
+ client.indian.festival.find_festival(
149
+ festival="diwali", year=2024,
150
+ place="Delhi", lat=28.6, lon=77.2, tzone=5.5
151
+ )
152
+ ```
153
+
154
+ ### Western Astrology - Natal
155
+
156
+ ```python
157
+ birth_w = dict(
158
+ full_name="Jane Smith", day=15, month=6, year=1995,
159
+ hour=8, min=0, sec=0, gender="female",
160
+ place="New York", lat=40.7128, lon=-74.0060, tzone=-5.0,
161
+ )
162
+
163
+ client.western.natal.planetary_positions(**birth_w)
164
+ client.western.natal.house_cusps(**birth_w)
165
+ client.western.natal.aspect_table(**birth_w)
166
+ client.western.natal.natal_wheel_chart(**birth_w)
167
+ client.western.natal.natal_insights(**birth_w)
168
+ client.western.natal.dominants(method="traditional", **birth_w)
169
+ ```
170
+
171
+ ### Western Astrology - Synastry
172
+
173
+ ```python
174
+ client.western.synastry.planetary_positions(
175
+ p1_full_name="Person A", p1_day=1, p1_month=1, p1_year=1990,
176
+ p1_hour=10, p1_min=0, p1_sec=0, p1_gender="male",
177
+ p1_place="London", p1_lat=51.5, p1_lon=-0.12, p1_tzone=0,
178
+ p2_full_name="Person B", p2_day=15, p2_month=6, p2_year=1992,
179
+ p2_hour=14, p2_min=0, p2_sec=0, p2_gender="female",
180
+ p2_place="Paris", p2_lat=48.85, p2_lon=2.35, p2_tzone=1,
181
+ )
182
+ client.western.synastry.emotional_compatibility(...)
183
+ ```
184
+
185
+ ### Western Astrology - Transit
186
+
187
+ ```python
188
+ client.western.transit.daily(**birth_w)
189
+ client.western.transit.planet_retrograde(
190
+ planet="mercury", month=3, year=2024,
191
+ place="New York", lat=40.71, lon=-74.0, tzone=-5.0,
192
+ )
193
+ ```
194
+
195
+ ### Numerology
196
+
197
+ ```python
198
+ # Chaldean numerology
199
+ client.numerology.loshu_grid(fname="John", lname="Doe", day=1, month=1, year=1990)
200
+ client.numerology.name_number(fname="John", lname="Doe", day=1, month=1, year=1990)
201
+
202
+ # Core numbers
203
+ client.numerology.core_numbers(
204
+ full_name="John Doe", day=1, month=1, year=1990,
205
+ gender="male", method="pythagorean",
206
+ )
207
+
208
+ # Mobile number analysis
209
+ client.numerology.new_mobile_number(fname="John", lname="Doe", day=1, month=1, year=1990)
210
+ client.numerology.analyze_mobile_number(
211
+ fname="John", lname="Doe", day=1, month=1, year=1990,
212
+ mobile_number="9876543210",
213
+ )
214
+ ```
215
+
216
+ ### Lifestyle
217
+
218
+ ```python
219
+ client.lifestyle.zodiac_gift_guru(sign="aries", h_day="today", tzone=5.5)
220
+ client.lifestyle.beauty_by_the_stars(sign="leo", h_day="today", tzone=5.5)
221
+ client.lifestyle.astro_chic_picks(sign="virgo", h_day="today", tzone=5.5)
222
+ ```
223
+
224
+ ### Calculators
225
+
226
+ ```python
227
+ client.calculators.flames(full_name="John", partner_name="Jane")
228
+ client.calculators.love_calculator(
229
+ your_name="John", partner_name="Jane",
230
+ your_gender="male", partner_gender="female",
231
+ )
232
+ ```
233
+
234
+ ### PDF Reports
235
+
236
+ ```python
237
+ client.pdf.kundali_sampoorna(
238
+ full_name="John", day=1, month=1, year=1990,
239
+ hour=10, min=30, sec=0, gender="male",
240
+ place="Mumbai", lat=19.07, lon=72.87, tzone=5.5,
241
+ company_name="AstroCo", company_url="https://example.com",
242
+ )
243
+ ```
244
+
245
+ ## Error Handling
246
+
247
+ ```python
248
+ from divineapi import DivineApi, AuthenticationError, ValidationError, RateLimitError
249
+
250
+ client = DivineApi(api_key="...", auth_token="...")
251
+
252
+ try:
253
+ result = client.horoscope.daily(sign="aries", day=10, month=3, year=2024, tzone=5.5)
254
+ except AuthenticationError as e:
255
+ print(f"Auth failed: {e}")
256
+ except ValidationError as e:
257
+ print(f"Bad request: {e}")
258
+ except RateLimitError as e:
259
+ print(f"Rate limited: {e}")
260
+ ```
261
+
262
+ ## Context Manager
263
+
264
+ ```python
265
+ with DivineApi(api_key="...", auth_token="...") as client:
266
+ result = client.horoscope.daily(sign="aries", day=10, month=3, year=2024, tzone=5.5)
267
+ ```
268
+
269
+ ## Configuration
270
+
271
+ | Parameter | Default | Description |
272
+ |-----------|---------|-------------|
273
+ | `api_key` | required | Your Divine API key |
274
+ | `auth_token` | required | Bearer token for Authorization header |
275
+ | `timeout` | 30 | Request timeout in seconds |
276
+ | `max_retries` | 2 | Number of retry attempts on failure |
277
+
278
+ ## License
279
+
280
+ MIT
@@ -0,0 +1,255 @@
1
+ # DivineAPI Python SDK
2
+
3
+ Official Python SDK for the [Divine API](https://divineapi.com) -- Astrology, Horoscopes, Numerology, Tarot, Kundli, and more.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install divineapi
9
+ ```
10
+
11
+ Or install from source:
12
+
13
+ ```bash
14
+ git clone https://github.com/niceDevelopers/divine-api-python.git
15
+ cd divine-api-python
16
+ pip install -e .
17
+ ```
18
+
19
+ ## Quick Start
20
+
21
+ ```python
22
+ from divineapi import DivineApi
23
+
24
+ client = DivineApi(api_key="your-api-key", auth_token="your-bearer-token")
25
+
26
+ # Daily Horoscope
27
+ result = client.horoscope.daily(
28
+ sign="aries", day=10, month=3, year=2024, tzone=5.5
29
+ )
30
+ print(result)
31
+ ```
32
+
33
+ ## API Categories
34
+
35
+ ### Horoscope & Tarot
36
+
37
+ ```python
38
+ # Daily / Weekly / Monthly / Yearly Horoscope
39
+ client.horoscope.daily(sign="aries", day=10, month=3, year=2024, tzone=5.5)
40
+ client.horoscope.weekly(sign="leo", week="thisweek", tzone=5.5)
41
+ client.horoscope.monthly(sign="cancer", month=3, tzone=5.5)
42
+ client.horoscope.yearly(sign="virgo", year=2024, tzone=5.5)
43
+
44
+ # Chinese & Numerology Horoscope
45
+ client.horoscope.chinese(sign="rat", h_day="today", tzone=5.5)
46
+ client.horoscope.numerology(number=7, day=10, month=3, year=2024, tzone=5.5)
47
+
48
+ # Tarot & Readings
49
+ client.horoscope.yes_or_no_tarot()
50
+ client.horoscope.daily_tarot()
51
+ client.horoscope.fortune_cookie()
52
+ client.horoscope.coffee_cup_reading()
53
+ client.horoscope.love_compatibility(sign_1="aries", sign_2="leo")
54
+ ```
55
+
56
+ ### Indian Astrology - Panchang
57
+
58
+ ```python
59
+ # Panchang, Nakshatra, Tithi, Yoga, Karana
60
+ client.indian.panchang.find_panchang(
61
+ day=10, month=3, year=2024,
62
+ place="Delhi", lat=28.6139, lon=77.2090, tzone=5.5
63
+ )
64
+ client.indian.panchang.find_nakshatra(
65
+ day=10, month=3, year=2024,
66
+ place="Mumbai", lat=19.076, lon=72.8777, tzone=5.5
67
+ )
68
+ client.indian.panchang.auspicious_timings(
69
+ day=10, month=3, year=2024,
70
+ place="Delhi", lat=28.6139, lon=77.2090, tzone=5.5
71
+ )
72
+
73
+ # Planetary transits
74
+ client.indian.panchang.grah_gochar(
75
+ planet="jupiter", month=3, year=2024,
76
+ place="Delhi", lat=28.6139, lon=77.2090, tzone=5.5
77
+ )
78
+ ```
79
+
80
+ ### Indian Astrology - Kundli
81
+
82
+ ```python
83
+ birth = dict(
84
+ full_name="John Doe", day=1, month=1, year=1990,
85
+ hour=10, min=30, sec=0, gender="male",
86
+ place="Mumbai", lat=19.076, lon=72.8777, tzone=5.5,
87
+ )
88
+
89
+ client.indian.kundli.basic_astro_details(**birth)
90
+ client.indian.kundli.planetary_positions(**birth)
91
+ client.indian.kundli.manglik_dosha(**birth)
92
+ client.indian.kundli.vimshottari_dasha(**birth)
93
+ client.indian.kundli.sadhe_sati(**birth)
94
+ client.indian.kundli.yogas(**birth)
95
+ client.indian.kundli.horoscope_chart("D1", **birth)
96
+
97
+ # Dasha analysis (no birth data needed)
98
+ client.indian.kundli.maha_dasha_analysis(maha_dasha="Sun")
99
+ ```
100
+
101
+ ### Indian Astrology - Match Making
102
+
103
+ ```python
104
+ client.indian.match_making.ashtakoot_milan(
105
+ p1_full_name="Groom", p1_day=1, p1_month=1, p1_year=1990,
106
+ p1_hour=10, p1_min=0, p1_sec=0, p1_gender="male",
107
+ p1_place="Delhi", p1_lat=28.6, p1_lon=77.2, p1_tzone=5.5,
108
+ p2_full_name="Bride", p2_day=5, p2_month=5, p2_year=1992,
109
+ p2_hour=14, p2_min=0, p2_sec=0, p2_gender="female",
110
+ p2_place="Mumbai", p2_lat=19.07, p2_lon=72.87, p2_tzone=5.5,
111
+ )
112
+ ```
113
+
114
+ ### Indian Astrology - Festivals
115
+
116
+ ```python
117
+ client.indian.festival.chaitra_festivals(
118
+ year=2024, place="Delhi", lat=28.6, lon=77.2, tzone=5.5
119
+ )
120
+ client.indian.festival.english_calendar(
121
+ year=2024, month=3, place="Delhi", lat=28.6, lon=77.2, tzone=5.5
122
+ )
123
+ client.indian.festival.find_festival(
124
+ festival="diwali", year=2024,
125
+ place="Delhi", lat=28.6, lon=77.2, tzone=5.5
126
+ )
127
+ ```
128
+
129
+ ### Western Astrology - Natal
130
+
131
+ ```python
132
+ birth_w = dict(
133
+ full_name="Jane Smith", day=15, month=6, year=1995,
134
+ hour=8, min=0, sec=0, gender="female",
135
+ place="New York", lat=40.7128, lon=-74.0060, tzone=-5.0,
136
+ )
137
+
138
+ client.western.natal.planetary_positions(**birth_w)
139
+ client.western.natal.house_cusps(**birth_w)
140
+ client.western.natal.aspect_table(**birth_w)
141
+ client.western.natal.natal_wheel_chart(**birth_w)
142
+ client.western.natal.natal_insights(**birth_w)
143
+ client.western.natal.dominants(method="traditional", **birth_w)
144
+ ```
145
+
146
+ ### Western Astrology - Synastry
147
+
148
+ ```python
149
+ client.western.synastry.planetary_positions(
150
+ p1_full_name="Person A", p1_day=1, p1_month=1, p1_year=1990,
151
+ p1_hour=10, p1_min=0, p1_sec=0, p1_gender="male",
152
+ p1_place="London", p1_lat=51.5, p1_lon=-0.12, p1_tzone=0,
153
+ p2_full_name="Person B", p2_day=15, p2_month=6, p2_year=1992,
154
+ p2_hour=14, p2_min=0, p2_sec=0, p2_gender="female",
155
+ p2_place="Paris", p2_lat=48.85, p2_lon=2.35, p2_tzone=1,
156
+ )
157
+ client.western.synastry.emotional_compatibility(...)
158
+ ```
159
+
160
+ ### Western Astrology - Transit
161
+
162
+ ```python
163
+ client.western.transit.daily(**birth_w)
164
+ client.western.transit.planet_retrograde(
165
+ planet="mercury", month=3, year=2024,
166
+ place="New York", lat=40.71, lon=-74.0, tzone=-5.0,
167
+ )
168
+ ```
169
+
170
+ ### Numerology
171
+
172
+ ```python
173
+ # Chaldean numerology
174
+ client.numerology.loshu_grid(fname="John", lname="Doe", day=1, month=1, year=1990)
175
+ client.numerology.name_number(fname="John", lname="Doe", day=1, month=1, year=1990)
176
+
177
+ # Core numbers
178
+ client.numerology.core_numbers(
179
+ full_name="John Doe", day=1, month=1, year=1990,
180
+ gender="male", method="pythagorean",
181
+ )
182
+
183
+ # Mobile number analysis
184
+ client.numerology.new_mobile_number(fname="John", lname="Doe", day=1, month=1, year=1990)
185
+ client.numerology.analyze_mobile_number(
186
+ fname="John", lname="Doe", day=1, month=1, year=1990,
187
+ mobile_number="9876543210",
188
+ )
189
+ ```
190
+
191
+ ### Lifestyle
192
+
193
+ ```python
194
+ client.lifestyle.zodiac_gift_guru(sign="aries", h_day="today", tzone=5.5)
195
+ client.lifestyle.beauty_by_the_stars(sign="leo", h_day="today", tzone=5.5)
196
+ client.lifestyle.astro_chic_picks(sign="virgo", h_day="today", tzone=5.5)
197
+ ```
198
+
199
+ ### Calculators
200
+
201
+ ```python
202
+ client.calculators.flames(full_name="John", partner_name="Jane")
203
+ client.calculators.love_calculator(
204
+ your_name="John", partner_name="Jane",
205
+ your_gender="male", partner_gender="female",
206
+ )
207
+ ```
208
+
209
+ ### PDF Reports
210
+
211
+ ```python
212
+ client.pdf.kundali_sampoorna(
213
+ full_name="John", day=1, month=1, year=1990,
214
+ hour=10, min=30, sec=0, gender="male",
215
+ place="Mumbai", lat=19.07, lon=72.87, tzone=5.5,
216
+ company_name="AstroCo", company_url="https://example.com",
217
+ )
218
+ ```
219
+
220
+ ## Error Handling
221
+
222
+ ```python
223
+ from divineapi import DivineApi, AuthenticationError, ValidationError, RateLimitError
224
+
225
+ client = DivineApi(api_key="...", auth_token="...")
226
+
227
+ try:
228
+ result = client.horoscope.daily(sign="aries", day=10, month=3, year=2024, tzone=5.5)
229
+ except AuthenticationError as e:
230
+ print(f"Auth failed: {e}")
231
+ except ValidationError as e:
232
+ print(f"Bad request: {e}")
233
+ except RateLimitError as e:
234
+ print(f"Rate limited: {e}")
235
+ ```
236
+
237
+ ## Context Manager
238
+
239
+ ```python
240
+ with DivineApi(api_key="...", auth_token="...") as client:
241
+ result = client.horoscope.daily(sign="aries", day=10, month=3, year=2024, tzone=5.5)
242
+ ```
243
+
244
+ ## Configuration
245
+
246
+ | Parameter | Default | Description |
247
+ |-----------|---------|-------------|
248
+ | `api_key` | required | Your Divine API key |
249
+ | `auth_token` | required | Bearer token for Authorization header |
250
+ | `timeout` | 30 | Request timeout in seconds |
251
+ | `max_retries` | 2 | Number of retry attempts on failure |
252
+
253
+ ## License
254
+
255
+ MIT
@@ -0,0 +1,137 @@
1
+ """DivineAPI Python SDK.
2
+
3
+ Usage::
4
+
5
+ from divineapi import DivineApi
6
+
7
+ client = DivineApi(api_key="your-api-key", auth_token="your-bearer-token")
8
+ result = client.horoscope.daily(sign="aries", day=10, month=3, year=2024, tzone=5.5)
9
+ print(result)
10
+ """
11
+
12
+ from typing import Any
13
+
14
+ from .calculators import CalculatorApi
15
+ from .client import BaseClient
16
+ from .exceptions import (
17
+ AuthenticationError,
18
+ DivineApiError,
19
+ NetworkError,
20
+ NotFoundError,
21
+ RateLimitError,
22
+ ServerError,
23
+ ValidationError,
24
+ )
25
+ from .horoscope import HoroscopeApi
26
+ from .indian import IndianApi
27
+ from .lifestyle import LifestyleApi
28
+ from .numerology import NumerologyApi
29
+ from .pdf import PdfReportApi
30
+ from .western import WesternApi
31
+
32
+ __version__ = "1.0.0"
33
+
34
+ __all__ = [
35
+ "DivineApi",
36
+ "DivineApiError",
37
+ "AuthenticationError",
38
+ "RateLimitError",
39
+ "ValidationError",
40
+ "NotFoundError",
41
+ "ServerError",
42
+ "NetworkError",
43
+ ]
44
+
45
+
46
+ class DivineApi:
47
+ """Top-level client for the Divine API.
48
+
49
+ Args:
50
+ api_key: Your Divine API key (sent as ``api_key`` in every request body).
51
+ auth_token: Bearer token for the ``Authorization`` header.
52
+ timeout: HTTP request timeout in seconds (default 30).
53
+ max_retries: Number of retry attempts on transient failures (default 2).
54
+
55
+ Example::
56
+
57
+ client = DivineApi(api_key="...", auth_token="...")
58
+
59
+ # Horoscope & Tarot
60
+ client.horoscope.daily(sign="aries", day=10, month=3, year=2024, tzone=5.5)
61
+
62
+ # Indian Panchang
63
+ client.indian.panchang.find_panchang(
64
+ day=10, month=3, year=2024,
65
+ place="Delhi", lat=28.6, lon=77.2, tzone=5.5,
66
+ )
67
+
68
+ # Indian Kundli
69
+ client.indian.kundli.basic_astro_details(
70
+ full_name="John", day=1, month=1, year=1990,
71
+ hour=10, min=30, sec=0, gender="male",
72
+ place="Mumbai", lat=19.07, lon=72.87, tzone=5.5,
73
+ )
74
+
75
+ # Indian Match Making
76
+ client.indian.match_making.ashtakoot_milan(
77
+ p1_full_name="A", p1_day=1, p1_month=1, p1_year=1990,
78
+ p1_hour=10, p1_min=0, p1_sec=0, p1_gender="male",
79
+ p1_place="Delhi", p1_lat=28.6, p1_lon=77.2, p1_tzone=5.5,
80
+ p2_full_name="B", p2_day=5, p2_month=5, p2_year=1992,
81
+ p2_hour=14, p2_min=0, p2_sec=0, p2_gender="female",
82
+ p2_place="Mumbai", p2_lat=19.07, p2_lon=72.87, p2_tzone=5.5,
83
+ )
84
+
85
+ # Western Natal
86
+ client.western.natal.planetary_positions(
87
+ full_name="Jane", day=15, month=6, year=1995,
88
+ hour=8, min=0, sec=0, gender="female",
89
+ place="New York", lat=40.71, lon=-74.0, tzone=-5.0,
90
+ )
91
+
92
+ # Numerology
93
+ client.numerology.core_numbers(
94
+ full_name="John Doe", day=1, month=1, year=1990,
95
+ gender="male", method="pythagorean",
96
+ )
97
+
98
+ # PDF Reports
99
+ client.pdf.kundali_sampoorna(
100
+ full_name="John", day=1, month=1, year=1990,
101
+ hour=10, min=30, sec=0, gender="male",
102
+ place="Mumbai", lat=19.07, lon=72.87, tzone=5.5,
103
+ company_name="MyCompany",
104
+ )
105
+ """
106
+
107
+ def __init__(
108
+ self,
109
+ api_key: str,
110
+ auth_token: str,
111
+ timeout: int = 30,
112
+ max_retries: int = 2,
113
+ ) -> None:
114
+ self._client = BaseClient(
115
+ api_key=api_key,
116
+ auth_token=auth_token,
117
+ timeout=timeout,
118
+ max_retries=max_retries,
119
+ )
120
+
121
+ self.horoscope = HoroscopeApi(self._client)
122
+ self.indian = IndianApi(self._client)
123
+ self.western = WesternApi(self._client)
124
+ self.pdf = PdfReportApi(self._client)
125
+ self.numerology = NumerologyApi(self._client)
126
+ self.lifestyle = LifestyleApi(self._client)
127
+ self.calculators = CalculatorApi(self._client)
128
+
129
+ def close(self) -> None:
130
+ """Close the underlying HTTP session."""
131
+ self._client.close()
132
+
133
+ def __enter__(self) -> "DivineApi":
134
+ return self
135
+
136
+ def __exit__(self, *args: Any) -> None:
137
+ self.close()
@@ -0,0 +1,33 @@
1
+ """Calculator endpoints (astroapi-7)."""
2
+
3
+ from typing import Any, Dict
4
+
5
+ from .client import BaseClient
6
+
7
+ HOST = "astroapi-7"
8
+
9
+
10
+ class CalculatorApi:
11
+ """Fun calculator endpoints (FLAMES, Love Calculator)."""
12
+
13
+ def __init__(self, client: BaseClient) -> None:
14
+ self._c = client
15
+
16
+ def flames(self, full_name: str, partner_name: str) -> Dict[str, Any]:
17
+ """FLAMES Calculator."""
18
+ return self._c.post(HOST, "/calculator/v1/flames-calculator", {
19
+ "full_name": full_name, "partner_name": partner_name,
20
+ })
21
+
22
+ def love_calculator(
23
+ self,
24
+ your_name: str,
25
+ partner_name: str,
26
+ your_gender: str,
27
+ partner_gender: str,
28
+ ) -> Dict[str, Any]:
29
+ """Love Calculator."""
30
+ return self._c.post(HOST, "/calculator/v1/love-calculator", {
31
+ "your_name": your_name, "partner_name": partner_name,
32
+ "your_gender": your_gender, "partner_gender": partner_gender,
33
+ })