# 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).
Raw data
{
"_id": null,
"home_page": "https://github.com/raven-consult/whatsapp_framework",
"name": "whatsapp-framework",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "whatsapp, chatbot",
"author": "Damian Akpan",
"author_email": "damiakpan@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/43/0c/49435c2cb1178f964eaf0550441b257f0e8265a861bf0ee33c95edf37183/whatsapp_framework-0.5.0.tar.gz",
"platform": null,
"description": "# Whatsapp Framework\n\n**Whatsapp Framework** simplifies building and deploying whatsapp based applications.\n\n## Installation\n\n```bash\npip install whatsapp-framework\n```\n\n## Example Usage\n\nHere's a basic example of how to use Whatsapp Framework:\n\n```python\nfrom whatsapp.events import Message\nfrom whatsapp.chat import ChatHandler\nfrom whatsapp.reply_message import Message as ReplyMessage, Text\n\n\nclass SimpleChatHandler(ChatHandler):\n token = \"<whatsapp_access_token>\"\n whatsapp_number = \"<whatsapp_phone_number>\"\n\n def on_message(self, message: Message):\n message_type = message.type\n file = message.message.file\n name = message.contacts[0].profile.name\n\n req = ReplyMessage(\n type=\"text\",\n to=message.to,\n text=Text(\n preview_url=False,\n body=f\"\"\"\nHello, {name}!\n\nI received a {message_type} from you.\nI've saved it as {file}.\n\"\"\"\n ),\n )\n self.send(req)\n\n\ndef main():\n chat_handler = SimpleChatHandler(debug=True, start_proxy=False)\n chat_handler.start()\n\n\nif __name__ == \"__main__\":\n main()\n```\n\n## License\n\nWhatsapp Framework is licensed under the [MIT License](LICENSE). See the [LICENSE](LICENSE) file for details.\n\n## Contact\n\nIf 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).\n",
"bugtrack_url": null,
"license": null,
"summary": "Whatsapp framework simplifies building and deploying whatsapp based application",
"version": "0.5.0",
"project_urls": {
"Homepage": "https://github.com/raven-consult/whatsapp_framework",
"Repository": "https://github.com/raven-consult/whatsapp_framework"
},
"split_keywords": [
"whatsapp",
" chatbot"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "faf8a7ede466b871d6d144907aa65bc06cdcbfeadb780bb55064a0cb1ab34cad",
"md5": "2942acaf1742df9abe025c532472435e",
"sha256": "48882899c4e010e02b7fb2f151376d625a31f29e45024fd88d37c97786d543b0"
},
"downloads": -1,
"filename": "whatsapp_framework-0.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2942acaf1742df9abe025c532472435e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 12952,
"upload_time": "2024-11-06T14:57:03",
"upload_time_iso_8601": "2024-11-06T14:57:03.355770Z",
"url": "https://files.pythonhosted.org/packages/fa/f8/a7ede466b871d6d144907aa65bc06cdcbfeadb780bb55064a0cb1ab34cad/whatsapp_framework-0.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "430c49435c2cb1178f964eaf0550441b257f0e8265a861bf0ee33c95edf37183",
"md5": "48737b75cae63de6e0608898d7862d73",
"sha256": "bfe400df0ea1d1e2937fe13e298052882f601f524f1cffd2082e060807001700"
},
"downloads": -1,
"filename": "whatsapp_framework-0.5.0.tar.gz",
"has_sig": false,
"md5_digest": "48737b75cae63de6e0608898d7862d73",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 10552,
"upload_time": "2024-11-06T14:57:04",
"upload_time_iso_8601": "2024-11-06T14:57:04.898191Z",
"url": "https://files.pythonhosted.org/packages/43/0c/49435c2cb1178f964eaf0550441b257f0e8265a861bf0ee33c95edf37183/whatsapp_framework-0.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-06 14:57:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "raven-consult",
"github_project": "whatsapp_framework",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "whatsapp-framework"
}