Pythonic wrapper for the Aladhan prayer times API.

Overview

aladhan.py is a pythonic wrapper for the Aladhan prayer times API.

PyPI version info Supported Python versions Discord support server Code coverage

Installation

Python 3.6 or higher is required.

To Install aladhan.py with pip:

pip install aladhan.py

To install only with synchronous requirements

pip install aladhan.py[sync]

To install only with asynchronous requirements

pip install aladhan.py[async]

Quick Example

import aladhan

client = aladhan.Client()
prayer_times = client.get_timings_by_address("London")
for prayer_time in prayer_times:
    print(prayer_time)

You can look into more examples here

Contribute

Support

If you are having issues, please let me know by joining the discord support server

License

The project is licensed under the MIT license.

Links

You might also like...
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

PRAW: The Python Reddit API Wrapper PRAW, an acronym for "Python Reddit API Wrapper", is a Python package that allows for simple access to Reddit's AP

Python API wrapper around Trello's API

A wrapper around the Trello API written in Python. Each Trello object is represented by a corresponding Python object. The attributes of these objects

PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

PRAW: The Python Reddit API Wrapper PRAW, an acronym for "Python Reddit API Wrapper", is a Python package that allows for simple access to Reddit's AP

An API wrapper around the pythonanywhere's API.

pyaww An API wrapper around the pythonanywhere's API. The name stands for pythonanywherewrapper. 100% api coverage most of the codebase is documented

Async ready API wrapper for Revolt API written in Python.

Mutiny Async ready API wrapper for Revolt API written in Python. Installation Python 3.9 or higher is required To install the library, you can just ru

An API Wrapper for Gofile API

Gofile2 from gofile2 import Gofile g_a = Gofile() print(g_a.upload(file="/home/itz-fork/photo.png")) An API Wrapper for Gofile API. About API Gofile

A simple API wrapper for the Tenor API

Gifpy A simple API wrapper for the Tenor API Installation Python 3.9 or higher is recommended python3 -m pip install gifpy Clone repository: $ git cl

A Python API wrapper for the Twitter API!

PyTweet PyTweet is an api wrapper made for twitter using twitter's api version 2! Installation Windows py3 -m pip install PyTweet Linux python -m pip

Python API wrapper library for Convex Value API

convex-value-python Python API wrapper library for Convex Value API. Further Links: Convex Value homepage @ConvexValue on Twitter JB on Twitter Authen

