Async Python implementation of the WhatsApp Web protocol inspired by Baileys.
Project description
Baileys Python
Baileys-python is the product package for a native Python implementation of
the WhatsApp Web protocol surface provided by Node Baileys.
This project is an unofficial Python implementation inspired by WhiskeySockets/Baileys. It is not affiliated with, endorsed by, sponsored by, or maintained by WhiskeySockets/Baileys, WhatsApp, Meta, or any of their subsidiaries or affiliates. WhatsApp and related names, marks, emblems, and images are trademarks of their respective owners.
This repository is being built from the proven feasibility work in
../baileys-python-test. The spike remains the lab/reference; this package is
the production implementation target.
Current State
The product package has live-proven auth, inbound, outbound, media, app-state, business/catalog, newsletter, and Phase 5 API foundations. Phase 8 core-beta hardening gates are in place:
- installable Python package under
src/baileys - generated WAProto and WABinary token package data
- proven crypto, Noise, Signal, WABinary, media, pairing-code, retry, USync, and saved-auth client modules copied from the spike
- offline parity tests and minimal public API tests
- examples for saved-auth login, pairing-code request, and a small echo bot
- compatibility matrix in
docs/compatibility-matrix.md - public API guide in
docs/public-api.md - migration guide for Node Baileys users in
docs/migration-guide.md - release checklist in
docs/release-checklist.md - architecture and remaining implementation designs in
docs/architecture-design.md - live/proof scripts under
scripts/ - product QR pairing plus saved reconnect through
scripts/product_qr_pairing_probe.py - product outbound text/media API probes through
scripts/send_text_probe.pyandscripts/send_image_probe.py - reusable product content/media probes through
scripts/message_content_probe.pyandscripts/send_media_probe.py - product chat, presence, profile, privacy, blocklist, and group method surfaces with Baileys-compatible aliases
- explicit IQ errors for account-side server rejections in public query APIs
- encrypted app-state patch encoding plus product app-state snapshot fetch/decrypt diagnostics, blocked-key tracking, live key-share ingestion, and app-state replay proof on a freshly linked test session
scripts/phase5_live_probe.pyfor read-only Phase 5 live validationscripts/phase5_mutation_probe.pyfor explicit Phase 5 mutation validationscripts/app_state_key_probe.pyfor app-state key and snapshot diagnosticsscripts/phase7_live_probe.pyandscripts/phase7_remaining_probe.pyfor Phase 7 business, newsletter, community, WAM, privacy-token, bot-list, and peer-data proof trackingscripts/live_suite.pyfor JSON summaries of selected read-only and explicit write live probesscripts/live_suite.py --write-nightly-planfor scheduled read-only probe command planningscripts/soak_suite.pyfor timed reconnect/receive-loop soak summariesscripts/release_gate.pyfor compile, test, generated artifact, docs, package build, clean install, and import smoke checksscripts/release_status.pyfor roadmap, matrix, and deferred-proof consistency checks- optional Postgres stores with versioned migration and live database integration proof
This is not full Baileys parity yet. Account-gated live proof items are tracked as explicit Todos in the compatibility matrix while core beta hardening continues.
Install
python -m pip install baileys-python
Install For Development
python -m pip install -e ".[dev]"
Run Tests
python -m pytest -q
Run Release Gates
python scripts/release_gate.py
Run Live Suite Summary
python scripts/live_suite.py --include-remaining --skip-collections
Write probes are opt-in:
python scripts/live_suite.py --include-write --to 120363000000000000@g.us
Run Soak Summary
python scripts/soak_suite.py --duration 3600
License
This package is released under the MIT License. See LICENSE and NOTICE for
license text, attribution, and affiliation notices.
Minimal Saved-Auth Login
import asyncio
from pathlib import Path
from baileys import WhatsAppWebClient
async def main():
async with WhatsAppWebClient(Path("auth/live_pair_creds.json")) as client:
success = await client.wait_for_success(timeout=60)
print(success.attrs)
asyncio.run(main())
Roadmap
See docs/roadmap.md for the implementation timeline and
docs/compatibility-matrix.md for the public Baileys parity checklist. See
docs/public-api.md for the current Python API and docs/migration-guide.md
for Node Baileys migration notes. See docs/publishing.md for the PyPI release
flow and docs/architecture-design.md for the remaining implementation design.
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
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 baileys_python-0.1.0a0.tar.gz.
File metadata
- Download URL: baileys_python-0.1.0a0.tar.gz
- Upload date:
- Size: 320.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48eecd043a92a2d9230c47290e6c1127059e2a5dd211304ecba4ffd9ab6ac089
|
|
| MD5 |
ced35ec767e631c2197dc7c617b32426
|
|
| BLAKE2b-256 |
3fa4d92564fc3ec10eec9da5c6b177521c48575ffb5b1a53c304004339462bb6
|
File details
Details for the file baileys_python-0.1.0a0-py3-none-any.whl.
File metadata
- Download URL: baileys_python-0.1.0a0-py3-none-any.whl
- Upload date:
- Size: 286.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9f0ec77f384a3997a5ab9d89f572df4f5a72814d3d6259a76b3c88c79589737
|
|
| MD5 |
990519aa3518752caf2e0276b1045d3d
|
|
| BLAKE2b-256 |
d2df40997f06f6e963217f5c7850886e1bc653bc3795a22a559a788547683b6b
|