You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pray Times is an Islamic project aimed at providing an open-source library for calculating Muslim prayer times.
The first version of Pray Times was released in early 2007. The code is currently used in a wide range of Islamic websites and applications.
🔗 http://praytimes.org/
git clone https://github.com/QuantumPrayerTimes/prayertimes.git
cd prayertimes
python setup.py install
Usage
Available Calculation Methods
Method
Description
MWL
Muslim World League
ISNA
Islamic Society of North America
Egypt
Egyptian General Authority of Survey
Makkah
Umm al-Qura University
Karachi
University of Islamic Sciences, Karachi
Tehran
Institute of Geophysics, University of Tehran
Jafari
Shia Ithna Ashari (Jafari)
UOIF
Union of Islamic Organizations of France
Singapore
Majlis Ugama Islam Singapura
Turkey
Diyanet İşleri Başkanlığı
Using Today's Date
fromprayertimesimportPrayTimesimportdatetimetoday=datetime.datetime.today()
# Using ISNA methodpt=PrayTimes(method='ISNA')
# Get times using UTC offsettimes=pt.get_times(today, (43, -80), -5)
# Or using a timezone stringtimes=pt.get_times(today, (43, -80), "America/New_York")
Using a Specific Date
fromprayertimesimportPrayTimespt=PrayTimes(method='ISNA')
# February 25, 2011 at location (43, -80)times=pt.get_times((2011, 2, 25), (43, -80), -5)
Available Time Formats
Format
Description
Example
24h
24-hour format
16:45
12h
12-hour format with suffix
4:45 pm
12hNS
12-hour format no suffix
4:45
Float
Decimal hours (floating point)
16.75
Changing Time Format
fromprayertimesimportPrayTimespt=PrayTimes('ISNA')
# Set 12-hour formatpt.time_format='12h'times=pt.get_times((2011, 2, 25), (43, -80), -5)
Have suggestions or run into problems?
👉 Open an issue or submit a pull request!
About
Pray Times, an Islamic project aimed at providing an open-source library for calculating Muslim prayers times. This is an improved version PEP8 compliant.