Comments
  • [TODO] Undocumented endpoints to cover.

    [TODO] Undocumented endpoints to cover.

    These are undocumented endpoints that need to be covered.

    Info

    • [x] status
    • [x] specialDays
    • [x] islamicMonths

    Date Converters

    • [x] hToG
    • [x] gToH
    • [x] gToHCalendar
    • [x] hToGCalendar
    • [x] islamicYearFromGregorianForRamadan

    Holdays

    • [x] nextHijriHoliday
    • [x] hijriHolidays
    • [x] islamicHolidaysByHijriYear

    Current ...

    • [x] currentTime
    • [x] currentDate
    • [x] currentTimestamp
    • [x] currentIslamicYear
    • [x] currentIslamicMonth

    Next Prayer

    • [x] nextPrayerByAddress
    enhancement 
    opened by HETHAT 1
  • pep8 501 Compliance (80w, 72w for __doc__ and #)

    pep8 501 Compliance (80w, 72w for __doc__ and #)

    Summary

    Hi, I've implemented the pep8 E501 rule into your project, including wrapping the code over 80 characters for better readability. I also wrapped the docstring (excluding docstest) to 72 characters.

    Form Pep8 Python official guide style:

    Limit all lines to a maximum of 79 characters. For flowing long blocks of text with fewer structural restrictions (docstrings or comments), the line length should be limited to 72 characters.

    Limiting the required editor window width makes it possible to have several files open side by side, and works well when using code review tools that present the two versions in adjacent columns.

    The default wrapping in most tools disrupts the visual structure of the code, making it more difficult to understand. The limits are chosen to avoid wrapping in editors with the window width set to 80, even if the tool places a marker glyph in the final column when wrapping lines. Some web based tools may not offer dynamic line wrapping at all.

    Some teams strongly prefer a longer line length. For code maintained exclusively or primarily by a team that can reach agreement on this issue, it is okay to increase the line length limit up to 99 characters, provided that comments and docstrings are still wrapped at 72 characters.

    The Python standard library is conservative and requires limiting lines to 79 characters (and docstrings/comments to 72).

    The preferred way of wrapping long lines is by using Python's implied line continuation inside parentheses, brackets and braces. Long lines can be broken over multiple lines by wrapping expressions in parentheses. These should be used in preference to using a backslash for line continuation.

    I took the time to also fix a minor typo (dictionnary => dictionary) Have a nice day !

    Checklist

    • [ ] If code changes were made then they have been tested.
      • [ ] I have updated the documentation to reflect the changes.
    • [ ] This PR fixes an issue.
    • [ ] This PR adds something new.
    • [ ] This PR is a breaking change.
    • [X] This PR is not a code change (e.g. documentation, README, ...)
    documentation 
    opened by Sigmanificient 1
  • 1 day behind

    1 day behind

    Summary

    The given results are for 1 day behind the date wanted.

    Reproduction Steps

    import aladhan
    
    client = aladhan.Client()
    timings = client.get_timings(34, 4, date=aladhan.TimingsDateArg("01-01-2022"))
    print(timings.asr)
    

    Minimal Reproducible Code

    No response

    Expected Results

    <Prayer name='Asr', time=D'16:11 01-01-2022'>
    

    Actual Results

    <Prayer name='Asr', time=D'16:11 31-12-2021'>
    

    System Information

    - Python v3.8.10-final
    - aladhan.py v1.2.0-final
    - aiohttp v3.7.4.post0
    - requests v2.28.1
    - System info: Linux 5.4.0-77-generic #86-Ubuntu SMP Thu Jun 17 02:35:03 UTC 2021
    

    Checklist

    • [X] I have searched the open issues for duplicates.
    • [X] I have shown the entire traceback, if possible.

    Additional Context

    No response

    bug 
    opened by HETHAT 0
Releases(v1.2.0)
  • v1.2.0(Aug 27, 2022)

    aladhan.py 1.2.0

    Changelog

    Added

    • Covered current event endpoints.
      • Client.get_current_time
      • Client.get_current_date
      • Client.get_current_timestamp
      • Client.get_current_islamic_year
      • Client.get_current_islamic_month
    • Covered holidays endpoints.
      • Client.get_next_hijri_holiday
      • Client.get_hijri_holidays
      • Client.get_islamic_holidays
    • Covered info endpoints
      • Client.get_status
      • Client.get_special_days
      • Client.get_islamic_months
    • Covered next prayer endpoints
      • Client.get_next_prayer_by_address
      • NextPrayerData
    • aladhan.BaseDate
    • aladhan.enums.Shafaq
    • Added a shafaq parameter for Parameters
    • aladhan.exceptions.InvalidShafaq
    • aladhan.exceptions.TooManyRequests
    • Adding the new changes to the api.
      • Timings.first_third
      • Timings.last_third
    • Auto management of rate limits.

    Changed

    • Fixed date converters, they were switched around ...
    • Prayer.data is now Union[Data, NextPrayerData]

    Removed

    • No longer supports Python v3.6.
    • Prayer.timings

    Links

    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Aug 4, 2021)

    aladhan.py 1.1.0

    Changelog

    Added

    • Covering more 5 endpoints about date converting
      • Client.get_hijri_from_gregorian
      • Client.get_gregorian_from_hijri
      • Client.get_hijri_calendar_from_gregorian
      • Client.get_gregorian_calendar_from_hijri
      • Client.get_islamic_year_from_gregorian_for_ramadan

    Changed

    • The following are now optional
      • Date.data
      • Date.readable
      • Date.timestamp

    Links

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Jul 30, 2021)

    aladhan.py 1.0.0

    Changelog

    Added

    • Synchronous usage for the module !
    • __all__ and __slots__ for better performance.
    • Module exceptions.
    • logging is now implemented.
    • Method.params_str a string in "fajr,maghrib,isha" format.

    Changed

    • Renamed DefaultArgs to Parameters
      • Renamed Meta.default_args to Meta.parameters
      • Renamed defaults parameter in all getters to params
    • Timings.next_prayer now returns None instead if upcoming prayer wasn't in date. and Its no longer awaitable.
    • Method.params changed to be a property.
    • Schools, MidnightModes, LatitudeAdjustmentMethods are now enums.

    Removed

    • AsyncClient. Replaced with Client(is_async=True) instead.

    Look into README for more info!

    Links

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Jul 7, 2021)

  • v0.1.4(Jun 10, 2021)

  • v0.1.3(May 7, 2021)

  • v0.1.2(May 2, 2021)

  • v0.1.1(Apr 24, 2021)

  • v0.1.0(Apr 24, 2021)

    aladhan.py 0.1.0

    Whats new?

    • AsyncClient getters no longer return Data object the return now Timings instead, you can still get the Data object using Timings.data.
    • Edited docsstrings to make it more readable.
    • Removed all __str__ methods and replaced it with __repr__.
    • implemented __hash__ to some classes.
    • Added a requirement that i forgot to add. 🤦‍♂️
    • Edited examples so they work for the new release.

    links

    Source code(tar.gz)
    Source code(zip)
  • v0.0.2(Apr 23, 2021)

  • v0.0.1(Apr 23, 2021)

Owner
HETHAT
Just a normal 17 yo guy.
HETHAT
Music bot because Octave is down and I can : )

