Skip to main content

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.

Usage

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 examples directory for additional usage.
  • sched_athan.py is 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

athantime-0.1.2.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

athantime-0.1.2-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file athantime-0.1.2.tar.gz.

File metadata

  • Download URL: athantime-0.1.2.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for athantime-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9b0f23fef85c5a9ff96cda8816635a61910abe528c22879df05f6f8274cb29d9
MD5 f1ea18d1fe9b7bb007726f9d11eec88a
BLAKE2b-256 dc0c253c013e7c493dc12f4abb2e1eb9e8d65725f780f7dec454bd9cfa9a0455

See more details on using hashes here.

File details

Details for the file athantime-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: athantime-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for athantime-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 22b2fe0280df5844005f01a594a0bbf7fd1fc45c4489973cbe8bbefcb6ef8177
MD5 95380925adc14c761e254ebaf3e27e1b
BLAKE2b-256 22f683095f332ef3a555d03375d0b8543475ce1e75ce7e0d775f2d1bb4706b7c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page