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.8.2

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.8.2
File Size Uploaded Provenance Actions
waha_py-2026.8.2.tar.gz 241.6 kB With provenance Details for waha_py-2026.8.2.tar.gz

Built distribution (wheel)

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

Total release size: 321.1 kB

Release files / waha_py-2026.8.2.tar.gz

Download URL waha_py-2026.8.2.tar.gz
Size 241.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9431dcbabeeee710a315c16d6fa07656702bade0b88e51523e475b8740744e51
BLAKE2b-256 checksum
How to use checksums
57821a4d00bf8401d6c3cbeb43d6a275edd75fef866f5404acc978bc69af36ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 2, 2026.

Transparency log

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

Download URL waha_py-2026.8.2-py3-none-any.whl
Size 79.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4958564bb776f494830455aac459b827333ff560627ed597182ae10acf98620
BLAKE2b-256 checksum
How to use checksums
e99a6d657461f4b938588e332e0f75411eefdcc539b76b119641d62add67ba98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 2, 2026.

Transparency log

Security for waha-py 2026.8.2

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.8.2.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 Sep 2, 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