GithubHelp home page GithubHelp logo

clrsdream / adhan.py Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hayalasalah/adhan.py

0.0 0.0 0.0 40 KB

Python library for computing adhan times

License: GNU Lesser General Public License v3.0

Python 100.00%

adhan.py's Introduction

adhan.py

image

image

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

adhan.py's People

Contributors

zuhairp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.