PyZapp Python SDK
Send and receive WhatsApp messages from Python. No Node.js, no browser
automation — just pip install pyzapp-sdk and an API key.
pip install pyzapp-sdk
from whatsapp_sdk import WhatsAppClient
with WhatsAppClient(base_url="https://sua-api.com", api_key="...") as client:
inst = client.create_instance()
client.print_qr(inst.instance_id) # scan with WhatsApp
client.send_message(inst.instance_id, "+5511999999999", "Olá!")
No QR? Use a pairing code instead:
print(client.request_pairing_code(inst.instance_id, "+5511999999999"))
# type the 8-digit code on your phone
AI auto-reply (OpenAI, Groq, OpenRouter, Ollama, Gemini, Anthropic):
client.set_ai(inst.instance_id, provider="groq", system_prompt="Seja breve.")
Methods
Instances: create_instance, list_instances, get_instance,
delete_instance, connect, get_qr, print_qr, get_status.
Messaging: send_message, request_pairing_code, set_webhook(url, secret?).
AI: set_ai, get_ai, disable_ai.
Errors
All subclass WhatsAppSDKError and carry a stable .code:
AuthenticationError, InstanceNotFoundError, NotConnectedError,
QRNotAvailableError, ValidationError, ServiceError.
from whatsapp_sdk import NotConnectedError, WhatsAppClient
try:
client.send_message(iid, phone, text)
except NotConnectedError:
print("scan the QR first")
Requirements
Python 3.10+. Server side (FastAPI + Baileys) is operated separately — see the main repo to self-host with Podman.
Development
pip install -e ".[dev]"
python -m pytest # httpx.MockTransport, no network
Release files for pyzapp-sdk 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyzapp_sdk-0.2.1.tar.gz | 6.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyzapp_sdk-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.9 kB
Release files / pyzapp_sdk-0.2.1.tar.gz
| Download URL | pyzapp_sdk-0.2.1.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9b68d6439f801a0550c7a83ed30916eb560ecc2d420a6129bd313c43af28414e
|
|
BLAKE2b-256 checksum How to use checksums |
3dccfded7e74278115d7b1b1646c50b18652138244cb33f540f707743af95549
|
| 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 25, 2026.
Transparency logRelease files / pyzapp_sdk-0.2.1-py3-none-any.whl
| Download URL | pyzapp_sdk-0.2.1-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8e9a28d3a55073a88dbcfdfe677a8e08d75c3fa1344e666f2d87234379051728
|
|
BLAKE2b-256 checksum How to use checksums |
391bb7bc58cb29bf4fac1f0d0a768d0fe3370309a28d2e8f0fd6afefa097ee84
|
| 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 25, 2026.
Transparency log