limpopo is a framework that allows you to create an application for conducting surveys via messengers
Project description
limpopo is a framework that allows you to create an application for conducting surveys in the following messengers:
Telegram
Viber
Installing
Install and update using pip:
pip install limpopo
A Simple Example
import env
import envparse # External dependencies
import import
from limpopo.question import Question
from limpopo.services import TelegramService
from limpopo.storages import FakeStorage
how_are_you_question = Question(
topic="How are you?",
choices=[
"fine"
],
strict_choose=False
)
await def quiz(dialog):
how_are_you_answer = await dialog.ask(how_are_you_question)
if how_are_you_answer.text != "fine":
await dialog.tell("Ohh")
def main():
settings = {
'api_id': env("TELEGRAM_API_ID", cast=int),
'api_hash': env("TELEGRAM_API_HASH", cast=str),
'token': env("TELEGRAM_BOT_TOKEN", cast=str)
}
storage = FakeStorage()
service = TelegramService(
quiz=quiz,
storage=storage,
settings=settings
)
service.run_forever()
Design
limpopo provides the following entities, by which an poll-application is created:
Service (limpopo provides TelegramService, ViberService)
Storage (limpopo provides PostgreStorage, FakeStorage)
Dialog
Question
Development
How to lint and format the code
We are using pre-commit tool, see installation guides.
pre-commit install
pre-commit run -a
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file limpopo-0.1.2.tar.gz.
File metadata
- Download URL: limpopo-0.1.2.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.6 Darwin/20.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da36cc3db49ddd78be69799864e55f64c262d1219be7a1e4538ab685a12a7899
|
|
| MD5 |
0d39f0588e8a5cbea2d6c4e056b5f6be
|
|
| BLAKE2b-256 |
2b5ab74e6d59742e9f975bb6f65ca8637c6641948bbc57ec32abbe1e9e1181b4
|
File details
Details for the file limpopo-0.1.2-py3-none-any.whl.
File metadata
- Download URL: limpopo-0.1.2-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.6 Darwin/20.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab7e525643662444eaeb9f5222d851b266f192e45d287692c28346ba0ca49c84
|
|
| MD5 |
4d576a3d11f9eed4d9dd186133803d30
|
|
| BLAKE2b-256 |
e17e11c2d4914cff84f5a815a60214710a963702b23fc6195eeae11bef2af4da
|