waha-py
Python SDK for WAHA (WhatsApp HTTP API) - auto-generated from OpenAPI spec with full type safety, Pydantic v2 models, and HTTPX-based synchronous & asynchronous clients.
Installation
pip install waha-py
Usage
Synchronous Client
from waha import WahaClient
# Initialize with baseURL and optional API key
client = WahaClient("http://localhost:3000", api_key="your-api-key")
# Access controllers via properties
# Sessions
sessions = client.sessions.list()
# Chatting
message = client.chatting.send_text(
session="default",
payload={
"chatId": "1234567890@c.us",
"text": "Hello from waha-py!",
},
)
# Get QR Code
qr = client.auth.get_qr(session="default", params={"format": "raw"})
# Always close client when done
client.close()
Asynchronous Client
import asyncio
from waha import AsyncWahaClient
async def main():
async_client = AsyncWahaClient("http://localhost:3000", api_key="your-api-key")
# Send message asynchronously
message = await async_client.chatting.a_send_text(
session="default",
payload={
"chatId": "1234567890@c.us",
"text": "Async hello from waha-py!",
},
)
await async_client.close()
asyncio.run(main())
API Controllers
All endpoints are available through client properties:
client.sessions.* # SessionsApi
client.chatting.* # ChattingApi
client.contacts.* # ContactsApi
client.groups.* # GroupsApi
client.auth.* # AuthApi
client.labels.* # LabelsApi
client.presence.* # PresenceApi
client.profile.* # ProfileApi
client.media.* # MediaApi
# ...and more
Pydantic Models
All types are auto-generated from the WAHA OpenAPI specification using Pydantic v2:
from waha.generated.models import SessionInfo, MessageTextRequest, WAMessage
How It Works
This package is automatically kept in sync with WAHA:
- Daily - GitHub Action spins up latest
devlikeapro/wahacontainer - Fetches OpenAPI spec from
/-jsonendpoint - Compares SHA256 hash with committed
openapi.json - If changed - Generates new types + Python clients, bumps version, commits, and pushes tag
- Publishes to PyPI via OIDC trusted publishing
Development
Prerequisites
- Python >= 3.9
- Running WAHA instance (or
openapi.json)
Generate Types & Clients Locally
# Install development dependencies
pip install -e ".[dev]"
# Generate models and clients from openapi.json
python scripts/generate.py
# Run tests
pytest
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file waha_py-2026.8.1.tar.gz.
File metadata
- Download URL: waha_py-2026.8.1.tar.gz
- Upload date:
- Size: 234.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2aba3d96607f30a83f4762dad668af63365ae2d4e0c501dfedb7d6aeaf34165c
|
|
| MD5 |
69c0de6c915b03bc3a7989d14e61ed87
|
|
| BLAKE2b-256 |
a34fc92f1ec4d65d5670590ba44ddaa4714c905de80a174d56be063502a6c300
|
Provenance
The following attestation bundles were made for waha_py-2026.8.1.tar.gz:
Publisher:
publish-trusted.yml on muhammedaksam/waha-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
waha_py-2026.8.1.tar.gz -
Subject digest:
2aba3d96607f30a83f4762dad668af63365ae2d4e0c501dfedb7d6aeaf34165c - Sigstore transparency entry: 2471291106
- Sigstore integration time:
-
Permalink:
muhammedaksam/waha-py@26a714c6de7af9207150cff67c7e82eda944f2b7 -
Branch / Tag:
refs/tags/v2026.8.1 - Owner: https://github.com/muhammedaksam
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-trusted.yml@26a714c6de7af9207150cff67c7e82eda944f2b7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file waha_py-2026.8.1-py3-none-any.whl.
File metadata
- Download URL: waha_py-2026.8.1-py3-none-any.whl
- Upload date:
- Size: 77.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01b922dd4c7cdf4be43ecd150d153f343b2571f0c2aa0b5ed70ba48db58b0597
|
|
| MD5 |
0ce191bea04abf9e395ce9481e0072b5
|
|
| BLAKE2b-256 |
16839c7eac0f85ea88b0afa9d811fe384f6c8dfc9ab567e2dc408f2fff8bbdbb
|
Provenance
The following attestation bundles were made for waha_py-2026.8.1-py3-none-any.whl:
Publisher:
publish-trusted.yml on muhammedaksam/waha-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
waha_py-2026.8.1-py3-none-any.whl -
Subject digest:
01b922dd4c7cdf4be43ecd150d153f343b2571f0c2aa0b5ed70ba48db58b0597 - Sigstore transparency entry: 2471291121
- Sigstore integration time:
-
Permalink:
muhammedaksam/waha-py@26a714c6de7af9207150cff67c7e82eda944f2b7 -
Branch / Tag:
refs/tags/v2026.8.1 - Owner: https://github.com/muhammedaksam
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-trusted.yml@26a714c6de7af9207150cff67c7e82eda944f2b7 -
Trigger Event:
push
-
Statement type: