Baileys-style WhatsApp Web socket for Python
Project description
wa-socket
Python WhatsApp Web socket using a Baileys (Node.js) backend.
Installation
pip install wa-socket
## Requirements
- Python 3.9+
- Node.js 18+ (LTS recommended)
This library uses a Node.js backend internally (WhatsApp Web protocol).
Install Node.js from:
https://nodejs.org/
Verify installation:
```bash
node -v
npm -v
cd <python-site-packages>/wa_socket/node
npm install
## Usage
```python
from wa_socket import WhatsAppSocket
def on_message(message):
print("New message:", message.get("text"))
sock = (
WhatsAppSocket("session1")
.on_message(on_message)
.start()
)
# Blocks until QR is scanned and connection is ready
sock.wait_for_connection()
print("WhatsApp connected. Listening for messages...")
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
wa_socket-0.1.3.tar.gz
(2.4 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wa_socket-0.1.3.tar.gz.
File metadata
- Download URL: wa_socket-0.1.3.tar.gz
- Upload date:
- Size: 2.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1126d6439e913e4d30946516c242b9be5d13aef50da99efbd5ede0b682cfbc47
|
|
| MD5 |
54f4428eda143cdc254c79dded593f69
|
|
| BLAKE2b-256 |
7fc1c74061e7ecce5893cd399999e9d97f6a64f9e647fa414c674d951d1345d0
|
File details
Details for the file wa_socket-0.1.3-py3-none-any.whl.
File metadata
- Download URL: wa_socket-0.1.3-py3-none-any.whl
- Upload date:
- Size: 3.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21c4492d999752ad5dcdc0ef2fc4ae7d49d02f93aa7f0795ee63df03b7e96f5b
|
|
| MD5 |
27d0bca41953721239547ffa000c249a
|
|
| BLAKE2b-256 |
b11f5ca61d5abf20055a7451171c1c6c08649398e85ec6047e6d0c1905265a84
|