Skip to main content

WPP_Whatsapp

PyPI Version View GitHub Actions Python Version

WPP_Whatsapp is a powerful Python library built on top of WPPConnect, bringing WhatsApp Web automation to Python developers.

📚 Looking for documentation? Check out our Complete Documentation


✨ Features

Feature Status
Automatic QR Refresh ✅
Send text, image, video, audio, documents ✅
Get contacts, chats, groups, group members ✅
Send contacts, stickers, locations ✅
Multiple Sessions Support ✅
Forward Messages ✅
Receive Messages with Callbacks ✅
Group Management ✅
Business Features ✅
Rate Limiting ✅

🚀 Quick Start

Installation

Using pip:

pip install wpp-whatsapp

Using uv (Recommended):

uv add wpp-whatsapp

Your First Bot (2 minutes)

from WPP_Whatsapp import Create

# Create and start client
creator = Create(session="mybot")

client = creator.start()
# Define message handler
def on_message(msg):
    if msg.get('body') and not msg.get('isGroupMsg'):
        # Auto-reply
        client.sendText(msg.get('from'), "Thanks for your message! 🤖")

# Register handler
client.on_message(on_message)

# Start bot
print("Bot started! Scan QR code...")
client.start()

That's it! Your WhatsApp bot is now running! 🎉


📚 Documentation

We've created comprehensive documentation to help you:

Start here: Complete Documentation Index


💡 Examples

Send Messages

from WPP_Whatsapp import Create

creator = Create(session="test")
client = creator.start()
# Send text
client.sendText("1234567890@c.us", "Hello!")

# Send image
client.sendImage("1234567890@c.us", "image.jpg", "Beautiful sunset!")

# Send file
client.sendFile("1234567890@c.us", "document.pdf", "Here's the document")

# Send location
client.sendLocation("1234567890@c.us", 40.7128, -74.0060, title="New York")

Receive Messages

from WPP_Whatsapp import Create

creator = Create(session="test")
client = creator.start()

def on_message(message):
    # Ignore group messages
    if message.get('isGroupMsg'):
        return
    
    # Process message
    chat_id = message.get('from')
    text = message.get('body')
    
    if 'hello' in text.lower():
        client.sendText(chat_id, "Hi there! 👋")

client.on_message(on_message)
client.start()

Group Management

from WPP_Whatsapp import Create

creator = Create(session="test")
client = creator.start()

# Create group
group = client.createGroup("My Group", ["123@c.us", "456@c.us"])

# Add participant
client.addParticipant(group['gid'], "789@c.us")

# Send message to group
client.sendText(group['gid'], "Hello everyone!")

More Examples


🎯 Use Cases

WPP_Whatsapp can be used for:

  • 🤖 Chatbots - Customer service automation
  • 📢 Broadcasting - Safe bulk messaging with rate limiting
  • 👥 Group Management - Automated group administration
  • 📊 Analytics - Message tracking and statistics
  • 🔄 Integration - Connect WhatsApp with other services
  • 📱 Auto-replies - Intelligent response systems

⚠️ Important Notes

Rate Limiting

Always use rate limiting for bulk operations to avoid bans:

import time

contacts = ["123@c.us", "456@c.us"]
for contact in contacts:
    client.sendText(contact, "Hello")
    time.sleep(2)  # 2 second delay

Best Practices

  • ✅ Handle errors gracefully
  • ✅ Use unique session names
  • ✅ Implement reconnection logic
  • ✅ Test with small groups first
  • ✅ Respect WhatsApp's terms of service

🆘 Need Help?

Documentation

Community


📦 Project Structure

WPP_Whatsapp/
├── WPP_Whatsapp/      # Main package
├── docs/              # Documentation
├── examples/          # Basic examples
├── scripts/           # Advanced examples
├── archive/           # Additional examples
├── tests/             # Test suite
├── README.md          # This file
├── pyproject.toml     # Project configuration
└── CHANGELOG.md       # Version history

🤝 Contributing

We welcome contributions! Here's how you can help:

  • 📝 Improve documentation
  • 🐛 Report bugs
  • 💡 Suggest features
  • 🔧 Submit pull requests
  • 📚 Add examples

See Contributing Guide for details.


📄 License

This project is licensed under the MIT License.


🙏 Acknowledgments


Made with ❤️ by Ammar Alkotb

Happy Coding! 🎉

Metadata

Release files for WPP-Whatsapp 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for WPP-Whatsapp 1.0.1
File Size Uploaded Provenance Actions
wpp_whatsapp-1.0.1.tar.gz 111.5 kB Without provenance Details for wpp_whatsapp-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for WPP-Whatsapp 1.0.1
File Interpreter ABI Platform Actions
wpp_whatsapp-1.0.1-py3-none-any.whl Python 3 none any Details for wpp_whatsapp-1.0.1-py3-none-any.whl

Total release size: 225.7 kB

Release files / wpp_whatsapp-1.0.1.tar.gz

Download URL wpp_whatsapp-1.0.1.tar.gz
Size 111.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d608257df8794781893d86f133b35d40c72989a2f5f8578874fdcd6d871db7bb
BLAKE2b-256 checksum
How to use checksums
851c1b028c27eb6448648d34b7434caa68badb400b8e7a6040b60d4edafce539
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / wpp_whatsapp-1.0.1-py3-none-any.whl

Download URL wpp_whatsapp-1.0.1-py3-none-any.whl
Size 114.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24663b23628800c77a7e406f5a32529f006c70f1f8f3c45bc3fc16208f21625c
BLAKE2b-256 checksum
How to use checksums
74464a4eab4854ea14cbb3b1507d6e393ae2013a75cd96be518326c727e591b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for WPP-Whatsapp 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page