Skip to main content

waha-py

PyPI version License: MIT Python

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:

  1. Daily - GitHub Action spins up latest devlikeapro/waha container
  2. Fetches OpenAPI spec from /-json endpoint
  3. Compares SHA256 hash with committed openapi.json
  4. If changed - Generates new types + Python clients, bumps version, commits, and pushes tag
  5. 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

Metadata

Release files for waha-py 2026.10.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 waha-py 2026.10.1
File Size Uploaded Provenance Actions
waha_py-2026.10.1.tar.gz 245.8 kB With provenance Details for waha_py-2026.10.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for waha-py 2026.10.1
File Interpreter ABI Platform Actions
waha_py-2026.10.1-py3-none-any.whl Python 3 none any Details for waha_py-2026.10.1-py3-none-any.whl

Total release size: 326.4 kB

Release files / waha_py-2026.10.1.tar.gz

Download URL waha_py-2026.10.1.tar.gz
Size 245.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4065b929c1ebf73f9fb1942e4a949d8c9d50ce6123d23e8d69ade7425038029f
BLAKE2b-256 checksum
How to use checksums
01e45f5f1b248e0069af7564a044acd45b9b937a7894189df0b99f65708919a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / waha_py-2026.10.1-py3-none-any.whl

Download URL waha_py-2026.10.1-py3-none-any.whl
Size 80.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f59d38bf352b9e5fcc9654e0994fb80f503fdfb2ea5888c4898873c1b8fedb52
BLAKE2b-256 checksum
How to use checksums
4268af7c6a3d5c5ddf5f8cb8610351ab41827540c72b240ae78e1b3db417657d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Security for waha-py 2026.10.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for waha_py-2026.10.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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