Metadata-Version: 2.5
Name: whatsapp-business-cloud
Version: 0.1.2
Summary: Python client for the WhatsApp Business Platform (Cloud API)
Project-URL: Homepage, https://github.com/pkshahid/wapi
Project-URL: Documentation, https://github.com/pkshahid/wapi#readme
Project-URL: Repository, https://github.com/pkshahid/wapi
Author: whatsapp-business-cloud contributors
License-Expression: MIT
License-File: LICENSE
Keywords: cloud-api,messaging,meta,whatsapp,whatsapp-business
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.7
Requires-Dist: typing-extensions>=4.12; python_version < '3.13'
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: mkdocs-material>=9.5; extra == 'dev'
Requires-Dist: mkdocstrings[python]>=0.26; extra == 'dev'
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Requires-Dist: twine>=5; extra == 'dev'
Provides-Extra: fastapi
Requires-Dist: fastapi>=0.110; extra == 'fastapi'
Description-Content-Type: text/markdown

# whatsapp-business-cloud

A complete, typed Python client for the **WhatsApp Business Platform** (Cloud API +
Business Management API + Flows API).

```python
from whatsapp_business_cloud import Client
from whatsapp_business_cloud.builders import Buttons, Template

client = Client(
    access_token="EAAB...",
    phone_number_id="106540352242922",
    waba_id="102290129340398",
)

# messages
client.messages.send_text(to="15551234567", body="Hello!")
client.messages.send_interactive(to="15551234567", interactive=Buttons()
    .body("Pick one").add("Yes", "y").add("No", "n"))
client.messages.send_template(to="15551234567", template=Template("order_conf", "en_US")
    .body_params("Ana", "1234"))

# media
media = client.media.upload("./invoice.pdf")
client.messages.send_document(to="15551234567", media_id=media.id, filename="invoice.pdf")

# everything else
client.templates.list(status="APPROVED")
client.groups.create(subject="VIP")
client.calls.connect(to="1555...", sdp=offer)
client.flows.publish(flow_id)

# webhooks
from whatsapp_business_cloud.webhooks import parse, verify_signature
events = parse(request.body())

# async
from whatsapp_business_cloud import AsyncClient
async with AsyncClient("EAAB...", phone_number_id="...") as c:
    await c.messages.send_text(to="1555...", body="hi")
```

See `docs/api-reference.md` for the endpoint spec and `docs/plan.md` for the design.

## Install

```bash
pip install -e .          # from this repo
pip install "whatsapp-business-cloud[fastapi]"  # with the webhook router extra
```

## Demo console

`demo/` contains a FastAPI + browser "API console" for exploring every
endpoint against live or mock accounts — see `demo/README.md`.

## Develop

```bash
uv venv .venv && uv pip install --python .venv/bin/python -e ".[dev,fastapi]"
.venv/bin/pytest          # tests
.venv/bin/ruff check src  # lint
.venv/bin/mypy src        # typecheck
```
