Skip to main content

Latino

Latino è una libreria python che traduce dal latino usando il Dizionario Latino.

Latino is a python library that translates latin text by making requests to the Online Latin Dictionary.

Written for Python 3.8+.

pip install latino

latino.Translator

You have to create an instance of Translator to use this API

Parameters:

  • lang - language to be translated to
  • settings (available from the next releases)

translate(text, **kwargs)
Translate text from latin to destination language\

  • Parameters:
    • text (str; string sequence) - The latin source text(s) to be translated.
  • Return type: list[Translated]
  • Return type: list[list[Translated]] (when a list is passed)

Basic usage:

>>> from latino import Translator
>>> translator = Translator()  # lang="it" (italian default)

>>> # translator.translate returns a list of all possible translations
>>> puella = translator.translate("puella")[0]  # let's get the first result

>>> puella.lemma
pŭella

>>> puella.grammatica
sostantivo femminile  I declinazione

>>> puella.paradigma # might not exist
[puellă], puellae

>>> puella.traduzione
['bambina', 'ragazza', 'fanciulla', 
 'amante', 'donna amata', 'sposa', 
 'giovane donna', 'figlia', 'schiava']

>>> puella.table()
{'FEMMINILE': {'PLURALE': ['Nom.puellae',
                           'Gen.puellārum',
                           'Dat.puellis',
                           'Acc.puellas',
                           'Abl.puellis',
                           'Voc.puellae'],
               'SINGOLARE': ['Nom.puellă',
                             'Gen.puellae',
                             'Dat.puellae',
                             'Acc.puellam',
                             'Abl.puellā',
                             'Voc.puellă']}}

from latino import Translator

# Translator() takes as arg a lang between "it"/"en"/"fr"
translator = Translator("en") 

# Gonna print possible meaning for "es"
for translated in translator.translate("es"):
    print(translated.traduzione[0])
to eat
to be

from latino import Translator
translator = Translator("fr") 

text = "pulchram puellam sum"
# any string sequence such as list can also be taken as argument!
for i in translator.translate(text.split()):
    print(i[0].paradigma)
[pulcher], pulchră, pulchrum
[puellă], puellae
[sum], es, esse, fui

latino.models

latino.models.Translated

Members:

  • grammatica - grammar
  • lemma - lemma
  • paradigma - paradigm
  • traduzione - list of translations

table()
Returns the Declension table or the Conjugation table

latino.LANGUAGES

# languages which can be translated from
LANGUAGES = {
    'it': 'italiano', 
    'en': 'english', 
    'fr': 'francais'
 }

Licenza | License

MIT

Metadata

Release files for latino 0.1.1

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

Source distribution (sdist)

Source distribution for latino 0.1.1
File Size Uploaded
latino-0.1.1.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for latino 0.1.1
File Interpreter ABI Platform
latino-0.1.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 10.4 kB

Release files / latino-0.1.1.tar.gz

Download URL latino-0.1.1.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3ea813fd37570fdbd312c79ef5da8df04b2be793f59151d02cd0b508e74e1fe5
BLAKE2b-256 checksum
How to use checksums
f54e82e16477dad0fdb597830b8e5f119a0fbf50ca83394f3685e7ffd02ed189
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.7

Release files / latino-0.1.1-py2.py3-none-any.whl

Download URL latino-0.1.1-py2.py3-none-any.whl
Size 5.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
ab9fa06036fb9aecf1f96f327b8eb2ca7c9c5452dc3a86cfe6c31ae1bf19cb67
BLAKE2b-256 checksum
How to use checksums
15644182e7d7871f53b971db003aaa89df6f008c84bb0b4189b7303f66fcee7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.0.7

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

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