Skip to content

3mora2/WPP_Whatsapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

174 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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 something else? Check out neonize - A powerful Python library built on top of Whatsmeow, enabling seamless WhatsApp automation with enterprise-grade performance.

πŸ“š 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! πŸŽ‰

About

WPP_Whatsapp aim of exporting functions from WhatsApp Web to the python, which can be used to support the creation of any interaction, such as customer service, media sending, intelligence recognition based on phrases artificial and many other things, use your imagination

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages