yandex-dict
Module provides a client for the Yandex Dictionary API of Yandex.Dictionary service. The module contains class YandexDictionaryClient which is initialized with an API key from Yandex. It provides the following methods:
lookup(text, lang, ui=None, flags=None): Executes a search for a word or phrase in the Yandex Dictionary. translate(text, lang): Translates a word in the specified language direction. synonyms(text, lang): Finds the synonyms of a word in the specified language direction. get_langs(): Makes a request to the Yandex Dictionary API to fetch a list of available translation directions.
See the User Agreement of the Yandex API service.Dictionary for more information about usage limits and conditions. To get free API key use page
Prerequisites
- Python 3.10 or later
Installation
pip install yadict
Usage
from yadict.client import YandexDictionaryClient
# Then create an instance of the client with your API key from Yandex:
client = YandexDictionaryClient("your-api-key")
# You can use the lookup method to search for a word or phrase in the dictionary:
result = client.lookup("time", "en-ru")
print(result)
# The translate method translates a word in the specified language direction:
translations = client.translate("time", "en-ru")
print(translations) # ['время', 'час', 'эпоха', 'период времени', 'тайм', 'продолжительность', 'приурочивать', 'временной', 'своевременно']
# The synonyms method finds the synonyms of a word in the specified language direction:
synonyms = client.synonyms("time", "en-ru")
print(synonyms) # ['время', 'минута', 'час', ...]
# The get_langs method fetches a list of available translation directions:
langs = client.get_langs()
print(langs) # ['en-ru', 'ru-en', ...]
Metadata
Release files for yadict 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 |
|---|---|---|---|---|
| yadict-0.1.1.tar.gz | 3.2 kB | Without provenance | Details for yadict-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| yadict-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for yadict-0.1.1-py3-none-any.whl |
Total release size: 7.0 kB
Release files / yadict-0.1.1.tar.gz
| Download URL | yadict-0.1.1.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eaf6f998c1dc0a7f2a67c0d5480eefefb5deeead4493111aa3ef743587731e3d
|
|
BLAKE2b-256 checksum How to use checksums |
12680e9cd5de2bf9d5c3b9e87ed30fe4aff6c73389b713366ac9de9d0371005d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.18.0 CPython/3.10.12 Linux/5.15.0-119-generic
|
Release files / yadict-0.1.1-py3-none-any.whl
| Download URL | yadict-0.1.1-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
33bf2cf344a0fed3ea40cdf3252d26ce727ecaee4bb4b3da8c6185918c21765f
|
|
BLAKE2b-256 checksum How to use checksums |
9c78c9c1a5ac023597ccb4dc1807159009081b69c0e205860c22715c7d32a787
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.18.0 CPython/3.10.12 Linux/5.15.0-119-generic
|
Security for yadict 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.