Skip to main content

librelingo_types

Data types to be used in Python packages for LibreLingo

librelingo_types.data_types

TextToSpeechSettings Objects

class TextToSpeechSettings(
    namedtuple(
        "TextToSpeechSettings",
        [
            "provider",
            "voice",
            "engine",
        ],
        defaults=["Polly", "Lupe", "standard"],
    ))

Settings about how to use TTS to generate audios

Usage example:

TextToSpeechSettings( ... provider="Polly", ... voice="Aditi", ... engine="standard" ... ) TextToSpeechSettings(provider='Polly', voice='Aditi', engine='standard')

AudioSettings Objects

class AudioSettings(
    namedtuple(
        "AudioSettings",
        [
            "enabled",
            "text_to_speech_settings_list",
        ],
        defaults=[False, []],
    ))

Settings for audio in a course

Usage example:

AudioSettings( ... enabled=True, ... text_to_speech_settings_list=[TextToSpeechSettings()] ... ) AudioSettings(enabled=True, text_to_speech_settings_list=[TextToSpeechSettings(provider='Polly', voice='Lupe', engine='standard')])

HunspellSettings Objects

class HunspellSettings(
    namedtuple(
        "HunspellSettings",
        [
            "source_language",
            "target_language",
        ],
        defaults=[None, None],
    ))

Settings for hunspell spell checking

Usage example:

HunspellSettings( ... source_language="en-US", ... target_language="es-ES", ... ) HunspellSettings(source_language='en-US', target_language='es-ES')

Settings Objects

class Settings(
    namedtuple(
        "Settings",
        ["audio_settings", "hunspell"],
        defaults=[AudioSettings(), HunspellSettings()],
    ))

Settings for a course

Usage example:

Settings() Settings(audio_settings=AudioSettings(enabled=False, text_to_speech_settings_list=[]), hunspell=HunspellSettings(source_language=None, target_language=None))

Course Objects

class Course(
    namedtuple(
        "Course",
        [
            "target_language",
            "source_language",
            "special_characters",
            "modules",
            "license",
            "dictionary",
            "repository_url",
            "course_dir",
            "settings",
        ],
        defaults=[Settings()],
    ))

A LibreLingo course

Usage example:

my_course = Course(
    target_language=Language("English", "en"),
    source_language=Language("Spanish", "es"),
    special_characters=[],
    modules=[module1, module2, module3, module4],
    license=License(
        full_name="Attribution 4.0 International (CC BY 4.0)",
        name="CC BY 4.0",
        link="https://creativecommons.org/licenses/by/4.0/"
    ),
    dictionary=[dict_item1, dict_item2, dict_item3, dict_item4],
    repository_url="https://example.com",
    course_dir="some_language/course",
    settings=Settings()
)

Language Objects

class Language(namedtuple("Language", ["name", "code"]))

Metadata about a language

Usage example:

Language("English", "en") Language(name='English', code='en')

License Objects

class License(
    namedtuple(
        "License",
        [
            "name",
            "full_name",
            "link",
        ],
    ))

Metadata about the license of a LibreLingo course

Usage example:

License( ... full_name="Attribution 4.0 International (CC BY 4.0)", ... name="CC BY 4.0", ... link="https://creativecommons.org/licenses/by/4.0/" ... ) License(name='CC BY 4.0', full_name='Attribution 4.0 International (CC BY 4.0)', link='https://creativecommons.org/licenses/by/4.0/')

Module Objects

class Module(
    namedtuple(
        "Module",
        [
            "title",
            "filename",
            "skills",
        ],
    ))

A module of a LibreLingo course.

Usage examples:

my_module = Module(title="Basics", filename="basic/module.yaml", skills=[skill1, skill2])

Skill Objects

class Skill(
    namedtuple(
        "Skill",
        [
            "name",
            "filename",
            "id",
            "words",
            "phrases",
            "image_set",
            "dictionary",
            "introduction",
        ],
    ))

A skill of a module of a LibreLingo course.

Notes:

id: Needs to be a unique ID. Use uuidv4.