Chords On a mission to build the best Discord Music Bot View Demo · Report Bug · Request Feature Table of Contents About The Project Built With Gettin

Aman Prakash Jha 53 Jan 07, 2023
Pythonic event-processing library based on decorators

Process Events In Style This library aims to simplify the common pattern of event processing. It simplifies the process of filtering, dispatching and

Nicolas Marier 3 Sep 01, 2022
Bot made with Microsoft Azure' cloud service

IttenWearBot Autori: Antonio Zizzari Simone Giglio IttenWearBot è un bot intelligente dotato di sofisticate tecniche di machile learning che aiuta gli

Antonio Zizzari 1 Jan 24, 2022
This bot automaticaly access to giveaway ! You can won free NFT !

This bot automaticaly access to giveaway ! You can won free NFT !

2s.py 28 Oct 20, 2022
Telegram Remote Administration Tool

Telegram Remote Administration Tool DISCLAIMER | Telegram Remote Administration Tool can only be used at your PC. Do not be evil! Читайте на Русском |

13 Nov 12, 2022
HinamiRobot - Telegram Group Manager Bot Written In Python Using Pyrogram

✨ HINAMI CHAN ✨ Telegram Group Manager Bot Written In Python Using Pyrogram. Rea

DARK LEGEND088 2 Jan 27, 2022
A BOT TO FIND ID OF A STICKER.

sticker id A BOT TO FIND ID OF A STICKER. THIS REPOSITORY HAVE TWO BRANCHES FOR DEPLOY WITH COMMAND & WITHOUT COMMAND. Mandatory variables API_ID - Ge

Ashik Muhammed 3 Dec 29, 2022
Provide fine-grained push access to GitHub from a JupyterHub

github-app-user-auth Provide fine-grained push access to GitHub from a JupyterHub. Goals Allow users on a JupyterHub to grant push access to only spec

Yuvi Panda 20 Sep 13, 2022
A python package that allows you to place automated trades using the TD Ameritrade API.

Template Repo Table of Contents Overview Setup Usage Support These Projects Overview Setup Setup - Requirements Install:* For this particular project,

Alex Reed 4 Jan 25, 2022
A client interface for Scrapinghub's API

Client interface for Scrapinghub API The scrapinghub is a Python library for communicating with the Scrapinghub API. Requirements Python 2.7 or above

Scrapinghub 184 Sep 28, 2022
Implement backup and recovery with AWS Backup across your AWS Organizations using a CI/CD pipeline (AWS CodePipeline).

Backup and Recovery with AWS Backup This repository provides you with a management and deployment solution for implementing Backup and Recovery with A

AWS Samples 8 Nov 22, 2022
This is a small package to interact with the OpenLigaDB API.

OpenLigaDB This is a small package to interact with the OpenLigaDB API. Installation Run the following to install: pip install openligadb Usage from o

1 Dec 31, 2021
Códigos pela Força Bruta e Algoritmo Genético para o Problema da Mochila

O problema da mochila é um problema de optimização combinatória. O nome dá-se devido ao modelo de uma situação em que é necessário preencher uma mochi

Hemili Beatriz 1 Jan 08, 2022
AKShare is an elegant and simple financial data interface library for Python, built for human beings

AKShare is an elegant and simple financial data interface library for Python, built for human beings

AKFamily 5.8k Dec 30, 2022
Scripts to help you win the Pizza Express

Slice of the Prizes Slice of the Prizes is a Python Script designed to enter the "Slice of the Action" competition hosted by Pizza Express the competi

Luke Bendall 1 Nov 04, 2021
A cross-platform script to book first available time for getting a passport in Sweden - Ett skript som automatiskt bokar pass hos polisen

Automatic passport booker - Boka pass automatiskt hos Svenska polisen A cross-platform script to book first available time for getting a passport in S

Elias Floreteng 14 Oct 17, 2022
Bulk convert image types with Python

Bulk Image Converter 🔥 Helper script to convert a folder's worth of images from one filetype to another, and optionally delete originals Use Setup /

1 Nov 13, 2021
SI_EXPLAINER_tg_bot: This bot is an assistant for medical professionals in interpreting the results of patient clustering.

SI_EXPLAINER_tg_bot This bot is an assistant for medical professionals in interpreting the results of patient clustering. ABOUT This chatbot was devel

Alexander Kanonirov 1 Jan 21, 2022
Set of classes and tools to communicate with a Noso wallet using NosoP

NosoPy Set of classes and tools to communicate with a Noso wallet using NosoP(Noso Protocol). The data that can be retrieved consist of: Node informat

Noso Project 1 Jan 10, 2022
DISCORD script to automate sending messages to a particular server

discord discord script This script sends random quotes to an discord server and tags random users on the server in the process MADE WITH LOVE BY SACS

Solomon ogu 1 Nov 06, 2021