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.9.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.9.1
File Size Uploaded Provenance Actions
waha_py-2026.9.1.tar.gz 243.1 kB With provenance Details for waha_py-2026.9.1.tar.gz

Built distribution (wheel)

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

Total release size: 323.2 kB

Release files / waha_py-2026.9.1.tar.gz

Download URL waha_py-2026.9.1.tar.gz
Size 243.1 kB
Tags Source
SHA-256 checksum
How to use checksums
21e39c61b685b0400f0388ca000453f21501a72463c33128b04c12629fe624cc
BLAKE2b-256 checksum
How to use checksums
25205ba36a86d24dbabff6b43892da248a55e88e5ab5726aff5b8754a4aacde6
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 23, 2026.

Transparency log

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

Download URL waha_py-2026.9.1-py3-none-any.whl
Size 80.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45818c648aa9a5d82bb08eaa4a93e738720a974d7a54ed6dadff28b6dc4c482f
BLAKE2b-256 checksum
How to use checksums
7737e1c6472cde9d0ccc0a892c0cf4c60b0c313a137045f15cc076909c2fc256
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 23, 2026.

Transparency log

Security for waha-py 2026.9.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.9.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 Sep 23, 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