Accurate prayer times for Muslims by location and date.
Project description
muslim_prayer_time
Accurate prayer times for Muslims by location and date.
Install
pip install muslim_prayer_time
from datetime import date
from muslim_prayer_time import get_prayer_times, get_prayer_times_by_location, get_prayer_times_by_city
# Riyadh example
pt = get_prayer_times(
d=date(2025, 1, 15),
latitude=24.7136,
longitude=46.6753,
timezone=3,
method="MWL",
asr_method="standard",
high_latitude_rule="angle",
altitude=0.0,
)
print(pt)
print(pt.fajr, pt.isha)
# By location name (requires a User-Agent and internet access)
pt2 = get_prayer_times_by_location(
d=date(2025, 1, 15),
location="Riyadh, Saudi Arabia",
timezone=3,
user_agent="muslim_prayer_time/0.4 (your_email@example.com)",
email="your_email@example.com",
)
print(pt2)
# By city name (offline built-in database)
pt3 = get_prayer_times_by_city(
d=date(2025, 1, 15),
city="Riyadh",
country="Saudi Arabia",
method="MWL",
)
print(pt3)
Methods
Supported methods:
MWLISNAEgyptMakkahUmmAlQuraKarachiTehranJafariFranceRussiaSingaporeMoonsighting
High Latitude Rules
anglemidnightone_seventh
Notes
timezoneis the local UTC offset (e.g.,3for UTC+3).altitudeis meters above sea level; it slightly affects sunrise/sunset.Makkah/UmmAlQurause Isha at 90 minutes after Maghrib; you can override viamakkah_isha_offset_minutes(e.g., 120 in Ramadan).TehranIsha angle is not explicitly defined in the source table; this library uses the common 14° default.Moonsightinguses 18°/18° angles here (seasonal adjustments are not included).- Built-in city database uses IANA timezones to account for DST when computing the offset.
العربية
مكتبة دقيقة لحساب مواقيت الصلاة حسب الموقع والتاريخ.
مثال سريع
from datetime import date
from muslim_prayer_time import get_prayer_times
pt = get_prayer_times(
d=date(2025, 1, 15),
latitude=24.7136,
longitude=46.6753,
timezone=3,
method="UmmAlQura",
asr_method="standard",
high_latitude_rule="angle",
altitude=0.0,
makkah_isha_offset_minutes=120, # رمضان
adjustments={"fajr": 2, "isha": -1}, # تعديل بالدقائق
)
print(pt)
استخدام اسم الموقع فقط (Geocoding)
ملاحظة: يلزم توفير
user_agentواضح واحترام حد الطلبات لخدمة Nominatim.
from datetime import date
from muslim_prayer_time import get_prayer_times_by_location
pt = get_prayer_times_by_location(
d=date(2025, 1, 15),
location="Riyadh, Saudi Arabia",
timezone=3,
user_agent="muslim_prayer_time/0.4 (your_email@example.com)",
email="your_email@example.com",
)
print(pt)
استخدام اسم المدينة (بدون إنترنت)
from datetime import date
from muslim_prayer_time import get_prayer_times_by_city, list_cities
print(list_cities()[:10]) # عرض أول 10 مدن
pt = get_prayer_times_by_city(
d=date(2025, 1, 15),
city="الرياض",
country="Saudi Arabia",
method="UmmAlQura",
)
print(pt)
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
muslim_prayer_time-0.6.0.tar.gz
(12.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file muslim_prayer_time-0.6.0.tar.gz.
File metadata
- Download URL: muslim_prayer_time-0.6.0.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da6cb194e6862ab631f4f46f61b18af4f6103dea726373e8a886d39f74c213c3
|
|
| MD5 |
9d70e9930898427389c55bca5658d064
|
|
| BLAKE2b-256 |
fb97ee9d23f1c60c083365af2e327b37eb17ddb0db596ea05ab9391451f9bdef
|
File details
Details for the file muslim_prayer_time-0.6.0-py3-none-any.whl.
File metadata
- Download URL: muslim_prayer_time-0.6.0-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c3ad844b47724de2a77825b9f5fa8acc5665dee4e58d48b3d777d2031a6e17c
|
|
| MD5 |
349680cdf6ad8262212a5b1b757dde4b
|
|
| BLAKE2b-256 |
856b215a8c95b9d356cd64953f7209acefcbbaf606ecb2339e14f64ef14a675b
|