Skip to main content

Async Python SDK for go-whatsapp-web-multidevice

Project description

gowa

Async Python SDK for go-whatsapp-web-multidevice, with Pydantic models and webhook helpers.

Current scope: REST API + webhook payload parsing. WebSocket support is not included yet.

Install

From PyPI:

pip install gowa

For local development:

uv pip install -e ./sdk-python-gowa

Quick start

import asyncio
from gowa_sdk import GoWaClient, SendMessageRequest


async def main() -> None:
    async with GoWaClient(base_url="http://localhost:3000") as client:
        resp = await client.send_message(
            SendMessageRequest(phone="1234567890@s.whatsapp.net", message="Hello")
        )
        print(resp)


asyncio.run(main())

Multi-device support (v8+)

Device scoping required: All device-scoped REST API calls now require either:

  • X-Device-Id header, or
  • device_id query parameter

If only one device is registered, it will be used as the default.

When running multiple devices, pass device_id on the client or per call. This is sent as the X-Device-Id header per the v8 API changes.

async with GoWaClient(base_url="http://localhost:3000", device_id="device_id") as client:
    await client.get_status()

Webhook parsing

from gowa_sdk.webhooks import WebhookEnvelope, WebhookMessagePayload

envelope = WebhookEnvelope.model_validate(payload_dict)
if envelope.event == "message":
    message = WebhookMessagePayload.model_validate(envelope.payload)
    print(message.text)

Docs reference

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gowa-0.1.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gowa-0.1.0-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file gowa-0.1.0.tar.gz.

File metadata

  • Download URL: gowa-0.1.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gowa-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f02c18de8e332de8a15e4ac2acd60f9d639059b74d2a6fadec0b990290ec6dfa
MD5 e9482d5c7ed5096680b8faaa27ef2383
BLAKE2b-256 8711f2ae4ef9d6955cdbdd0812d087ab4d31234e3c41375e156b0215b1f0f7db

See more details on using hashes here.

Provenance

The following attestation bundles were made for gowa-0.1.0.tar.gz:

Publisher: publish.yml on ilanbenb/gowa-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gowa-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gowa-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gowa-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42264ab04b6934cdd276a6373907e56ce65b59fc907c292c3e81a4938c1fcdc7
MD5 6a2bd188dbe24f03a2f38e1f06b83a9b
BLAKE2b-256 3ebe2b0e263bb82cf0c7fd30f621d277c0d3eb31281d0cee95ad869929d20c10

See more details on using hashes here.

Provenance

The following attestation bundles were made for gowa-0.1.0-py3-none-any.whl:

Publisher: publish.yml on ilanbenb/gowa-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page