Metadata-Version: 2.5
Name: darak
Version: 0.2.3
Summary: Renamed to kite-sa. This is the final release of darak; install kite-sa instead.
Project-URL: Homepage, https://pypi.org/project/kite-sa/
Project-URL: Documentation, https://platform.kite.sa/docs
Project-URL: Changelog, https://platform.kite.sa/changelog
License-Expression: MIT
License-File: LICENSE
Keywords: api,darak,listings,real-estate,saudi-arabia
Classifier: Development Status :: 7 - Inactive
Classifier: Programming Language :: Python :: 3
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# darak is now kite-sa

**This package is renamed. `darak` 0.2.3 is its final release and gets no further updates.** Darak is now [Kite](https://kite.sa), and the client continues as [`kite-sa`](https://pypi.org/project/kite-sa/):

```bash
pip uninstall darak
pip install kite-sa
```

```python
from kite_sa import Kite, KiteError

kite = Kite()  # reads KITE_API_KEY
```

The API is the same; the class is `Kite` instead of `Darak`, the error is `KiteError`, and the default base URL is `https://api.kite.sa/v1`. Importing `darak` now emits a `DeprecationWarning`. Docs: [platform.kite.sa/docs](https://platform.kite.sa/docs).

---

The original README follows.

## darak (original README)

The official Python client for the [Darak API](https://platform.darak.app/docs): every live rental and sale listing in Saudi Arabia, deduplicated across 20+ sources. Standard library only, Python 3.9+.

```bash
pip install darak
```

```python
from darak import Darak, DarakError

darak = Darak()  # reads DARAK_API_KEY

page = darak.listings.search(city="riyadh", listing_type="rent", beds=3, limit=25)
print(page["data"][0]["price"]["yearly_sar"])

# Every result, fetching pages as you go (stops at your plan's paging depth).
for listing in darak.listings.search_all(city="jeddah", listing_type="sale"):
    print(listing["id"], listing["location"]["neighborhood_name_en"])

try:
    darak.listings.get(1)
except DarakError as e:
    print(e.status, e.code, e.request_id)
```

Get a key at [platform.darak.app](https://platform.darak.app).

- Lists are sent comma-separated: `property_type=["apartment", "villa"]`.
- `429` and `5xx` (and network errors) are retried, honoring `Retry-After`. A monthly-quota `429` isn't waited out; it raises.
- Namespaces, generated from the API's OpenAPI spec so they track it exactly:
  `listings`, `market`, `analytics`, `projects`, `reference`, and
  `organization` (admin keys). `listings.search_all(...)` pages for you by
  following the cursor, and `request(method, path, query, body)` reaches
  anything not yet wrapped.
- `cities.list / neighborhoods / directions` still work; they are the 0.1.0
  names for what is now `reference`.

Tests: `python3 -m unittest discover -s tests`.