Usage examples:

my_skill = Skill(
    name="Animals",
    filename="basic/skills/hello.yaml",
    id="3adc78da-ea42-4ecd-9e3d-2e0986a3b914",
    words=[word1, word2, word3],
    phrases=[phrases1, phrases2, phrases3],
    image_set=["cat1", "dog2", "horse1"],
    dictionary=[dict_item_1, dict_item_2, dict_item_3, dict_item_4],
    introduction="My *markdown* text",
)

Word Objects

class Word(
    namedtuple(
        "Word",
        [
            "in_target_language",
            "in_source_language",
            "pictures",
        ],
    ))

A new word taught in a LibreLingo skill.

Notes:

in_source_language: List of accepted forms in the target language of the course. The first item in the list is the main form. The main form is the only form that is shown in the course but all forms are accepted as answers.

in_target_language: List of accepted forms in the target language of the course. The first item in the list is the main form. The main form is the only form that is shown in the course but all forms are accepted as answers.

Usage example:

Word( ... in_target_language=["perro"], ... in_source_language=["dog"], ... pictures=["dog1", "dog2", "dog3"] ... ) Word(in_target_language=['perro'], in_source_language=['dog'], pictures=['dog1', 'dog2', 'dog3'])

Phrase Objects

class Phrase(
    namedtuple(
        "Phrase",
        [
            "in_target_language",
            "in_source_language",
        ],
    ))

A new phrase taught in a LibreLingo skill.

Notes:

in_source_language: List of accepted forms in the target language of the course. The first item in the list is the main form. The main form is the only form that is shown in the course but all forms are accepted as answers.

in_target_language: List of accepted forms in the target language of the course. The first item in the list is the main form. The main form is the only form that is shown in the course but all forms are accepted as answers.

Usage example:

Phrase( ... in_target_language=["perro", "can"], ... in_source_language=["dog"], ... ) Phrase(in_target_language=['perro', 'can'], in_source_language=['dog'])

DictionaryItem Objects

class DictionaryItem(
    namedtuple("DictionaryItem", ["word", "definition", "is_in_target_language"]))

A dictionary item for a LibreLingo course. It contains the definition of a word. The word can be either in the source language or the target language.

Definition in the source language (Spanish in this case)

DictionaryItem("hablo", "I speak", False) DictionaryItem(word='hablo', definition='I speak', is_in_target_language=False)

Definition in the target language (English in this case)

DictionaryItem("speak", "hablo", True) DictionaryItem(word='speak', definition='hablo', is_in_target_language=True)

PhraseIdentity Objects

class PhraseIdentity(namedtuple("PhraseIdentity", ["text", "source"]))

This is the set of information that identifies a phrase as 'the same'. If any of these things change, the phrase will be seen as 'new' and re-generated.

Metadata

Release files for librelingo-types 3.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for librelingo-types 3.3.0
File Size Uploaded
librelingo_types-3.3.0.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for librelingo-types 3.3.0
File Interpreter ABI Platform
librelingo_types-3.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.6 kB

Release files / librelingo_types-3.3.0.tar.gz

Download URL librelingo_types-3.3.0.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7292872ed4e83d318e1ff8731b5d34ab2add9c192d5dbcc56a36c8b8be85685c
BLAKE2b-256 checksum
How to use checksums
c671b325dd3524f926e182acc8ad0c578dbb522685a62efc3a2af1606c0189cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.1 Linux/5.15.11-arch2-1

Release files / librelingo_types-3.3.0-py3-none-any.whl

Download URL librelingo_types-3.3.0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
12a41062d5c0b3728637b577dd687a07c186b1ae281dd476e7381b6950c04de8
BLAKE2b-256 checksum
How to use checksums
b22e7931caacdd2f32eaf8b60c306c448b3a6d3d9248ef1dbb6286e51e5b8dea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.1 Linux/5.15.11-arch2-1

Release history Release notifications | RSS feed

This release

3.3.0 This release

2 release files

3.2.0

2 release files

3.1.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.0.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page