pywa
🚀 Build WhatsApp Bots in Python • Fast, Effortless, Powerful
What it is and what it does
PyWa is a comprehensive, fully-typed Python framework for the WhatsApp Cloud API that abstracts away the complexity of direct API calls. It provides decorators and type-safe handlers for receiving and responding to messages, managing templates, building interactive flows, and handling call events. The framework supports both synchronous and asynchronous code paths, integrates with FastAPI and Flask, and includes a built-in webhook server for local development and production deployment.
The package is designed to let developers focus on bot logic rather than API plumbing. It handles message routing through composable filters, supports rich message types (text, images, documents, buttons, lists), provides inline conversation listeners for natural multi-turn flows, and includes CLI scaffolding tools. With full type hints and static analysis support, it catches errors early and enables IDE autocomplete throughout.
Use it for:
- Build a customer support chatbot that receives messages, routes them by intent, and sends templated responses or escalates to human agents.
- Create an order-taking bot that collects customer details through interactive flows, manages order templates, and sends status updates.
- Implement OTP verification or two-factor authentication flows that wait for user input and validate responses inline.
- Develop a notification service that sends templated messages to users based on business events (order shipped, appointment reminder).
- Build a WhatsApp Flows experience for newsletter signup, surveys, or multi-step onboarding entirely in Python without manual JSON.
- Integrate WhatsApp messaging into an existing FastAPI or Flask application to handle incoming webhooks and send outbound messages.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PyWa is a fully-typed Python framework for building WhatsApp bots using the WhatsApp Cloud API, handling message sending, webhook reception, interactive flows, templates, and call events.
Yes. PyWa is actively maintained, has no known vulnerabilities, low install friction, and is licensed permissively under MIT. It's suitable for production use (Development Status 5) and covers a complete feature set for WhatsApp bot development. Install it if you need to build WhatsApp bots or integrate WhatsApp messaging into a Python application.
Install
pywa on PyPI
pip
pip install pywauv
uv add pywapoetry
poetry add pywaInstalling pywa
Before you install
Low install friction with a single runtime dependency (httpx). Actively maintained with a recent release; last commit 2026-08-12 and 578 repository stars indicate steady development.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal obligations.
Quickstart
pip install pywa
from pywa import WhatsApp, filters, types
wa = WhatsApp(
phone_id="1234567890",
token="EAA...",
app_id=1234567890,
app_secret="secret",
callback_url="https://your-domain.com",
verify_token="token",
)
@wa.on_message(filters.text)
def echo(_: WhatsApp, msg: types.Message):
msg.reply(f"You said: {msg.text}")
# Run with: pywa dev
Requires Python 3.10 or later; WhatsApp Cloud API credentials (phone_id, token, app_id, app_secret) and a publicly accessible callback URL for webhook reception.
Verify before relying
- Whether the async variant (pywa_async) is included in the base package or requires separate installation.
- Whether CLI tools (pywa dev, pywa run, pywa new) are available in the base installation or require optional extras.
- Performance characteristics and rate-limit handling for high-volume message scenarios.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — httpx |
| Maintenance | actively maintained — 3 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 209,716/month — #9,510 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pywa-4.4.0-py3-none-any.whl
Keywords: whatsapp, whatsapp-cloud-api, meta-whatsapp-api, whatsapp-webhook, whatsapp-templates, whatsapp-flows, whatsapp-calling, whatsapp-bot, pywa, asyncio, async, chatbot-framework, webhook-handler, automation
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
line-bot-sdkSDK for building LINE bots that handles webhook…
permissive · top 5,000 on PyPI
neonizeNeonize is a Python library for automating…
unclear · top 15,000 on PyPI
python-telegram-botProvides a pure Python asynchronous interface…
copyleft · top 1,000 on PyPI
plivoA Python SDK for integrating Plivo's voice,…
permissive · top 15,000 on PyPI
africastalkingProvides Python access to Africa's Talking APIs…
permissive · top 15,000 on PyPI
twitchAPIA Python client library for the Twitch Helix…
permissive · top 15,000 on PyPI
pyTelegramBotAPIA Python library that wraps the Telegram Bot…
copyleft · top 5,000 on PyPI
hikariHikari is an async Discord bot framework for…
permissive · top 15,000 on PyPI
rasa-sdkRasa SDK provides a Python framework for…
permissive · top 15,000 on PyPI
slackwebSends messages to Slack channels via incoming…
permissive · top 15,000 on PyPI