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
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| latino-0.1.1.tar.gz | 4.8 kB | Without provenance | Details for latino-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| latino-0.1.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for latino-0.1.1-py2.py3-none-any.whl |
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
|
Security for latino 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.