Reference
Mawaqit
Source code in MawaqitAPI\mawaqit.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
|
__init__(mosque_id, new_data=True, **kwargs)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mosque_id |
str
|
The mosque id of the mosque you want to get the data from. example: "mosque_id" in https://www.mawaqit.net/en/mosque_id |
required |
new_data |
bool
|
OPTIONAL If set to True, the data will be scraped from the website. If set to False, the data will be loaded from the file (default data.json). |
True
|
file_name |
str
|
OPTIONAL The name of the file to save the data in. Defaults to data.json. |
required |
Source code in MawaqitAPI\mawaqit.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
get_data()
Returns:
Name | Type | Description |
---|---|---|
json | The data of the mosque in json format, all available data from the mawaqit website. |
Source code in MawaqitAPI\mawaqit.py
76 77 78 79 80 81 82 83 84 85 86 |
|
get_jumua()
Returns:
Name | Type | Description |
---|---|---|
str | The time of jumua. |
Source code in MawaqitAPI\mawaqit.py
64 65 66 67 68 69 70 71 72 73 74 |
|
get_prayer_time(prayer)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prayer |
str
|
The prayer you want to get the time of. Can be fajr, dhuhr, asr, maghrib or isha. |
required |
Returns:
Name | Type | Description |
---|---|---|
str | The time of the prayer. |
Source code in MawaqitAPI\mawaqit.py
38 39 40 41 42 43 44 45 46 47 48 49 50 |
|
get_prayer_times()
Returns:
Name | Type | Description |
---|---|---|
dict | A dictionary with the prayer times. Fajr, Dhuhr, Asr, Maghrib, Isha |
Source code in MawaqitAPI\mawaqit.py
28 29 30 31 32 33 34 35 36 |
|
get_prayer_times_by_date(date_string)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
date_string |
str
|
The date you want to get the prayer times of, format: dd-mm-yyyy. |
required |
Returns:
Name | Type | Description |
---|---|---|
dict | The prayer times of the date. Fajr, Shurooq, Dhuhr, Asr, Maghrib, Isha. |
Source code in MawaqitAPI\mawaqit.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
get_shurooq()
Returns:
Name | Type | Description |
---|---|---|
str | The time of shurooq. |
Source code in MawaqitAPI\mawaqit.py
52 53 54 55 56 57 58 59 60 61 62 |
|
save_data_to_file(data)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
str
|
The data you want to save to a file. |
required |
Source code in MawaqitAPI\mawaqit.py
132 133 134 135 136 137 138 139 |
|
time_left(prayer)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prayer |
str
|
The prayer you want to get the time left of. Can be fajr, dhuhr, asr, maghrib or isha. In the same day. |
required |
Returns:
Name | Type | Description |
---|---|---|
int | The time left until the prayer in seconds. |
Source code in MawaqitAPI\mawaqit.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|
to_timestamp(date_string)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
date_string |
str
|
The date you want to convert to a timestamp. |
required |
Returns:
Name | Type | Description |
---|---|---|
int | The timestamp of the date. |
Source code in MawaqitAPI\mawaqit.py
88 89 90 91 92 93 94 95 96 97 98 |
|
LocalMawaqit
Source code in MawaqitAPI\localMawaqit.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
__init__(fileName)
Class to interact with the loaded data, without having to scrape the website.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fileName |
str
|
The name of the file that contains the data. |
required |
Source code in MawaqitAPI\localMawaqit.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
get_jumua()
Returns:
Name | Type | Description |
---|---|---|
str | The time of jumua. |
Source code in MawaqitAPI\localMawaqit.py
68 69 70 71 72 73 |
|
get_prayer_time(prayer)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prayer |
str
|
The prayer you want to get the time of. Can be fajr, dhuhr, asr, maghrib or isha. |
required |
Returns:
Name | Type | Description |
---|---|---|
str | The time of the prayer. |
Source code in MawaqitAPI\localMawaqit.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
get_prayer_times()
Returns:
Name | Type | Description |
---|---|---|
dict | A dictionary with the prayer times. |
Source code in MawaqitAPI\localMawaqit.py
28 29 30 31 32 33 |
|
get_prayer_times_by_date(date_string)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
date_string |
str
|
The date you want to get the prayer times of, format: dd-mm-yyyy. |
required |
Returns:
Name | Type | Description |
---|---|---|
dict | The prayer times of the date. |
Source code in MawaqitAPI\localMawaqit.py
75 76 77 78 79 80 81 82 83 84 85 86 |
|
get_shurooq()
Returns:
Name | Type | Description |
---|---|---|
str | The time of shurooq. |
Source code in MawaqitAPI\localMawaqit.py
60 61 62 63 64 65 |
|
Crawler
Crawler class that gets the data from the website.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mosque_id |
str
|
The id of the mosque you want to get the data from. Can be found in the url of the mosque. |
required |
Source code in MawaqitAPI\scraper.py
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
|
get_data()
Get the data from the website.
Returns:
Name | Type | Description |
---|---|---|
json |
json
|
The data from the website. |
Source code in MawaqitAPI\scraper.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|
get_prayer_times_by_date(date)
Get the prayer times for a specific date.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
date |
str
|
The date you want to get the prayer times for. Format: DD-MM-YYYY |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
A dictionary with the prayer times. |
Source code in MawaqitAPI\scraper.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
|
Helper
Source code in MawaqitAPI\helper.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
__init__()
Helper class that contains helper functions. Useful , repetitive functions that are used in multiple places.
Source code in MawaqitAPI\helper.py
7 8 9 10 11 |
|
get_date_from_string(date_string)
Get the date from a string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
date_string |
str
|
The date string. |
required |
Returns:
Name | Type | Description |
---|---|---|
str | The date in the format DD-MM-YYYY. |
Source code in MawaqitAPI\helper.py
13 14 15 16 17 18 19 20 21 22 23 24 |
|