Skip to main content

mawaqit-py

mawaqit-py is a small Python client for mawaqit.net, the platform behind prayer times for 8000+ mosques worldwide. It wraps the public search API and the per-mosque confData blob, so you get clean typed objects for mosques, today's prayer times, iqama offsets, the full-year calendar, and announcements, without manual HTML parsing.

The search endpoint needs no authentication and already embeds today's prayer times in every result. The per-mosque year calendar and announcements are not exposed by the public API, so they are read from the confData blob on each mosque's web page.

Installation

pip install mawaqit-py

For local development:

uv sync
uv run python -m unittest discover -s tests

Quick Start

from mawaqit_py import Mawaqit

with Mawaqit() as client:
    # Search by name or city
    for mosque in client.search("amsterdam"):
        print(mosque.name, mosque.times.prayers, "| Jumua:", mosque.jumua)

    # Nearest mosques to a coordinate
    nearest = client.nearby(48.8566, 2.3522)
    print(nearest[0].name, nearest[0].coordinates)

    # Full-year calendar for a specific mosque (by slug or Mosque object)
    calendar = client.calendar("grande-mosquee-de-paris")
    print("Jul 1:", calendar.day(7, 1).prayers)

    # Announcements
    for notice in client.announcements("grande-mosquee-de-paris"):
        print(notice.title, notice.start_date, "->", notice.end_date)

Prayer times

Each mosque carries today's six clock values in times. Index 1 is sunrise/shuruq, not a prayer, so PrayerTimes keeps it separate:

times = mosque.times
times.fajr, times.sunrise, times.dhuhr, times.asr, times.maghrib, times.isha
times.prayers          # {'fajr': ..., 'dhuhr': ..., 'asr': ..., 'maghrib': ..., 'isha': ...}
mosque.iqama_offsets   # {'fajr': '+10', 'dhuhr': '+10', ...}  minutes after the adhan

API

Mawaqit is the only object you construct. Its public methods:

Method Returns Description
search(word=None, *, lat=None, lon=None, page=1) list[Mosque] Search by text, or by coordinate (nearest first).
nearby(lat, lon, *, page=1) list[Mosque] Convenience wrapper for a coordinate search.
iter_search(word=None, *, lat=None, lon=None, start_page=1, max_pages=None) Iterator[Mosque] Page through results until one comes back empty.
conf_data(mosque, *, lang="en") ConfData The full confData blob: calendar, announcements, events.
calendar(mosque, *, lang="en") Calendar The full-year prayer-time calendar.
announcements(mosque, *, lang="en") list[Announcement] A mosque's current announcements.

mosque arguments accept a Mosque, a slug string, or a full mawaqit.net/{lang}/{slug} URL.

Every value object has .to_dict() (pass include_raw=True to keep the original payload), and the untouched response is always on .raw.

How it works

This library uses two public surfaces of mawaqit.net:

Endpoint Method Purpose
mawaqit.net/api/2.0/mosque/search?word= GET Search mosques by name/city, with today's times embedded.
mawaqit.net/api/2.0/mosque/search?lat=&lon= GET Nearest mosques to a coordinate.
mawaqit.net/{lang}/{slug} GET Mosque web page; embeds a confData JSON blob with the whole year's calendar and announcements.

The per-mosque mobile endpoints (mosque/{uuid}/times, mosque/{uuid}/calendar, favorite, statistic/mosque) live behind an Api-Access-Token and are not used here.

The request transport, browser-fingerprint impersonation, and retry handling are internal details. Normal users only construct Mawaqit() and call the public methods above.

Disclaimer

This is an unofficial library and is not affiliated with, authorized, maintained, sponsored, or endorsed by MAWAQIT or any of its affiliates. Use at your own risk.

This library only accesses publicly available mosque data through mawaqit.net's web API and pages. The APIs are undocumented and may change or break at any time. Please use it responsibly and avoid excessive requests that could burden MAWAQIT's infrastructure.

License

AGPL-3.0

Metadata

Release files for mawaqit-py 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mawaqit-py 0.1.1
File Size Uploaded
mawaqit_py-0.1.1.tar.gz 40.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mawaqit-py 0.1.1
File Interpreter ABI Platform
mawaqit_py-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 67.6 kB

Release files / mawaqit_py-0.1.1.tar.gz

Download URL mawaqit_py-0.1.1.tar.gz
Size 40.0 kB
Tags Source
SHA-256 checksum
How to use checksums
62adc91f3259ccb2de7697e9533cecae43f527038df4d18cf5a65d36b3a945db
BLAKE2b-256 checksum
How to use checksums
d4913a7c1d9038063811fa9bd039ed7dbc187cb730acbe6a9b1d4b3ea30694b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mawaqit_py-0.1.1-py3-none-any.whl

Download URL mawaqit_py-0.1.1-py3-none-any.whl
Size 27.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d38c1aa49847b54c43158451fe2d3da757211d362568f66c04531deb3c4d4632
BLAKE2b-256 checksum
How to use checksums
27357a540762fc6de905c4db9f4aa84a6440880adca48fe5d57116367db48fa3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page