Metadata-Version: 2.4
Name: python-jejakmasjid
Version: 0.3.5
Summary: Asynchronous Python client for the Jejak Masjid API
Author: Zubir Jamal
License: MIT
Project-URL: Homepage, https://github.com/zubirjamal/python-jejakmasjid
Project-URL: Repository, https://github.com/zubirjamal/python-jejakmasjid
Project-URL: Issues, https://github.com/zubirjamal/python-jejakmasjid/issues
Keywords: jejakmasjid,masjid,surau,mosque,prayer,malaysia,home-assistant
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Home Automation
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Intended Audience :: Developers
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.9.0
Provides-Extra: test
Requires-Dist: pytest>=8.0.0; extra == "test"
Requires-Dist: pytest-asyncio>=0.23.0; extra == "test"
Dynamic: license-file

# python-jejakmasjid

Asynchronous Python client library for the Jejak Masjid API.

Used by the Home Assistant Jejak Masjid integration to discover nearby masjids, suraus, and musollas across Malaysia.

## Features

- **Asynchronous**: Built on `aiohttp` for non-blocking I/O.
- **GeoJSON Parsing**: Extracts places, coordinates, place types, and amenities from the Jejak Masjid service.
- **Haversine Distance**: Ranks places by proximity to coordinates.
- **Dedicated Endpoint Ready**: Abstracted client configuration allowing seamless migration when custom endpoints are provided.

## Installation

```bash
pip install python-jejakmasjid
```

## Quick Start

```python
import asyncio
import aiohttp
from jejakmasjid import async_fetch_nearby, rank

async def main():
    async with aiohttp.ClientSession() as session:
        places = await async_fetch_nearby(session, lat=3.02, lon=101.79, radius_km=3)
        ranked = rank(places, lat=3.02, lon=101.79)
        for place in ranked:
            print(f"{place['name']} ({place['type']}) - {place['distance_km']} km")

asyncio.run(main())
```

## CLI Usage

```bash
jejakmasjid --lat 3.02 --lon 101.79 --radius 3
```

## License

MIT
