Skip to main content

Python library for computing adhan times

Project description

https://travis-ci.org/hayalasalah/adhan.py.svg?branch=master https://img.shields.io/github/license/hayalasalah/adhan.py.svg

adhan.py is a Python 2.7 and 3+ library for computing adhan times.

It is a refactoring of the PrayTimes.org Python adhan calculator that will ensure:

  • PEP8 compliant code

  • A PyPI package

  • A simplified API that favors convention over configuration

  • A test suite

  • Presence on GitHub to encourage contribution

Installation

pip install adhan

Usage

from datetime import date

from adhan import adhan
from adhan.methods import ISNA, ASR_STANDARD

params = {}
params.update(ISNA)
params.update(ASR_STANDARD)

adhan_times = adhan(
    day=date.today(),
    location=(30.25,-97.75),
    parameters=params,
    timezone_offset=-6,
)

"""
adhan_times will be a dict containing datetime objects for the keys 'fajr',
'shuruq', 'zuhr', 'asr', 'maghrib', and 'isha'

"""

Available Methods

The following methods are available in the adhan.methods module and should cover the vast majority of cases

  • ISNA: Islamic Society of North America

  • MUSLIM_WORLD_LEAGUE: Muslim World League

  • EGYPT: Egyptian General Authority of Survey

  • MAKKAH: Umm al-Qura University, Makkah

  • KARACHI: University of Islamic Sciences, Karachi

  • TEHRAN: Institude of Geophysics, University of Tehran

  • SHIA: Shia Ithna Ashari, Leva Research Institute, Qum

  • ASR_STANDARD: Shafi’i, Maliki, Ja’fari, and Hanbali

  • ASR_HANAFI: Hanafi

Custom Parameter Dictionary

In case you want to define your own parameters, the parameters argument accepts dicts with the following keys

  • fajr_angle: The angle below sunrise to compute Fajr for

  • isha_angle: The angle below sunset to compute Isha for

  • asr_multiplier: The multiplier to use for Asr, such that the length of an object’s shadow is the multiplier * the object’s length + the length of the object’s shadow at midday

  • isha_delay: The floating point number of hours after Maghrib that Isha is

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

adhan-0.1.1.tar.gz (6.0 kB view details)

Uploaded Source

File details

Details for the file adhan-0.1.1.tar.gz.

File metadata

  • Download URL: adhan-0.1.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for adhan-0.1.1.tar.gz
Algorithm Hash digest
SHA256 05d6aef77dcf4be4d17dac258bd6c23ad15625f34d695ea0fdf4cdfc08629468
MD5 b10c9ff28c468d7adabfbaf1188894de
BLAKE2b-256 57efb76c5fe56d70eea0dd5062e3a90ce01f4f6698d93a1301d3388554527ebc

See more details on using hashes here.

Supported by

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