Skip to main content

Yandex translate async api wrapper

Project description

aioyatr

Async yandex.translate api wrapper for python

Example of usage

import asyncio
from aio_yandex_translate.translator import Translator
key = "TOKEN"

async def main():
    text = 'Hello world'
    print(text)
    t = Translator(key)
    r = await t.translate(text, to_language='ru')
    print(r)


loop = asyncio.get_event_loop()
loop.run_until_complete(main())

Explaining some details

To get to exceptions that module can throw you may go to Translator.exc and see classes of exceptions (TranslatorError is base)
The code is really short but i hope it will help you!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aio_yandex_translate-1.0.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

aio_yandex_translate-1.0-py3-none-any.whl (17.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page