Skip to main content

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:

  1. Service (limpopo provides TelegramService, ViberService)

  2. Storage (limpopo provides PostgreStorage, FakeStorage)

  3. Dialog

  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

limpopo-0.1.2.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

limpopo-0.1.2-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

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

Hashes for limpopo-0.1.2.tar.gz
Algorithm Hash digest
SHA256 da36cc3db49ddd78be69799864e55f64c262d1219be7a1e4538ab685a12a7899
MD5 0d39f0588e8a5cbea2d6c4e056b5f6be
BLAKE2b-256 2b5ab74e6d59742e9f975bb6f65ca8637c6641948bbc57ec32abbe1e9e1181b4

See more details on using hashes here.

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

Hashes for limpopo-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ab7e525643662444eaeb9f5222d851b266f192e45d287692c28346ba0ca49c84
MD5 4d576a3d11f9eed4d9dd186133803d30
BLAKE2b-256 e17e11c2d4914cff84f5a815a60214710a963702b23fc6195eeae11bef2af4da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page