Skip to main content

Pure-Python port of Baileys - WhatsApp Web protocol client (no Node.js).

Project description

WAeys

Python PyPI - Version PyPI - Python Versions PyPI - License GitHub Workflow Status

Pure-Python port of Baileys — a WhatsApp Web protocol client. No Node.js / node_modules dependency: all crypto is pure Python.

Features

  • WhatsApp Web protocol over WebSockets (Noise-encrypted)
  • E2EE (Signal) sessions in pure Python
  • Pairing code & QR login
  • Messages: text, media, contacts, location, react, poll, events, and more
  • Interactive messages (buttons, lists, templates) via raw protobuf
  • Session persistence with a pluggable key store
  • Fully typed generated protobuf classes (no google.protobuf dependency)
  • Message retry manager for undelivered messages

Install

pip install waeys

Requires Python 3.10+. Only runtime dependency: websockets>=12.0.

Documentation

Complete guides (very detailed, in three languages):

Language Guide
English docs/usage.en.md
Español docs/usage.es.md
Português docs/usage.pt.md

Quick usage

import asyncio

from WAeys.Defaults.index import default_connection_config
from WAeys.Utils.auth_utils import init_auth_creds
from WAeys.Utils.browser_utils import Browsers
from WAeys.Socket.socket import make_socket


async def main():
    config = default_connection_config()
    config['auth'] = {'creds': init_auth_creds(), 'keys': make_file_key_store()}
    config['browser'] = Browsers.macOS('Safari')
    config['logger'].level = 'info'

    sock = make_socket(config)
    ev = sock['ev']

    async def on_conn(update):
        if update.get('qr'):
            print('Scan the QR in WhatsApp > Linked Devices')
            print(update['qr'])
        if update.get('connection') == 'open':
            await sock['sendMessage']('51921826291@s.whatsapp.net', {'text': 'Hello from WAeys!'})

    ev.on('connection.update', lambda u: asyncio.ensure_future(on_conn(u)))
    await asyncio.Event().wait()


if __name__ == '__main__':
    asyncio.run(main())

See the full guides above for pairing codes, session persistence, media, interactive messages, events and production tips.

Compatibility

WAeys is pure Python and runs on Linux, macOS, Windows, Android (Termux), Docker, VPS and Raspberry Pi.

Disclaimer

This is an unofficial client for the WhatsApp Web protocol. Using it may violate WhatsApp's Terms of Service and can lead to account bans. Use at your own risk. This project is not affiliated with WhatsApp or Meta.

License

MIT

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

waeys-0.1.0.tar.gz (411.3 kB view details)

Uploaded Source

Built Distribution

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

waeys-0.1.0-py3-none-any.whl (404.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: waeys-0.1.0.tar.gz
  • Upload date:
  • Size: 411.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for waeys-0.1.0.tar.gz
Algorithm Hash digest
SHA256 264689cd038f576fb41d2b23b35801f6f5de786484bdd63adfe52eccba02e9a1
MD5 1fba919cd5ff087ce9040ec23d77e9a2
BLAKE2b-256 a83c45481ad373b2e7025d7ece5b3a9759d65aee380e755fbd978c66bc725158

See more details on using hashes here.

File details

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

File metadata

  • Download URL: waeys-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 404.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for waeys-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7a51318ad82df25c2e28ef314599766b2c9f496d42b2aeda79664b46eda043a5
MD5 55743a1a9fd76630d92d6c47a0af3f5d
BLAKE2b-256 0f6606e491afd6a1ae97bb3c0ea5c75f27357cad90c761988d603a3cfb076def

See more details on using hashes here.

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