Package: salat
salatOne of the pillars of Islam is salat, which is the act of praying five times a day. Each prayer has a specific time interval, defined in terms of the Sun's position so anyone anywhere in the world can know when it is time to pray.However with modern computation most Muslims use calculated prayer times to determine when to pray instead of watching the Sun. This package performs accurate calculations using orbital dynamics equations instead of common approximations, and native Python tools like datetime to calculate these times.Prayer TimesIn general terms, the time range of a prayer is from it's start until the start of the next prayer, except for Fajr which ends at sunrise. The start of the prayer time intervals are the following:NameStart of Time RangeFajrBeginning of twilightSunriseSunrise. Note that this marks the end of FajrDhuhrWhen the Sun passes its zenithAsrWhen the length of a shadow is the same as the length of the object (or with Hanafi method, twice the length of the object) plus its length when the Sun is at zenithMaghribSunsetIshaWhen the red light of sunset is goneHowever there are various methods and standards for what exact times these general terms correspond to. For example, according to the Muslim World League, Fajr starts when the altitude of the Sun is 18 degrees below the horizon, while the Islamic Society of North America determined it's when the sun is 15 degrees below the horizon.MotivationThere are many websites with prayer time tables and apps that show automatically updating prayer times for your location for each day. However there are not many Python ones, and they either query the websites for time tables or use approximate methods.This package has the following goals:Accurate calculations using exact equations and high precision parameters where possibleUse developer friendly interface including datetimes and typehintsSupport several calculation methodsSupported methodsThis package supports the following calculation methods:ISNA (Islamic Society of North America)MWL (Muslim World League)EGYPT (Egyptian General Authority of Survey)TEHRAN (Institute of Geophysics, University of Tehran)JAFARI (Shia Ithna Ashari, Leva Research Institute, Qum)MAKKAH (Umm al-Qura)KARACHI (University Of Islamic Sciences, Karachi)There are many more methods in use around the world, so if there's any missing that you would like to see please submit an issue.InstallationpipinstallsalatExample codeimportsalatimportdatetimeasdtimportpytzimporttabulate# set up calculation methodspt=salat.PrayerTimes(salat.CalculationMethod.ISNA,salat.AsrMethod.STANDARD)# January 1, 2000date=dt.date(2000,1,1)# using NYClongitude=-74.0060# degrees Eastlatitude=40.7128# degrees Northeastern=pytz.timezone('US/Eastern')# calculate timesprayer_times=pt.calc_times(date,eastern,longitude,latitude)# print in a tabletable=[["Name","Time"]]forname,timeinprayer_times.items():readable_time=time.strftime("%m/%d/%Y, %I:%M:%S %p %Z")table.append([name,readable_time])print(tabulate.tabulate(table,headers='firstrow'))OutputName     Time
-------  ---------------------------
fajr     01/01/2000, 05:58:15 AM EST
sunrise  01/01/2000, 07:20:09 AM EST
dhuhr    01/01/2000, 11:59:25 AM EST
asr      01/01/2000, 02:20:58 PM EST
maghrib  01/01/2000, 04:38:50 PM EST
isha     01/01/2000, 06:00:44 PM ESTPlanned featuresAdjustment for higher altitudesOptions for Isha/Fajr calculation in high altitudes based on "middle of the night" and "sevent of the night" methodsAdd additional calculation methods