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
🚀 An asynchronous python API wrapper meant to replace discord.py - Snappy discord api wrapper written with aiohttp & websockets

Pincer An asynchronous python API wrapper meant to replace discord.py ❗ The package is currently within the planning phase ?? Links |Join the discord

Pincer 125 Dec 26, 2022
Demo to explain how to use AWS Chalice to connect to twitter API and change profile picture at scheduled times.

chalice-twitter-demo Demo to explain how to use AWS Chalice to connect to twitter API and change profile picture at scheduled times. Video Demo Click

Ahmed Mohamed 4 Dec 13, 2021
Messing around with GitHub API to look at omicron build times

gh-workflow-runs This is a very simple tool to dump out basic information about workflow runs for a GitHub repo. The structure is based on gh-subscrip

David Pacheco 1 Nov 30, 2021
A Pythonic client for the official https://data.gov.gr API.

pydatagovgr An unofficial Pythonic client for the official data.gov.gr API. Aims to be an easy, intuitive and out-of-the-box way to: find data publish

Ilias Antonopoulos 40 Nov 10, 2022
Aws-lambda-requests-wrapper - Request/Response wrapper for AWS Lambda with API Gateway

AWS Lambda Requests Wrapper Request/Response wrapper for AWS Lambda with API Gat

null 1 May 20, 2022
Chronocalc - Calculates the dates and times when the sun or moon is in a given position in the sky

Chronocalc I wrote this script after I was busy updating my article on chronoloc

null 16 Dec 13, 2022
The successor of GeoSnipe, a pythonic Minecraft username sniper based on AsyncIO.

OneSnipe The successor of GeoSnipe, a pythonic Minecraft username sniper based on AsyncIO. Documentation View Documentation Features • Mojang & Micros

null 1 Jan 14, 2022
Pythonic and easy iCalendar library (rfc5545)

ics.py 0.8.0-dev : iCalendar for Humans Original repository (GitHub) - Bugtracker and issues (GitHub) - PyPi package (ics) - Documentation (Read The D

ics.py 513 Jan 2, 2023
The Main Pythonic Version Of Twig Using Nextcord

The Main Pythonic Version Of Twig Using Nextcord

null 8 Mar 21, 2022
A python package that fetches tweets and user information in a very pythonic manner.

Tweetsy Tweetsy uses Twitter's underlying API to fetch user information and tweets and present it in a human-friendly way. What makes Tweetsy special

Sakirul Alam 5 Nov 12, 2022