Calculate and Generate Athan and Salah Times
Project description
Zero external dependency Athan calculator
A simple Athan calculator with no external dependencies. Calculates prayer times using latitude, longitude, and elevation.
Installation
pip install athantime
Usage
Run it as a CLI tool, see, getathan --help , example:
getathan -e 100 -l 30 -L -100
Use it in a script:
from athantimes import Athan, print_prayer_times
# create Athan object based on user params
prayer = Athan(
elev=100, # Elevation
lat=30, # Latitude
lon=-100 # Longitude
# asr_method=1, # jumhoor = 1. hanafi = 2
# fajr_angle=15,
# isha_angle=15,
)
# calculate athan times
m_times = prayer.calc_times()
# print prayer table
print_prayer_times(m_times)
# figure out next salah time
athan_time, next_salah = prayer.get_next_salah(m_times)
print(f"Next Athan ({next_salah}) will be called @ {athan_time}")
Output:
Fajr: 4:22:55.791533
Shuruq: 5:27:00.491693
Dhur: 11:31:53.542215
Asr: 14:58:52.500350
Maghrib: 17:36:46.592737
Isha: 18:40:51.292898
Next Athan (fajr) will be called @ 2024-09-24 04:23:30
- See
examplesdirectory for additional usage. sched_athan.pyis an example running the library as a background process which execute a command every time an Athan is called. This is useful if you want to play an audio file.
Example Athan Schedule
Assuming there is a shell script which plays audios, a user can play all 5 Athans using this command
python3 examples/sched_athan.py -e 100 -l 30 -L -100
where -e is elevation, -l is longitude, and -L is longitude
This will execute a shell script @ /home/pi/sounds/many.sh whenever it is time for athan.
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
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 athantime-1.0.0.tar.gz.
File metadata
- Download URL: athantime-1.0.0.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f972aec44d320e95072e7d4c076bc7ee69f1f56aeeb2038bbd25deb54a808ba9
|
|
| MD5 |
a1d98d513fce5081cacdc13429fcb523
|
|
| BLAKE2b-256 |
0f76a5b66e4bcfe27f276dbb476192696d703127701d1a74b1c04e423efbae45
|
File details
Details for the file athantime-1.0.0-py3-none-any.whl.
File metadata
- Download URL: athantime-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f67e41dc89aa3861d92e9c5f6bcba01507048ee0315861c36b6e80c93d50edd
|
|
| MD5 |
3463c0f95eae2e4021599b0ce4d25b88
|
|
| BLAKE2b-256 |
858e695d053b10013debfd551b8fca12f446ccf08ab1e9c7a1f5811b24f2ba11
|