Metadata-Version: 2.4
Name: wa-socket
Version: 0.1.6
Summary: Baileys-style WhatsApp Web socket for Python
Author-email: Ritik Sharma <ritiksharma19173@gmail.com>
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# wa-socket

`wa-socket` is a Python library that provides a WhatsApp Web socket interface using a
Node.js backend powered by the Baileys library.

The goal is to let Python developers interact with WhatsApp Web **without writing Node.js code**.

---

## Features

- WhatsApp Web connection via QR code
- Session persistence (scan once, reconnect automatically)
- Python-first API
- Node.js backend managed automatically
- Suitable for scripts, services, and FastAPI apps

---

## Requirements

- **Python 3.9+**
- **Node.js 22+**

⚠️ **Node.js 20 / 22 are NOT supported**  
This is due to upstream dependency constraints in Baileys.

Download Node.js 18 LTS from:
https://nodejs.org/en/download

Verify installation:
```bash
node -v
npm -v


## How it works

`wa-socket` runs a lightweight Node.js process internally.

- Python controls everything
- Node.js is only used for WhatsApp Web (Baileys)
- Communication happens via stdin/stdout (JSON events)
- QR codes are rendered directly in the terminal


## Quick Start

```python
from wa_socket import WhatsAppSocket

sock = WhatsAppSocket(session_id="default")

sock.on_message(lambda msg: print(msg))
sock.start()
sock.wait_for_connection()

sock.send_message("919XXXXXXXXX", "Hello from Python")
