Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iTeam-S/Ampalibe
Ampalibe is a lightweight Python framework for building Facebook Messenger bots faster. It provides a new concept, it manages webhooks, processes data sent by Facebook and provides API Messenger with advanced functions such as payload management, item length, and more.
https://github.com/iTeam-S/Ampalibe
ampalibe ampalibe-framework bot chatbot-framework facebook-messenger facebook-messenger-bot framework hacktoberfest hacktoberfest2023 messenger-api messenger-platform python
Last synced: about 1 month ago
JSON representation
Ampalibe is a lightweight Python framework for building Facebook Messenger bots faster. It provides a new concept, it manages webhooks, processes data sent by Facebook and provides API Messenger with advanced functions such as payload management, item length, and more.
- Host: GitHub
- URL: https://github.com/iTeam-S/Ampalibe
- Owner: iTeam-S
- License: mit
- Created: 2022-01-25T17:08:03.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-11T06:59:26.000Z (12 months ago)
- Last Synced: 2024-05-17T00:39:50.273Z (7 months ago)
- Topics: ampalibe, ampalibe-framework, bot, chatbot-framework, facebook-messenger, facebook-messenger-bot, framework, hacktoberfest, hacktoberfest2023, messenger-api, messenger-platform, python
- Language: Python
- Homepage: https://ampalibe.readthedocs.io/
- Size: 5.85 MB
- Stars: 94
- Watchers: 6
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Ampalibe
Video Tutorials
ยท
Documentation
ยท
Report Bug
Ampalibe is a lightweight Python framework for building Facebook Messenger bots faster.
It provides a new concept, it manages webhooks, processes data sent by Facebook and provides API Messenger with advanced functions such as payload management, item length, and more.
Show your support by giving a star ๐ if this project helped you!
## Installation
```s
pip install ampalibe
```OR you can install dev version
```s
pip install https://github.com/iTeam-S/Ampalibe/archive/refs/heads/main.zip
```------------------
if you use mysql as database, you have to install `mysql-connector` or `mysql-connector-python` with ampalibe
```s
pip install ampalibe[mysql-connector]
```----------------------
if you use postgresql as database, you have to install `psycopg2` with ampalibe
```s
pip install ampalibe[psycopg2]
```----------------------
if you use mongodb as database, you have to install `pymongo` with ampalibe
```s
pip install ampalibe[pymongo]
```## Usage
> command-line __ampalibe__ is __ampalibe.bat__ for _Windows_
```s
ampalibe create myproject
```OR
```shell
$ cd myproject
$ ampalibe init
```to run project, just use
```s
ampalibe run
```for dev mode with __Hot Reload__
```s
ampalibe run --dev
```### Register for an Access Token
You will need to configure a Facebook application, a Facebook page, get the access to the page, link the application to the page, configure a webhook for your app before you can really start using __Ampalibe__.
[This app setup guide](https://developers.facebook.com/docs/messenger-platform/getting-started/app-setup) should help
OR
See [this video](https://www.youtube.com/watch?v=Sg2P9uFJEF4&list=PL0zWFyU4-Sk5FcKJpBTp0-_nDm0kIQ5sY&index=1) on Youtube
### Minimal Application
```python
import ampalibe
from ampalibe import Messenger, Model
from ampalibe.messenger import Actionchat = Messenger()
query = Model()@ampalibe.before_receive()
def before_process(sender_id, **ext):
# Mark as seen for each message received
chat.send_action(sender_id, Action.mark_seen)
return True@ampalibe.command('/')
def main(sender_id, cmd, **ext):
"""
No need to manage weebhooks and data: messages are received directly in a main function
"""
chat.send_text(sender_id, 'Enter your name')
# define the function of the next treatment
query.set_action(sender_id, '/get_name')
@ampalibe.action('/get_name')
def get_name(sender_id, cmd, **ext):
query.set_action(sender_id, None) # clear current action
chat.send_text(sender_id, f'Hello {cmd}') # greeting with name enter by user
```## Documentation
- [Ampalibe Readthedocs](https://ampalibe.readthedocs.io/)
#### Other resource
- [ [Youtube] Create a Facebook Bot Messenger with AMPALIBE Framework (EN) ](https://www.youtube.com/playlist?list=PL0zWFyU4-Sk5FcKJpBTp0-_nDm0kIQ5sY)
- [ [Youtube] Tutoriel Framework Ampalibe (FR)](https://www.youtube.com/playlist?list=PLz95IHSyn29U4PA1bAUw3VT0VFFbq1LuP)
- [ [Youtube] Ampalibe Framework Episode (Teny Vary Masaka) ](https://www.youtube.com/playlist?list=PLN1d8qaIQgmKmCwy3SMfndiivbgwXJZvi)## Deployment
**Using container**
> Go to our dir project and run
```s
$ docker run -d -v "${PWD}:/usr/src/app" -p 4555:4555 ghcr.io/iteam-s/ampalibe
```**Using heroku container**
- Go to heroku docs for [docker deploys](https://devcenter.heroku.com/articles/container-registry-and-runtime)
- Change your Dockerfile like this
```dockerfile
FROM ghcr.io/iteam-s/ampalibeADD . /usr/src/app/
# RUN pip install --no-cache-dir -r requirements.txt
CMD ampalibe -p $PORT run
```
- Customize your Dockerfile if necessary**Using heroku python**
- Go to heroku docs for [Getting Started on Heroku with Python](https://devcenter.heroku.com/articles/getting-started-with-python?singlepage=true)
- Define your Procfile like this `web: ampalibe -p $PORT run`
**Other plateform ?**
Maybe just run `ampalibe run` in the right directory? or specify port if needed `ampalibe -p 1774 run`## About
Ampalibe is a word of Malagasy origin designating the fruit jackfruit.
We have made a promise to
- keep it **light**
- make it **easy to use**
- do it **quickly to develop**## Contributors
![Image des contributeurs GitHub](https://contrib.rocks/image?repo=iTeam-S/Ampalibe)
## Community
### ๐ Extension
- [Ampalibe extension](https://marketplace.visualstudio.com/items?itemName=iTeam-S.ampalibe) by [Raja Rakotonirina](https://github.com/RajaRakoto)
A VScode extension that allows the user to write a snippet of code using easy to remember prefixes
### ๐ Module- [Ampalibe Odoo Addons](https://apps.odoo.com/apps/modules/15.0/ampalibe/) by [Rivo Lalaina](https://github.com/rivo2302)
An Odoo module to synchronize the Ampalibe Framework with Odoo ERP.
### ๐ Star History