skillfed

pywa

🚀 Build WhatsApp Bots in Python • Fast, Effortless, Powerful

pywa v4.4.0 209.7K downloads/30d#9,510 on PyPI578
Permissive license MIT Active released

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 pywa

uv

uv add pywa

poetry

poetry add pywa

Installing 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

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: AsyncIOIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Communications :: ChatTopic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Internet :: WWW/HTTP :: HTTP ServersTopic :: Software Development :: Libraries :: Application FrameworksTopic :: Software Development :: Libraries :: Python Modules

Tags

whatsapp bot framework pythonwhatsapp cloud api clientwhatsapp messaging automationwhatsapp webhook handlerbuild whatsapp chatbotswhatsapp flows and templateswhatsapp business api python
whatsapp-apichatbot-frameworkasync-support

More Python Modules packages