babla-translate
A Python module for translating words and generating examples using Bab.la dictionary.
Installation
pip install babla_translate
Functions
Module contains class Babla with two functions:
babla.translation(word, exact_word = 1)
babla.example(word, exact_word = 1)
word, accepts string, which you'd like to translate.
exact_word, optional argument which takes int (1 by default), defining if function has to use the exact word; for example if for word 'used' translation of 'use' should also be shown.
Entry point
All operations are implemented in class Babla.
It takes source and target languages ("english", "polish", "german", "spanish"...) as required arguments.
from babla_translate import Babla
babla = Babla("english", "polish")
All usable languages can be found here.
Usage
- Getting translations:
>>> list(babla.translation("use"))
['użyć', 'używać', 'wykorzystać', 'wykorzystywać', 'zastosować', 'skorzystać', 'zażyć',...]
- Getting examples:
>>> for context in babla.example("use"):
... print(context)
'This use of turmeric leaves usually takes place in areas where turmeric is grown locally, since the leaves used are freshly picked.'
All the functions return iterators to not request more results than needed.
Metadata
Release files for babla-translate 1.0
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 |
|---|---|---|---|---|
| babla_translate-1.0.tar.gz | 3.7 kB | Without provenance | Details for babla_translate-1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| babla_translate-1.0-py3-none-any.whl | Python 3 | none | any | Details for babla_translate-1.0-py3-none-any.whl |
Total release size: 7.9 kB
Release files / babla_translate-1.0.tar.gz
| Download URL | babla_translate-1.0.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
14b5e5fa417a776eac343a4ef0e42098fbc88d201623581116f79fd97c21cfa0
|
|
BLAKE2b-256 checksum How to use checksums |
d32f1ae03ab5f1004cff2be78813757454d9ac1ca4bb91ea4385317edd9e6a13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.2
|
Release files / babla_translate-1.0-py3-none-any.whl
| Download URL | babla_translate-1.0-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dcd63d597fd9f2246d182f17c717abf025a632c3311f2aa1ed57ee8052ae7d35
|
|
BLAKE2b-256 checksum How to use checksums |
a08f8b8eb62ed63721d0c15d743576f8e18e781af65c8770d05bd8e74458560d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.2
|
Security for babla-translate 1.0
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.