Customizing texts

Suppgram encapsulates all text generation in TextProvider class.

suppgram.texts.TextProvider

Provides static texts and functions to compose dynamic texts where necessary.

It has a lot of members, see source code for details.

Suppgram provides out-of-the-box text packs for English and Russian languages. These texts are intentionally bland to fit all more or less, so you should probably consider tailoring them to your needs.

suppgram.texts.en.EnglishTextProvider

suppgram.texts.ru.RussianTextProvider

If you want to customize your texts, you can either implement your own TextProvider or tweak an existing one. For example, let's say we want to hide customer contacts from agents for some privacy reasons. Our code would look like the following:

# ./mytexts.py

from suppgram.texts.en import EnglishTextProvider


class MyTextProvider(EnglishTextProvider):
    customer_profile_contacts = "📒 Contacts: (hidden)"

Then we can customize texts provider in all-in-one CLI:

python -m suppgram.cli.all_in_one \
    --texts mytexts.MyTextProvider \
    ...

or via builder:

from suppgram.builder import Builder

from mytexts import MyTextProvider


builder = Builder()
...
builder = builder.with_texts(MyTextProvider())