prayer_tool
The prayer_tool is an open-source library based on prayertimes.date API. Check their API here
It provides you a complete library to get the prayer times for the day or the whole month.
How to get it ?
The prayer_tool is a python package that you can simply install using the following command
pip install prayer-tool
How to use it ?
To use our library in your code, you need to import it and intialize it, that's all. It's easy !
from prayer_tool import prayer_times
## Intialize an instance of it
instance = prayer_times.PrayerTimes(city="Brussels", school=3, juristic=0)
## Get today's prayer's
today = instance.get_date()
# EXAMPLES
print(f"{today.fajr.name} : {today.fajr.time}")
# fajr : 04:42:00
print(f"{today.dhor.name} : {today.dhor.time}")
# dhor : 13:46:00
Advanced requests
Precise day
You can also get the schedule for a precise day. Code example:
from prayer_tool import prayer_times
import datetime
#Declaring an instance
instance = prayer_times.PrayerTimes()
#The datetime object we need
date = datetime.datetime(year = 2021, month = 8, day = 23)
#Call the function and save the result
result = instance.get_date(date)
print(result.__str__())
##output:
Date : 2021-08-23 00:00:00
fajr : 04:32:00
dhor : 13:45:00
asr : 17:37:00
maghreb : 20:48:00
icha : 22:48:00
Date interval
You are also able to ask for the schedule in a date interval. Code example:
from prayer_tool import prayer_times
import datetime
#Declaring an instance
instance = prayer_times.PrayerTimes(city="Paris")
#The datetime objects we need
start = datetime.datetime(year = 2021, month = 8, day = 23)
end = datetime.datetime(year = 2021, month = 8, day = 26)
#Call the function and save the result
result = instance.get_date(start, end)
for item in result:
print(item.__str__() + "\n")
##output:
Date : 2021-08-23 00:00:00
fajr : 04:32:00
dhor : 13:45:00
asr : 17:37:00
maghreb : 20:48:00
icha : 22:48:00
Date : 2021-08-24 00:00:00
fajr : 04:35:00
dhor : 13:45:00
asr : 17:36:00
maghreb : 20:46:00
icha : 22:45:00
...
Customize the result
The prayers differ from city to city, school to school and so one. That's why the API lets you chose your preferences. Here are the options:
SCHOOL :
Id Name
0 Ithna Ashari
1 University of Islamic Sciences, Karachi
2 Islamic Society of North America
3 Muslim World League (default)
4 Umm Al-Qura University, Mecca
5 Egyptian General Authority of Survey
7 Institute of Geophysics, University of Tehran
8 Morocco
9 Department of Islamic Advancement, Malaysia (JAKIM)
10 Majlis Ugama Islam Singapura
11 Union des Organisations Islamiques de France
12 Turkey
JURISTIC :
Id Juristic
0 Shafii (default)
1 Hanafi
Metadata
Release files for prayer-tool 3.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| prayer_tool-3.2.0.tar.gz | 6.8 kB | Without provenance | Details for prayer_tool-3.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| prayer_tool-3.2.0-py3-none-any.whl | Python 3 | none | any | Details for prayer_tool-3.2.0-py3-none-any.whl |
Total release size: 15.7 kB
Release files / prayer_tool-3.2.0.tar.gz
| Download URL | prayer_tool-3.2.0.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2295c7840b719a54e9b991b5d7acb2e652833bf26ef7d762547db307885dfc79
|
|
BLAKE2b-256 checksum How to use checksums |
7d82907bc4e9f51e8c268a65130049a30989195ddfd8d167e9c7fa8d6615cee3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.8.10
|
Release files / prayer_tool-3.2.0-py3-none-any.whl
| Download URL | prayer_tool-3.2.0-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0713d144e7c3892d676335d363ea9e5e6129abd7839f1fad1a42210f917c5264
|
|
BLAKE2b-256 checksum How to use checksums |
c55b09714acd3f51c5ea5ec0d016dd06b40de8922e6e64a4c84890bec69b8991
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.8.10
|
Security for prayer-tool 3.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.