A pure Python library for WhatsApp Web communication with full Signal Protocol encryption support
Project description
WhatsApp Web Python Library
O bibliotecă Python pură pentru comunicarea cu WhatsApp Web, cu suport complet pentru criptarea Signal Protocol.
Caracteristici
- Autentificare prin cod QR
- Autentificare prin cod de asociere (pairing code)
- Conexiune WebSocket la serverele WhatsApp Web
- Criptare completă Signal Protocol (Double Ratchet, X3DH)
- Suport pentru parsarea/serializarea Protobuf binară
- Trimiterea/primirea de mesaje text
- Arhitectură bazată pe evenimente pentru evenimente în timp real
Instalare
pip install whatsapp-web-py
Exemplu rapid
import asyncio
from whatsapp import WAClient, WAEventType
async def on_message_received(message_data):
print(f"Mesaj nou primit: {message_data}")
async def on_qr_code_received(qr_data):
print(f"Scanează acest cod QR cu WhatsApp: {qr_data}")
async def main():
# Creează clientul
client = WAClient(session_path="./whatsapp_session")
# Configurează handlerii de evenimente
client.set_qr_callback(on_qr_code_received)
client.on(WAEventType.MESSAGE, on_message_received)
# Conectează
await client.connect()
# Așteaptă autentificarea
while not client.authenticated:
await asyncio.sleep(1)
# Trimite un mesaj
await client.send_message("+1234567890", "Salut de la WhatsApp Web Python!")
# Menține rularea
await asyncio.sleep(3600)
if __name__ == "__main__":
asyncio.run(main())
Licență
MIT License
Autor
gyovannyvpn123
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
whatsapp_web_py-0.1.0.tar.gz
(18.7 kB
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 whatsapp_web_py-0.1.0.tar.gz.
File metadata
- Download URL: whatsapp_web_py-0.1.0.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d988b9eae57b2c981bf578599d2267850f3b91731a69bf68c5b994a093c6764a
|
|
| MD5 |
17acf4636425245d013fdfbf62f4612b
|
|
| BLAKE2b-256 |
b554b9cefa430b5f64daa42417b087e7f812cc89ffcb934cb70f237fdeb3bd43
|
File details
Details for the file whatsapp_web_py-0.1.0-py3-none-any.whl.
File metadata
- Download URL: whatsapp_web_py-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0ce45c5f262f28c4a0c0612c1ccf1d5277f90f4b6c7c03257e1a2d58cec21ed
|
|
| MD5 |
e391c275894bc21fcc160400ae33c987
|
|
| BLAKE2b-256 |
3c745352904917ea999b0451c43e7c362eb759999620b10af797b8000843d96e
|