Getting Started

Get started with pywce.

Checkout pywce on GitHub

I assume you have your WhatsApp account and credentials in place

Pywce is a package for creating WhatsApp chatbots using a template-driven approach. It decouples the engine from the WhatsApp client library, allowing developers to use them independently or together.

You can use pywce as just another WhatsApp client library without relying on the template engine.

Setup

  • Install library

    Install latest version from pypi

    $ pip install pywce
    

    or update

    $ pip install -U pywce
    
  • Configure settings

    If using fastapi or flask - ensure these libraries are installed

    The default example uses fastapi

    $ pip install fastapi[standard]
    

    Create a whatsapp instance

    import pywce
    
    wa_config = pywce.WhatsAppConfig(
        token="<ACCESS-TOKEN>",
        phone_number_id="<PHONE-NUMBER-ID>",
        hub_verification_token="<WEBHOOK-VERIFICATION-HUB-TOKEN>"
    )
    
    whatsapp = pywce.WhatsApp(whatsapp_config=wa_config)