Metadata-Version: 2.1
Name: whatsapp-framework
Version: 0.5.0
Summary: Whatsapp framework simplifies building and deploying whatsapp based application
Home-page: https://github.com/raven-consult/whatsapp_framework
Keywords: whatsapp,chatbot
Author: Damian Akpan
Author-email: damiakpan@gmail.com
Requires-Python: >=3.9
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.8
Requires-Dist: google-generativeai (>=0.8.3,<0.9.0)
Requires-Dist: pydantic (>=2.9.1,<3.0.0)
Requires-Dist: pyngrok (>=7.2.0,<8.0.0)
Requires-Dist: requests (>=2.32.3,<3.0.0)
Requires-Dist: werkzeug (>=3.0.4,<4.0.0)
Project-URL: Repository, https://github.com/raven-consult/whatsapp_framework
Description-Content-Type: text/markdown

# Whatsapp Framework

**Whatsapp Framework** simplifies building and deploying whatsapp based applications.

## Installation

```bash
pip install whatsapp-framework
```

## Example Usage

Here's a basic example of how to use Whatsapp Framework:

```python
from whatsapp.events import Message
from whatsapp.chat import ChatHandler
from whatsapp.reply_message import Message as ReplyMessage, Text


class SimpleChatHandler(ChatHandler):
    token = "<whatsapp_access_token>"
    whatsapp_number = "<whatsapp_phone_number>"

    def on_message(self, message: Message):
        message_type = message.type
        file = message.message.file
        name = message.contacts[0].profile.name

        req = ReplyMessage(
            type="text",
            to=message.to,
            text=Text(
                preview_url=False,
                body=f"""
Hello, {name}!

I received a {message_type} from you.
I've saved it as {file}.
"""
            ),
        )
        self.send(req)


def main():
    chat_handler = SimpleChatHandler(debug=True, start_proxy=False)
    chat_handler.start()


if __name__ == "__main__":
    main()
```

## License

Whatsapp Framework is licensed under the [MIT License](LICENSE). See the [LICENSE](LICENSE) file for details.

## Contact

If you have any questions or need support, please open an issue on [GitHub Issues](https://github.com/raven-consult/whatsapp_framework/issues) or contact us at [support@ravenconsulting.site](mailto:support@ravenconsulting.site).

