The official MAWAQIT Python wrapper.
Project description
MAWAQIT Python Library
السلام عليكم ورحمة الله وبركاته
This is the official Python library to access the MAWAQIT API.
Installation
To use this Python library, you can install it via pip:
pip install mawaqit
Usage
Synchroneous version
TODO : Not made yet.
Asynchroneous version
Here's a simple example (with asyncio) on how to use this library. You can check the async_example.py file to copy this code.
import asyncio
from mawaqit import AsyncMawaqitClient
async def main():
# Initialize the Mawaqit client:
# You can pass the username and password as parameters,
# or directly your valid MAWAQIT API token
# You can also pass your location (latitude and longitude) as parameters to get the nearest mosques
client = AsyncMawaqitClient(
username=USERNAME, password=PASSWORD, longitude=LONGITUDE, latitude=LATITUDE
)
# Get your API token
api_token = await client.get_api_token()
# Get information of the 5 nearest mosques around the given position (long, lat)
mosques = await client.all_mosques_neighborhood()
# Set the mosque to use
client.mosque = mosques[0]["uuid"]
# Fetch the prayer times from client.mosque
print(await client.fetch_prayer_times())
# Get information of the mosques from the specified keyword
mosques = await client.fetch_mosques_by_keyword("test_keyword")
# Set the mosque to use
client.mosque = mosques[0]["uuid"]
# Fetch the prayer times from client.mosque
print(await client.fetch_prayer_times())
await client.close()
if __name__ == "__main__":
asyncio.run(main())
Exceptions
NotAuthenticatedException: Raised when authentication fails.BadCredentialsException: Raised when login credentials are incorrect.NoMosqueAround: Raised when no mosques are found around the specified location.NoMosqueFound: Raised when no mosques are found using the specified keyword.MissingCredentials: Raised when required credentials are not provided.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
If you want to contribute to this project, feel free to fork it and submit a pull request.
You can also open an issue if you find any bug or have any suggestion.
Questions
If you have any question, feel free to contact us at support@mawaqit.net.
May Allah reward you!
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mawaqit-1.0.8.tar.gz.
File metadata
- Download URL: mawaqit-1.0.8.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8539e5cc3921969c1c2891ea150abcfaf7865fd5f05e5a5704668011645a02ba
|
|
| MD5 |
0197c2ad6e56512aa3410fb57b361403
|
|
| BLAKE2b-256 |
788cdd97edb3574a3a92e238ebe09dba4304bbe3a2ee79fb52a1edce8146d003
|
Provenance
The following attestation bundles were made for mawaqit-1.0.8.tar.gz:
Publisher:
python-publish.yml on mawaqit/mawaqit-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mawaqit-1.0.8.tar.gz -
Subject digest:
8539e5cc3921969c1c2891ea150abcfaf7865fd5f05e5a5704668011645a02ba - Sigstore transparency entry: 461107815
- Sigstore integration time:
-
Permalink:
mawaqit/mawaqit-py@7476c2c5a72d99965c6e828dc3fcbd73b5cf9740 -
Branch / Tag:
refs/tags/1.0.8 - Owner: https://github.com/mawaqit
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@7476c2c5a72d99965c6e828dc3fcbd73b5cf9740 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mawaqit-1.0.8-py3-none-any.whl.
File metadata
- Download URL: mawaqit-1.0.8-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6928264408340d0c59b78c08599204d4cd050ec13ff3b42eab7b1d3868899c08
|
|
| MD5 |
fecbefa97b88e17c4a4d5fb1a8b1a3bf
|
|
| BLAKE2b-256 |
5ced408b12287cbc4866e57e3d59271a4414530963790730f7366d159b2a740e
|
Provenance
The following attestation bundles were made for mawaqit-1.0.8-py3-none-any.whl:
Publisher:
python-publish.yml on mawaqit/mawaqit-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mawaqit-1.0.8-py3-none-any.whl -
Subject digest:
6928264408340d0c59b78c08599204d4cd050ec13ff3b42eab7b1d3868899c08 - Sigstore transparency entry: 461107867
- Sigstore integration time:
-
Permalink:
mawaqit/mawaqit-py@7476c2c5a72d99965c6e828dc3fcbd73b5cf9740 -
Branch / Tag:
refs/tags/1.0.8 - Owner: https://github.com/mawaqit
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@7476c2c5a72d99965c6e828dc3fcbd73b5cf9740 -
Trigger Event:
release
-
Statement type: