hayalasalah / adhan.py

Python library for computing adhan times
GNU Lesser General Public License v3.0
7 stars 1 forks source link

======== adhan.py

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

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:

Installation

.. code:: bash

pip install adhan

Usage

.. code:: python

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

Custom Parameter Dictionary

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