auqat-e-salah 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.
@@ -0,0 +1,31 @@
1
+ # Commercial Software License & End User License Agreement (EULA)
2
+
3
+ Copyright (c) 2026 Uv Techsoft® (IMAM MOHAMMADUVESH NAZIRAHMED). All rights reserved.
4
+
5
+ This software package (`auqat-e-salah`), including its source code, documentation, and related materials (collectively, the "Software"), is proprietary to **Uv Techsoft®** ("Licensor").
6
+
7
+ ## 1. Grant of License
8
+ Subject to your active, paid API subscription and full compliance with Uv Techsoft®'s terms and conditions (available at `https://auqatesalah.uv-techsoft.com`), Licensor grants you a limited, non-exclusive, non-transferable, revocable license to install and use the Software solely as a client SDK to connect to Licensor's authorized Auqat-e-Salah backend API using a valid API key issued to you.
9
+
10
+ ## 2. Restrictions
11
+ Unless expressly authorized in writing by Uv Techsoft®, you may NOT:
12
+ * Use the Software without an active paid subscription and a valid API key obtained via `contact@uv-techsoft.com` or `https://auqatesalah.uv-techsoft.com`.
13
+ * Copy, modify, adapt, translate, or create derivative works based on the Software.
14
+ * Redistribute, sublicense, rent, lease, sell, or otherwise make the Software available to any third party.
15
+ * Reverse engineer, decompile, disassemble, or attempt to bypass API authentication, rate-limiting, or billing mechanisms.
16
+ * Remove, alter, or obscure any copyright (`© 2026 Uv Techsoft®`), trademark, or proprietary notices in the Software.
17
+
18
+ ## 3. Intellectual Property
19
+ The Software is licensed, not sold. Uv Techsoft® retains all right, title, and interest in and to the Software, its underlying astronomical calculation APIs, and all related intellectual property rights.
20
+
21
+ ## 4. Termination
22
+ This license automatically terminates without notice if you fail to comply with any term of this agreement or if your paid API subscription expires or is canceled. Upon termination, you must immediately cease all use of the Software and destroy all copies in your possession.
23
+
24
+ ## 5. Disclaimer of Warranty & Limitation of Liability
25
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL UV TECHSOFT® OR IMAM MOHAMMADUVESH NAZIRAHMED BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF THE SOFTWARE.
26
+
27
+ ## 6. Contact & Licensing Inquiries
28
+ For API key purchases, commercial licensing, or support, contact:
29
+ * **Website:** https://auqatesalah.uv-techsoft.com
30
+ * **Email:** contact@uv-techsoft.com
31
+ * **LinkedIn:** [Uvesh Imam](https://www.linkedin.com/in/uvesh-imam-390bb1160)
@@ -0,0 +1,2 @@
1
+ include LICENSE.md
2
+ include README.md
@@ -0,0 +1,145 @@
1
+ Metadata-Version: 2.4
2
+ Name: auqat-e-salah
3
+ Version: 1.0.0
4
+ Summary: Auqat-e-Salah an Official Islamic Prayer Times Python SDK by Uv Techsoft. Provides Most Accurate Second Wise Namaz/Prayer/Salah Start & End times schedules, Makrooh time windows, ground elevation adjustments, and Hanafi & Shafi'i Fiqh calculation methods.
5
+ Author-email: "IMAM MOHAMMADUVESH NAZIRAHMED (Uv Techsoft)" <contact@uv-techsoft.com>
6
+ License-Expression: LicenseRef-Proprietary
7
+ Project-URL: Homepage, https://auqatesalah.uv-techsoft.com
8
+ Project-URL: Documentation, https://auqatesalah.uv-techsoft.com/docs
9
+ Project-URL: Support, https://auqatesalah.uv-techsoft.com
10
+ Project-URL: Company, https://www.uv-techsoft.com
11
+ Keywords: prayer-times,islamic-prayer-times,adhan,namaz,salah,auqat-e-salah,uv-techsoft,islamic-api,prayer-times-sdk,prayer-times-api,rest-api,hanafi,shafi,makrooh-time,astronomical-prayer-times,azan-api,auqat-e-salah-api,SALAH-LIVE
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3 :: Only
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Topic :: Scientific/Engineering :: Astronomy
16
+ Classifier: Topic :: Religion
17
+ Requires-Python: >=3.8
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE.md
20
+ Dynamic: license-file
21
+
22
+ # auqat-e-salah — Official Islamic Prayer Times Python SDK
23
+
24
+ Official Python SDK for **[Auqat-e-Salah](https://auqatesalah.uv-techsoft.com)** by **[Uv Techsoft®](https://www.uv-techsoft.com)**. Built with zero external dependencies (pure Python standard library), this lightweight REST SDK delivers exact-second astronomical Islamic prayer times across **all 19 daily timings**, Namaz/Salah Start and End Timing schedules, Makrooh time (prohibited prayer window) data, and ground elevation adjustments in a single REST API request.
25
+
26
+ ---
27
+
28
+ ## Key Features
29
+ * **Single-Request Efficiency:** Fetch the entire day's exact-second schedule (all 19 timings) in one lightweight HTTPS REST API call—ideal for backend servers, Django/FastAPI apps, Raspberry Pi mosque displays, and IoT Adhan clocks with minimal bandwidth usage.
30
+ * **Complete 19 Daily Timings (Sub-Second Precision):** Calculates Fajr (1-Hour Early / Sehri), Fajr Start, Fajr End / Sunrise, Start Performing Namaz, Ishraq & Chasht Start, Chasht (Duha Prime), Dahwa-E-Kubra, Zawal Prohibited Start, Zuhr Starts (Solar Noon), Zuhr End, Asar Starts, Asr Karahat Warning, Asr End, Maghrib Starts / Sunset, Maghrib End, Isha Starts, Isha End, Nisf al-Layl (Midnight), and Tahajjud Start (Last Third) using live coordinates and ground elevation (`elevation_meters` / `elevation_feet`).
31
+ * **Jurisprudence (Fiqh) Support:** Supports **Hanafi (Mithl 2)** and **Shafi'i (Mithl 1)** calculation methods, plus configurable twilight standards.
32
+ * **Makrooh Time Windows:** Returns exact start and end timestamps for prohibited prayer windows (وقتِ کراہت) including Post-Sunrise, Dahwa-E-Kubra / Zawal, and Asr Karahat.
33
+ * **Auto-Detection & Local Timezone:** Automatically passes the device's system local timezone (`timezone_utc_offset`) and supports coordinate/elevation auto-detection via `auto_detect_and_get_schedule()`.
34
+ * **Strict Single-App Security Binding:** Protects your subscription with Single-App Identity binding (`app_id`, `bundle_id`, or `origin`) and optional HMAC-SHA256 request signing (`api_secret`).
35
+
36
+ ---
37
+
38
+ ## Prerequisites & API Key
39
+ This SDK requires an active **Auqat-e-Salah API Key** and registered **Single-App Identifier** (`app_id` / `bundle_id` / Domain).
40
+ * **Live Demo:** [https://auqatesalah.uv-techsoft.com](https://auqatesalah.uv-techsoft.com)
41
+ * **Request an API Key:** Email [contact@uv-techsoft.com](mailto:contact@uv-techsoft.com)
42
+
43
+ ---
44
+
45
+ ## Installation
46
+ ```bash
47
+ pip install auqat-e-salah
48
+ ```
49
+
50
+ ---
51
+
52
+ ## Quick Start (All 19 Prayer & Event Timings)
53
+ Initialize `AuqatSalahClient` with your API key and registered App ID, then call `get_schedule()` to retrieve all 19 exact-second timings:
54
+
55
+ ```python
56
+ from auqat_e_salah import AuqatSalahClient
57
+
58
+ client = AuqatSalahClient(
59
+ api_key="as_live_YOUR_API_KEY",
60
+ app_id="com.yourcompany.app" # Single-App ID lock (Android package, iOS bundle ID, or Web domain)
61
+ )
62
+
63
+ # Fetch Exact-Second Prayer Times (All 19 Timings)
64
+ response = client.get_schedule(
65
+ latitude=21.42383,
66
+ longitude=39.82533,
67
+ elevation_meters=277, # Or use elevation_feet=908.8
68
+ school="Hanafi" # 'Hanafi' or 'Shafi'
69
+ )
70
+
71
+ # Access all 19 individual timings via response['schedule']
72
+ sched = response["schedule"]
73
+ print("1. Fajr (1-Hour Early / Sehri):", sched["fajr_early_1h"]["hms_12"])
74
+ print("2. Fajr Start:", sched["fajr_start"]["hms_12"])
75
+ print("3. Fajr End / Sunrise:", sched["sunrise"]["hms_12"])
76
+ print("4. Start Performing Namaz:", sched["prohibited_post_sunrise_end"]["hms_12"])
77
+ print("5. Ishraq & Chasht Start:", sched["ishraq_start"]["hms_12"])
78
+ print("6. Chasht (Duha Prime):", sched["chasht_start"]["hms_12"])
79
+ print("7. Dahwa-E-Kubra:", sched["dahwa_kubra"]["hms_12"])
80
+ print("8. Zawal Prohibited Start:", sched["zawal_prohibited_start"]["hms_12"])
81
+ print("9. Zuhr Starts (Solar Noon):", sched["zuhr_start"]["hms_12"])
82
+ print("10. Zuhr End:", sched["zuhr_end"]["hms_12"])
83
+ print("11. Asar Starts:", sched["asr_start"]["hms_12"])
84
+ print("12. Asr Karahat Warning:", sched["asr_karahat_warning"]["hms_12"])
85
+ print("13. Asr End:", sched["asr_end"]["hms_12"])
86
+ print("14. Maghrib Starts / Sunset:", sched["maghrib_start"]["hms_12"])
87
+ print("15. Maghrib End:", sched["maghrib_end"]["hms_12"])
88
+ print("16. Isha Starts:", sched["isha_start"]["hms_12"])
89
+ print("17. Isha End:", sched["isha_end"]["hms_12"])
90
+ print("18. Nisf al-Layl (Midnight):", sched["nisf_al_layl"]["hms_12"])
91
+ print("19. Tahajjud Start (Last Third):",sched["thuluth_al_layl_tahajjud"]["hms_12"])
92
+
93
+ # Or iterate through all 19 formatted timing objects in order:
94
+ for index, item in enumerate(response["timings"], start=1):
95
+ print(f"{index}. {item['name']} ({item['arabic_name']}): {item['time_12']}")
96
+ ```
97
+
98
+ ### Auto-Detect Device Location, Elevation & Live Makrooh Check
99
+ ```python
100
+ # Auto-detect location, ground elevation, and local timezone
101
+ auto_schedule = client.auto_detect_and_get_schedule(school="Hanafi")
102
+ print("Detected Elevation (m):", auto_schedule["location"]["elevation_meters"])
103
+ print("Total Timings:", auto_schedule["total_timings"]) # 19
104
+
105
+ # Check current Makrooh (prohibited prayer window) status
106
+ makrooh = client.get_makrooh_status(
107
+ latitude=21.42383,
108
+ longitude=39.82533
109
+ )
110
+ if makrooh.get("is_makrooh"):
111
+ print(f"⚠️ {makrooh['warning']} (Ends at {makrooh['window_end_12']})")
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Frequently Asked Questions (FAQ)
117
+
118
+ ### How do I get Islamic prayer times in Python, Django, or FastAPI?
119
+ Install `auqat-e-salah` via pip and call `client.get_schedule()` once per day with your coordinates and Fiqh school to retrieve all 19 exact-second timestamps for your application.
120
+
121
+ ### Does `auqat-e-salah` support Hanafi and Shafi'i Asr timings?
122
+ Yes. Pass `school="Hanafi"` (Mithl 2) or `school="Shafi"` (Mithl 1) in `get_schedule()` to compute accurate Asr start times alongside configurable Fajr and Isha twilight angles.
123
+
124
+ ### Does the SDK account for altitude and ground elevation?
125
+ Yes. Passing `elevation_meters` or `elevation_feet` adjusts solar depression angles for horizon dip, ensuring accurate Fajr, Sunrise, and Maghrib timings at higher elevations.
126
+
127
+ ---
128
+
129
+ ## Other Languages & SDKs
130
+ * **JavaScript / TypeScript (npm / yarn):** `npm install @uvtechsoft/auqat-e-salah`
131
+
132
+ ---
133
+
134
+ ## Author & Support
135
+ Developed and maintained by **IMAM MOHAMMADUVESH NAZIRAHMED** at **[Uv Techsoft®](https://www.uv-techsoft.com)**.
136
+
137
+ * **Live Demo:** [https://auqatesalah.uv-techsoft.com](https://auqatesalah.uv-techsoft.com)
138
+ * **Main Brand Website:** [https://www.uv-techsoft.com](https://www.uv-techsoft.com)
139
+ * **API Key & Commercial Support:** [contact@uv-techsoft.com](mailto:contact@uv-techsoft.com)
140
+ * **LinkedIn:** [Uvesh Imam](https://www.linkedin.com/in/uvesh-imam-390bb1160)
141
+
142
+ ---
143
+
144
+ ## License
145
+ Commercial Software License — Copyright © 2026 **Uv Techsoft®** (IMAM MOHAMMADUVESH NAZIRAHMED). All rights reserved. See [LICENSE.md](./LICENSE.md) for full terms.
@@ -0,0 +1,124 @@
1
+ # auqat-e-salah — Official Islamic Prayer Times Python SDK
2
+
3
+ Official Python SDK for **[Auqat-e-Salah](https://auqatesalah.uv-techsoft.com)** by **[Uv Techsoft®](https://www.uv-techsoft.com)**. Built with zero external dependencies (pure Python standard library), this lightweight REST SDK delivers exact-second astronomical Islamic prayer times across **all 19 daily timings**, Namaz/Salah Start and End Timing schedules, Makrooh time (prohibited prayer window) data, and ground elevation adjustments in a single REST API request.
4
+
5
+ ---
6
+
7
+ ## Key Features
8
+ * **Single-Request Efficiency:** Fetch the entire day's exact-second schedule (all 19 timings) in one lightweight HTTPS REST API call—ideal for backend servers, Django/FastAPI apps, Raspberry Pi mosque displays, and IoT Adhan clocks with minimal bandwidth usage.
9
+ * **Complete 19 Daily Timings (Sub-Second Precision):** Calculates Fajr (1-Hour Early / Sehri), Fajr Start, Fajr End / Sunrise, Start Performing Namaz, Ishraq & Chasht Start, Chasht (Duha Prime), Dahwa-E-Kubra, Zawal Prohibited Start, Zuhr Starts (Solar Noon), Zuhr End, Asar Starts, Asr Karahat Warning, Asr End, Maghrib Starts / Sunset, Maghrib End, Isha Starts, Isha End, Nisf al-Layl (Midnight), and Tahajjud Start (Last Third) using live coordinates and ground elevation (`elevation_meters` / `elevation_feet`).
10
+ * **Jurisprudence (Fiqh) Support:** Supports **Hanafi (Mithl 2)** and **Shafi'i (Mithl 1)** calculation methods, plus configurable twilight standards.
11
+ * **Makrooh Time Windows:** Returns exact start and end timestamps for prohibited prayer windows (وقتِ کراہت) including Post-Sunrise, Dahwa-E-Kubra / Zawal, and Asr Karahat.
12
+ * **Auto-Detection & Local Timezone:** Automatically passes the device's system local timezone (`timezone_utc_offset`) and supports coordinate/elevation auto-detection via `auto_detect_and_get_schedule()`.
13
+ * **Strict Single-App Security Binding:** Protects your subscription with Single-App Identity binding (`app_id`, `bundle_id`, or `origin`) and optional HMAC-SHA256 request signing (`api_secret`).
14
+
15
+ ---
16
+
17
+ ## Prerequisites & API Key
18
+ This SDK requires an active **Auqat-e-Salah API Key** and registered **Single-App Identifier** (`app_id` / `bundle_id` / Domain).
19
+ * **Live Demo:** [https://auqatesalah.uv-techsoft.com](https://auqatesalah.uv-techsoft.com)
20
+ * **Request an API Key:** Email [contact@uv-techsoft.com](mailto:contact@uv-techsoft.com)
21
+
22
+ ---
23
+
24
+ ## Installation
25
+ ```bash
26
+ pip install auqat-e-salah
27
+ ```
28
+
29
+ ---
30
+
31
+ ## Quick Start (All 19 Prayer & Event Timings)
32
+ Initialize `AuqatSalahClient` with your API key and registered App ID, then call `get_schedule()` to retrieve all 19 exact-second timings:
33
+
34
+ ```python
35
+ from auqat_e_salah import AuqatSalahClient
36
+
37
+ client = AuqatSalahClient(
38
+ api_key="as_live_YOUR_API_KEY",
39
+ app_id="com.yourcompany.app" # Single-App ID lock (Android package, iOS bundle ID, or Web domain)
40
+ )
41
+
42
+ # Fetch Exact-Second Prayer Times (All 19 Timings)
43
+ response = client.get_schedule(
44
+ latitude=21.42383,
45
+ longitude=39.82533,
46
+ elevation_meters=277, # Or use elevation_feet=908.8
47
+ school="Hanafi" # 'Hanafi' or 'Shafi'
48
+ )
49
+
50
+ # Access all 19 individual timings via response['schedule']
51
+ sched = response["schedule"]
52
+ print("1. Fajr (1-Hour Early / Sehri):", sched["fajr_early_1h"]["hms_12"])
53
+ print("2. Fajr Start:", sched["fajr_start"]["hms_12"])
54
+ print("3. Fajr End / Sunrise:", sched["sunrise"]["hms_12"])
55
+ print("4. Start Performing Namaz:", sched["prohibited_post_sunrise_end"]["hms_12"])
56
+ print("5. Ishraq & Chasht Start:", sched["ishraq_start"]["hms_12"])
57
+ print("6. Chasht (Duha Prime):", sched["chasht_start"]["hms_12"])
58
+ print("7. Dahwa-E-Kubra:", sched["dahwa_kubra"]["hms_12"])
59
+ print("8. Zawal Prohibited Start:", sched["zawal_prohibited_start"]["hms_12"])
60
+ print("9. Zuhr Starts (Solar Noon):", sched["zuhr_start"]["hms_12"])
61
+ print("10. Zuhr End:", sched["zuhr_end"]["hms_12"])
62
+ print("11. Asar Starts:", sched["asr_start"]["hms_12"])
63
+ print("12. Asr Karahat Warning:", sched["asr_karahat_warning"]["hms_12"])
64
+ print("13. Asr End:", sched["asr_end"]["hms_12"])
65
+ print("14. Maghrib Starts / Sunset:", sched["maghrib_start"]["hms_12"])
66
+ print("15. Maghrib End:", sched["maghrib_end"]["hms_12"])
67
+ print("16. Isha Starts:", sched["isha_start"]["hms_12"])
68
+ print("17. Isha End:", sched["isha_end"]["hms_12"])
69
+ print("18. Nisf al-Layl (Midnight):", sched["nisf_al_layl"]["hms_12"])
70
+ print("19. Tahajjud Start (Last Third):",sched["thuluth_al_layl_tahajjud"]["hms_12"])
71
+
72
+ # Or iterate through all 19 formatted timing objects in order:
73
+ for index, item in enumerate(response["timings"], start=1):
74
+ print(f"{index}. {item['name']} ({item['arabic_name']}): {item['time_12']}")
75
+ ```
76
+
77
+ ### Auto-Detect Device Location, Elevation & Live Makrooh Check
78
+ ```python
79
+ # Auto-detect location, ground elevation, and local timezone
80
+ auto_schedule = client.auto_detect_and_get_schedule(school="Hanafi")
81
+ print("Detected Elevation (m):", auto_schedule["location"]["elevation_meters"])
82
+ print("Total Timings:", auto_schedule["total_timings"]) # 19
83
+
84
+ # Check current Makrooh (prohibited prayer window) status
85
+ makrooh = client.get_makrooh_status(
86
+ latitude=21.42383,
87
+ longitude=39.82533
88
+ )
89
+ if makrooh.get("is_makrooh"):
90
+ print(f"⚠️ {makrooh['warning']} (Ends at {makrooh['window_end_12']})")
91
+ ```
92
+
93
+ ---
94
+
95
+ ## Frequently Asked Questions (FAQ)
96
+
97
+ ### How do I get Islamic prayer times in Python, Django, or FastAPI?
98
+ Install `auqat-e-salah` via pip and call `client.get_schedule()` once per day with your coordinates and Fiqh school to retrieve all 19 exact-second timestamps for your application.
99
+
100
+ ### Does `auqat-e-salah` support Hanafi and Shafi'i Asr timings?
101
+ Yes. Pass `school="Hanafi"` (Mithl 2) or `school="Shafi"` (Mithl 1) in `get_schedule()` to compute accurate Asr start times alongside configurable Fajr and Isha twilight angles.
102
+
103
+ ### Does the SDK account for altitude and ground elevation?
104
+ Yes. Passing `elevation_meters` or `elevation_feet` adjusts solar depression angles for horizon dip, ensuring accurate Fajr, Sunrise, and Maghrib timings at higher elevations.
105
+
106
+ ---
107
+
108
+ ## Other Languages & SDKs
109
+ * **JavaScript / TypeScript (npm / yarn):** `npm install @uvtechsoft/auqat-e-salah`
110
+
111
+ ---
112
+
113
+ ## Author & Support
114
+ Developed and maintained by **IMAM MOHAMMADUVESH NAZIRAHMED** at **[Uv Techsoft®](https://www.uv-techsoft.com)**.
115
+
116
+ * **Live Demo:** [https://auqatesalah.uv-techsoft.com](https://auqatesalah.uv-techsoft.com)
117
+ * **Main Brand Website:** [https://www.uv-techsoft.com](https://www.uv-techsoft.com)
118
+ * **API Key & Commercial Support:** [contact@uv-techsoft.com](mailto:contact@uv-techsoft.com)
119
+ * **LinkedIn:** [Uvesh Imam](https://www.linkedin.com/in/uvesh-imam-390bb1160)
120
+
121
+ ---
122
+
123
+ ## License
124
+ Commercial Software License — Copyright © 2026 **Uv Techsoft®** (IMAM MOHAMMADUVESH NAZIRAHMED). All rights reserved. See [LICENSE.md](./LICENSE.md) for full terms.
@@ -0,0 +1,9 @@
1
+ """
2
+ Auqat-e-Salah — Official Python REST Client SDK.
3
+ Enables developers to connect to the Auqat-e-Salah server for high-precision prayer calculations.
4
+ """
5
+
6
+ from .client import AuqatSalahClient, AuqatSalahError
7
+
8
+ __all__ = ["AuqatSalahClient", "AuqatSalahError"]
9
+ __version__ = "1.0.0"
@@ -0,0 +1,229 @@
1
+ """
2
+ Auqat-e-Salah Python API Client.
3
+ Communicates securely with the Auqat-e-Salah core server to receive calculated prayer schedules.
4
+ Contains ZERO secret or proprietary astronomical logic on the client side.
5
+ """
6
+
7
+ import json
8
+ import time
9
+ import hmac
10
+ import hashlib
11
+ from urllib.request import Request, urlopen
12
+ from urllib.error import HTTPError, URLError
13
+ from urllib.parse import urlencode
14
+ from typing import Dict, Any, Optional
15
+ from datetime import datetime
16
+
17
+ def get_system_local_tz_offset() -> float:
18
+ """Return local system UTC offset in decimal hours (e.g. +5.5 for IST, -5.0 for EST)."""
19
+ now = datetime.now().astimezone()
20
+ offset = now.utcoffset()
21
+ return (offset.total_seconds() / 3600.0) if offset else 0.0
22
+
23
+ class AuqatSalahError(Exception):
24
+ def __init__(self, error_code: str, message: str, status_code: int = 400):
25
+ super().__init__(f"[{error_code}] {message}")
26
+ self.error_code = error_code
27
+ self.message = message
28
+ self.status_code = status_code
29
+
30
+ class AuqatSalahClient:
31
+ """
32
+ Official Python Client for Auqat-e-Salah Real-Time Prayer Times Server.
33
+
34
+ Usage:
35
+ client = AuqatSalahClient(
36
+ api_key="as_live_...",
37
+ app_id="com.example.prayerapp" # Must match registered single-app identity
38
+ )
39
+ schedule = client.get_schedule(latitude=21.42383, longitude=39.82533, elevation_meters=277, school="Hanafi")
40
+ """
41
+ def __init__(
42
+ self,
43
+ api_key: str,
44
+ app_id: Optional[str] = None,
45
+ bundle_id: Optional[str] = None,
46
+ origin: Optional[str] = None,
47
+ server_url: str = "https://auqatesalah.uv-techsoft.com",
48
+ api_secret: Optional[str] = None,
49
+ timeout: float = 10.0
50
+ ):
51
+ self.api_key = api_key.strip()
52
+ self.app_id = app_id.strip() if app_id else ""
53
+ self.bundle_id = bundle_id.strip() if bundle_id else ""
54
+ self.origin = origin.strip() if origin else ""
55
+ self.server_url = server_url.rstrip("/")
56
+ self.api_secret = api_secret.strip() if api_secret else None
57
+ self.timeout = timeout
58
+
59
+ def _build_headers(self, raw_body: bytes = b"") -> Dict[str, str]:
60
+ ident = self.app_id or self.bundle_id or self.origin or "client"
61
+ headers = {
62
+ "Content-Type": "application/json",
63
+ "User-Agent": f"AuqatSalahClient-Python/2.0 ({ident})",
64
+ "X-API-Key": self.api_key
65
+ }
66
+ if self.app_id:
67
+ headers["X-App-ID"] = self.app_id
68
+ headers["X-App-Package"] = self.app_id
69
+ if self.bundle_id:
70
+ headers["X-Bundle-ID"] = self.bundle_id
71
+ if not self.app_id:
72
+ headers["X-App-ID"] = self.bundle_id
73
+ if self.origin:
74
+ headers["Origin"] = self.origin
75
+
76
+ if self.api_secret:
77
+ timestamp_str = str(time.time())
78
+ secret_bytes = self.api_secret.encode("utf-8")
79
+ payload = f"{self.api_key}:{timestamp_str}:".encode("utf-8") + raw_body
80
+ sig = hmac.new(secret_bytes, payload, hashlib.sha256).hexdigest()
81
+ headers["X-Timestamp"] = timestamp_str
82
+ headers["X-Signature"] = sig
83
+ return headers
84
+
85
+ def _send_request(self, endpoint: str, method: str = "GET", params: dict = None, body: dict = None) -> Dict[str, Any]:
86
+ url = f"{self.server_url}{endpoint}"
87
+ if params:
88
+ url += f"?{urlencode(params)}"
89
+
90
+ raw_body = json.dumps(body).encode("utf-8") if body else b""
91
+ headers = self._build_headers(raw_body)
92
+
93
+ req = Request(url, data=raw_body if method in ("POST", "PUT") else None, headers=headers, method=method)
94
+ try:
95
+ with urlopen(req, timeout=self.timeout) as resp:
96
+ resp_bytes = resp.read()
97
+ return json.loads(resp_bytes.decode("utf-8"))
98
+ except HTTPError as e:
99
+ err_data = {}
100
+ try:
101
+ err_data = json.loads(e.read().decode("utf-8"))
102
+ except Exception:
103
+ pass
104
+ err_code = err_data.get("error", "HTTP_ERROR")
105
+ err_msg = err_data.get("message", e.reason)
106
+ raise AuqatSalahError(err_code, err_msg, e.code) from e
107
+ except URLError as e:
108
+ raise AuqatSalahError("NETWORK_CONNECTION_ERROR", str(e.reason), 503) from e
109
+
110
+ def get_schedule(
111
+ self,
112
+ latitude: float,
113
+ longitude: float,
114
+ elevation_meters: Optional[float] = None,
115
+ elevation_feet: Optional[float] = None,
116
+ timezone_utc_offset: Optional[float] = None,
117
+ school: str = "Hanafi", # "Hanafi" or "Shafi"
118
+ date_str: Optional[str] = None # "YYYY-MM-DD"
119
+ ) -> Dict[str, Any]:
120
+ """
121
+ Request full prayer schedule calculated down to exact seconds.
122
+ Automatically defaults to user device system local timezone if timezone_utc_offset is omitted.
123
+ """
124
+ tz = timezone_utc_offset if timezone_utc_offset is not None else get_system_local_tz_offset()
125
+ payload = {
126
+ "latitude": latitude,
127
+ "longitude": longitude,
128
+ "timezone_utc_offset": tz,
129
+ "school": school.capitalize()
130
+ }
131
+ if elevation_meters is not None:
132
+ payload["elevation_meters"] = elevation_meters
133
+ if elevation_feet is not None:
134
+ payload["elevation_feet"] = elevation_feet
135
+ if date_str:
136
+ payload["date"] = date_str
137
+
138
+ res = self._send_request("/api/v1/prayertimes/calculate", method="POST", body=payload)
139
+ return res
140
+
141
+ def get_all_timings(
142
+ self,
143
+ latitude: float,
144
+ longitude: float,
145
+ elevation_meters: Optional[float] = None,
146
+ elevation_feet: Optional[float] = None,
147
+ timezone_utc_offset: Optional[float] = None,
148
+ school: str = "Hanafi",
149
+ date_str: Optional[str] = None
150
+ ) -> list:
151
+ """Convenience method returning the 19 prayer & event timings."""
152
+ res = self.get_schedule(
153
+ latitude=latitude,
154
+ longitude=longitude,
155
+ elevation_meters=elevation_meters,
156
+ elevation_feet=elevation_feet,
157
+ timezone_utc_offset=timezone_utc_offset,
158
+ school=school,
159
+ date_str=date_str
160
+ )
161
+ return res.get("timings", [])
162
+
163
+ def auto_detect_and_get_schedule(
164
+ self,
165
+ latitude: Optional[float] = None,
166
+ longitude: Optional[float] = None,
167
+ elevation_meters: Optional[float] = None,
168
+ elevation_feet: Optional[float] = None,
169
+ timezone_utc_offset: Optional[float] = None,
170
+ school: str = "Hanafi",
171
+ date_str: Optional[str] = None
172
+ ) -> Dict[str, Any]:
173
+ """
174
+ Auto-detect user device location & elevation, and return complete prayer schedule
175
+ with all 19 prayer & event timings based on system local timezone.
176
+ """
177
+ tz = timezone_utc_offset if timezone_utc_offset is not None else get_system_local_tz_offset()
178
+ params = {"school": school, "tz": tz}
179
+ if latitude is not None and longitude is not None:
180
+ params["lat"] = latitude
181
+ params["lon"] = longitude
182
+ if elevation_meters is not None:
183
+ params["elevation_meters"] = elevation_meters
184
+ if elevation_feet is not None:
185
+ params["elevation_feet"] = elevation_feet
186
+ if date_str:
187
+ params["date"] = date_str
188
+ return self._send_request("/api/v1/device/detect", method="GET", params=params)
189
+
190
+ def get_live(
191
+ self,
192
+ latitude: float,
193
+ longitude: float,
194
+ elevation_meters: Optional[float] = None,
195
+ elevation_feet: Optional[float] = None,
196
+ timezone_utc_offset: Optional[float] = None,
197
+ school: str = "Hanafi"
198
+ ) -> Dict[str, Any]:
199
+ """Fetch current live status including all 19 timings, active prayer, next prayer countdown, and Makrooh window."""
200
+ tz = timezone_utc_offset if timezone_utc_offset is not None else get_system_local_tz_offset()
201
+ params = {
202
+ "lat": latitude,
203
+ "lon": longitude,
204
+ "tz": tz,
205
+ "school": school
206
+ }
207
+ if elevation_meters is not None:
208
+ params["elevation_meters"] = elevation_meters
209
+ elif elevation_feet is not None:
210
+ params["elevation_feet"] = elevation_feet
211
+ return self._send_request("/api/v1/prayertimes/live", method="GET", params=params)
212
+
213
+ def get_makrooh_status(
214
+ self,
215
+ latitude: float,
216
+ longitude: float,
217
+ timezone_utc_offset: Optional[float] = None
218
+ ) -> Dict[str, Any]:
219
+ """Check if currently inside prohibited prayer window (Sunrise, Dahwa-e-Kubra, Asr Karahat)."""
220
+ tz = timezone_utc_offset if timezone_utc_offset is not None else get_system_local_tz_offset()
221
+ params = {"lat": latitude, "lon": longitude, "tz": tz}
222
+ res = self._send_request("/api/v1/prayertimes/makrooh", method="GET", params=params)
223
+ return res.get("makrooh_status", {})
224
+
225
+ def get_elevation_and_qibla(self, latitude: float, longitude: float) -> Dict[str, Any]:
226
+ """Fetch ground elevation in meters/feet and Qibla distance/bearing."""
227
+ params = {"lat": latitude, "lon": longitude}
228
+ res = self._send_request("/api/v1/elevation", method="GET", params=params)
229
+ return res.get("data", {})
@@ -0,0 +1,145 @@
1
+ Metadata-Version: 2.4
2
+ Name: auqat-e-salah
3
+ Version: 1.0.0
4
+ Summary: Auqat-e-Salah an Official Islamic Prayer Times Python SDK by Uv Techsoft. Provides Most Accurate Second Wise Namaz/Prayer/Salah Start & End times schedules, Makrooh time windows, ground elevation adjustments, and Hanafi & Shafi'i Fiqh calculation methods.
5
+ Author-email: "IMAM MOHAMMADUVESH NAZIRAHMED (Uv Techsoft)" <contact@uv-techsoft.com>
6
+ License-Expression: LicenseRef-Proprietary
7
+ Project-URL: Homepage, https://auqatesalah.uv-techsoft.com
8
+ Project-URL: Documentation, https://auqatesalah.uv-techsoft.com/docs
9
+ Project-URL: Support, https://auqatesalah.uv-techsoft.com
10
+ Project-URL: Company, https://www.uv-techsoft.com
11
+ Keywords: prayer-times,islamic-prayer-times,adhan,namaz,salah,auqat-e-salah,uv-techsoft,islamic-api,prayer-times-sdk,prayer-times-api,rest-api,hanafi,shafi,makrooh-time,astronomical-prayer-times,azan-api,auqat-e-salah-api,SALAH-LIVE
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3 :: Only
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Topic :: Scientific/Engineering :: Astronomy
16
+ Classifier: Topic :: Religion
17
+ Requires-Python: >=3.8
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE.md
20
+ Dynamic: license-file
21
+
22
+ # auqat-e-salah — Official Islamic Prayer Times Python SDK
23
+
24
+ Official Python SDK for **[Auqat-e-Salah](https://auqatesalah.uv-techsoft.com)** by **[Uv Techsoft®](https://www.uv-techsoft.com)**. Built with zero external dependencies (pure Python standard library), this lightweight REST SDK delivers exact-second astronomical Islamic prayer times across **all 19 daily timings**, Namaz/Salah Start and End Timing schedules, Makrooh time (prohibited prayer window) data, and ground elevation adjustments in a single REST API request.
25
+
26
+ ---
27
+
28
+ ## Key Features
29
+ * **Single-Request Efficiency:** Fetch the entire day's exact-second schedule (all 19 timings) in one lightweight HTTPS REST API call—ideal for backend servers, Django/FastAPI apps, Raspberry Pi mosque displays, and IoT Adhan clocks with minimal bandwidth usage.
30
+ * **Complete 19 Daily Timings (Sub-Second Precision):** Calculates Fajr (1-Hour Early / Sehri), Fajr Start, Fajr End / Sunrise, Start Performing Namaz, Ishraq & Chasht Start, Chasht (Duha Prime), Dahwa-E-Kubra, Zawal Prohibited Start, Zuhr Starts (Solar Noon), Zuhr End, Asar Starts, Asr Karahat Warning, Asr End, Maghrib Starts / Sunset, Maghrib End, Isha Starts, Isha End, Nisf al-Layl (Midnight), and Tahajjud Start (Last Third) using live coordinates and ground elevation (`elevation_meters` / `elevation_feet`).
31
+ * **Jurisprudence (Fiqh) Support:** Supports **Hanafi (Mithl 2)** and **Shafi'i (Mithl 1)** calculation methods, plus configurable twilight standards.
32
+ * **Makrooh Time Windows:** Returns exact start and end timestamps for prohibited prayer windows (وقتِ کراہت) including Post-Sunrise, Dahwa-E-Kubra / Zawal, and Asr Karahat.
33
+ * **Auto-Detection & Local Timezone:** Automatically passes the device's system local timezone (`timezone_utc_offset`) and supports coordinate/elevation auto-detection via `auto_detect_and_get_schedule()`.
34
+ * **Strict Single-App Security Binding:** Protects your subscription with Single-App Identity binding (`app_id`, `bundle_id`, or `origin`) and optional HMAC-SHA256 request signing (`api_secret`).
35
+
36
+ ---
37
+
38
+ ## Prerequisites & API Key
39
+ This SDK requires an active **Auqat-e-Salah API Key** and registered **Single-App Identifier** (`app_id` / `bundle_id` / Domain).
40
+ * **Live Demo:** [https://auqatesalah.uv-techsoft.com](https://auqatesalah.uv-techsoft.com)
41
+ * **Request an API Key:** Email [contact@uv-techsoft.com](mailto:contact@uv-techsoft.com)
42
+
43
+ ---
44
+
45
+ ## Installation
46
+ ```bash
47
+ pip install auqat-e-salah
48
+ ```
49
+
50
+ ---
51
+
52
+ ## Quick Start (All 19 Prayer & Event Timings)
53
+ Initialize `AuqatSalahClient` with your API key and registered App ID, then call `get_schedule()` to retrieve all 19 exact-second timings:
54
+
55
+ ```python
56
+ from auqat_e_salah import AuqatSalahClient
57
+
58
+ client = AuqatSalahClient(
59
+ api_key="as_live_YOUR_API_KEY",
60
+ app_id="com.yourcompany.app" # Single-App ID lock (Android package, iOS bundle ID, or Web domain)
61
+ )
62
+
63
+ # Fetch Exact-Second Prayer Times (All 19 Timings)
64
+ response = client.get_schedule(
65
+ latitude=21.42383,
66
+ longitude=39.82533,
67
+ elevation_meters=277, # Or use elevation_feet=908.8
68
+ school="Hanafi" # 'Hanafi' or 'Shafi'
69
+ )
70
+
71
+ # Access all 19 individual timings via response['schedule']
72
+ sched = response["schedule"]
73
+ print("1. Fajr (1-Hour Early / Sehri):", sched["fajr_early_1h"]["hms_12"])
74
+ print("2. Fajr Start:", sched["fajr_start"]["hms_12"])
75
+ print("3. Fajr End / Sunrise:", sched["sunrise"]["hms_12"])
76
+ print("4. Start Performing Namaz:", sched["prohibited_post_sunrise_end"]["hms_12"])
77
+ print("5. Ishraq & Chasht Start:", sched["ishraq_start"]["hms_12"])
78
+ print("6. Chasht (Duha Prime):", sched["chasht_start"]["hms_12"])
79
+ print("7. Dahwa-E-Kubra:", sched["dahwa_kubra"]["hms_12"])
80
+ print("8. Zawal Prohibited Start:", sched["zawal_prohibited_start"]["hms_12"])
81
+ print("9. Zuhr Starts (Solar Noon):", sched["zuhr_start"]["hms_12"])
82
+ print("10. Zuhr End:", sched["zuhr_end"]["hms_12"])
83
+ print("11. Asar Starts:", sched["asr_start"]["hms_12"])
84
+ print("12. Asr Karahat Warning:", sched["asr_karahat_warning"]["hms_12"])
85
+ print("13. Asr End:", sched["asr_end"]["hms_12"])
86
+ print("14. Maghrib Starts / Sunset:", sched["maghrib_start"]["hms_12"])
87
+ print("15. Maghrib End:", sched["maghrib_end"]["hms_12"])
88
+ print("16. Isha Starts:", sched["isha_start"]["hms_12"])
89
+ print("17. Isha End:", sched["isha_end"]["hms_12"])
90
+ print("18. Nisf al-Layl (Midnight):", sched["nisf_al_layl"]["hms_12"])
91
+ print("19. Tahajjud Start (Last Third):",sched["thuluth_al_layl_tahajjud"]["hms_12"])
92
+
93
+ # Or iterate through all 19 formatted timing objects in order:
94
+ for index, item in enumerate(response["timings"], start=1):
95
+ print(f"{index}. {item['name']} ({item['arabic_name']}): {item['time_12']}")
96
+ ```
97
+
98
+ ### Auto-Detect Device Location, Elevation & Live Makrooh Check
99
+ ```python
100
+ # Auto-detect location, ground elevation, and local timezone
101
+ auto_schedule = client.auto_detect_and_get_schedule(school="Hanafi")
102
+ print("Detected Elevation (m):", auto_schedule["location"]["elevation_meters"])
103
+ print("Total Timings:", auto_schedule["total_timings"]) # 19
104
+
105
+ # Check current Makrooh (prohibited prayer window) status
106
+ makrooh = client.get_makrooh_status(
107
+ latitude=21.42383,
108
+ longitude=39.82533
109
+ )
110
+ if makrooh.get("is_makrooh"):
111
+ print(f"⚠️ {makrooh['warning']} (Ends at {makrooh['window_end_12']})")
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Frequently Asked Questions (FAQ)
117
+
118
+ ### How do I get Islamic prayer times in Python, Django, or FastAPI?
119
+ Install `auqat-e-salah` via pip and call `client.get_schedule()` once per day with your coordinates and Fiqh school to retrieve all 19 exact-second timestamps for your application.
120
+
121
+ ### Does `auqat-e-salah` support Hanafi and Shafi'i Asr timings?
122
+ Yes. Pass `school="Hanafi"` (Mithl 2) or `school="Shafi"` (Mithl 1) in `get_schedule()` to compute accurate Asr start times alongside configurable Fajr and Isha twilight angles.
123
+
124
+ ### Does the SDK account for altitude and ground elevation?
125
+ Yes. Passing `elevation_meters` or `elevation_feet` adjusts solar depression angles for horizon dip, ensuring accurate Fajr, Sunrise, and Maghrib timings at higher elevations.
126
+
127
+ ---
128
+
129
+ ## Other Languages & SDKs
130
+ * **JavaScript / TypeScript (npm / yarn):** `npm install @uvtechsoft/auqat-e-salah`
131
+
132
+ ---
133
+
134
+ ## Author & Support
135
+ Developed and maintained by **IMAM MOHAMMADUVESH NAZIRAHMED** at **[Uv Techsoft®](https://www.uv-techsoft.com)**.
136
+
137
+ * **Live Demo:** [https://auqatesalah.uv-techsoft.com](https://auqatesalah.uv-techsoft.com)
138
+ * **Main Brand Website:** [https://www.uv-techsoft.com](https://www.uv-techsoft.com)
139
+ * **API Key & Commercial Support:** [contact@uv-techsoft.com](mailto:contact@uv-techsoft.com)
140
+ * **LinkedIn:** [Uvesh Imam](https://www.linkedin.com/in/uvesh-imam-390bb1160)
141
+
142
+ ---
143
+
144
+ ## License
145
+ Commercial Software License — Copyright © 2026 **Uv Techsoft®** (IMAM MOHAMMADUVESH NAZIRAHMED). All rights reserved. See [LICENSE.md](./LICENSE.md) for full terms.
@@ -0,0 +1,10 @@
1
+ LICENSE.md
2
+ MANIFEST.in
3
+ README.md
4
+ pyproject.toml
5
+ auqat_e_salah/__init__.py
6
+ auqat_e_salah/client.py
7
+ auqat_e_salah.egg-info/PKG-INFO
8
+ auqat_e_salah.egg-info/SOURCES.txt
9
+ auqat_e_salah.egg-info/dependency_links.txt
10
+ auqat_e_salah.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ auqat_e_salah
@@ -0,0 +1,52 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "auqat-e-salah"
7
+ version = "1.0.0"
8
+ description = "Auqat-e-Salah an Official Islamic Prayer Times Python SDK by Uv Techsoft. Provides Most Accurate Second Wise Namaz/Prayer/Salah Start & End times schedules, Makrooh time windows, ground elevation adjustments, and Hanafi & Shafi'i Fiqh calculation methods."
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = "LicenseRef-Proprietary"
12
+ license-files = ["LICENSE.md"]
13
+ authors = [
14
+ { name = "IMAM MOHAMMADUVESH NAZIRAHMED (Uv Techsoft)", email = "contact@uv-techsoft.com" },
15
+ ]
16
+ keywords = [
17
+ "prayer-times",
18
+ "islamic-prayer-times",
19
+ "adhan",
20
+ "namaz",
21
+ "salah",
22
+ "auqat-e-salah",
23
+ "uv-techsoft",
24
+ "islamic-api",
25
+ "prayer-times-sdk",
26
+ "prayer-times-api",
27
+ "rest-api",
28
+ "hanafi",
29
+ "shafi",
30
+ "makrooh-time",
31
+ "astronomical-prayer-times",
32
+ "azan-api",
33
+ "auqat-e-salah-api",
34
+ "SALAH-LIVE",
35
+ ]
36
+ classifiers = [
37
+ "Programming Language :: Python :: 3",
38
+ "Programming Language :: Python :: 3 :: Only",
39
+ "Operating System :: OS Independent",
40
+ "Topic :: Scientific/Engineering :: Astronomy",
41
+ "Topic :: Religion",
42
+ ]
43
+
44
+ [project.urls]
45
+ "Homepage" = "https://auqatesalah.uv-techsoft.com"
46
+ "Documentation" = "https://auqatesalah.uv-techsoft.com/docs"
47
+ "Support" = "https://auqatesalah.uv-techsoft.com"
48
+ "Company" = "https://www.uv-techsoft.com"
49
+
50
+ [tool.setuptools.packages.find]
51
+ where = ["."]
52
+ include = ["auqat_e_salah*"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+