Skip to main content
==================================================
yandex-translater Yandex Translate Api for Python
==================================================

:author: James Axl
:version: 7.0
:date: 2018-12-02


VERSION
--------

version 7.0


DESCRIPTION
------------

This module uses the Yandex.Translate API for machine translation.
A Yandex API key is required; see https://translate.yandex.com/developers
for more information.

Note also that the “Yandex Terms of Use of API Yandex.Translate Service”
at https://yandex.com/legal/translate_api/ must be observed.


Install
---------

::

$ pip install yandex-translater


SYNOPSIS
-----------

Translate a Text
^^^^^^^^^^^^^^^^^

This is a simple example

.. code-block:: pycon

>>> from yandex.Translater import Translater
>>> tr = Translater()
>>> tr.set_key('yandex_key') # Api key found on https://translate.yandex.com/developers/keys
>>> tr.set_from_lang('en')
>>> tr.set_to_lang('ru')
>>> tr.translate()
Привет

METHODS
--------

Constructor:
^^^^^^^^^^^^^


.. code-block:: pycon
>>> tr = Translater(attributes)

This constructor returns a new object. Optional attributes include:

set_key
^^^^^^^^

.. code-block:: pycon

>>> tr.set_key('yandex_key')

This method is used to pass a Yandex API key (string),
instead of passing it in Constructor. A tr object can be
instantiated without any attributes.

set_text
^^^^^^^^^

.. code-block:: pycon

>>> tr.set_text('text_to_translate')

This method is used to pass a text to translate (string).

set_from_lang
^^^^^^^^^^^^^^

.. code-block:: python

>>> tr.set_from_lang('zh')

This method is used to pass a source language (string).
For example, Chinese would be given as zh.

set_to_lang
^^^^^^^^^^^^

.. code-block:: python

>>> tr.set_from_lang('ar')

This method is used to pass a destination language (string).
For example, Arabic would be given as ar.


set_ui
^^^^^^^

.. code-block:: python

>>> tr.set_ui('fr')

This method is used to set the user interface language (string).
For example, French would be given as fr.

set_default_ui
^^^^^^^^^^^^^^^

.. code-block:: python

>>> tr.set_default_ui('ru')

This method is used to set the default user interface language (string).
Either ru (Russian) or en (English) or tr (Turkish) can be given.

set_hint
^^^^^^^^^

.. code-block:: python

>>> tr.set_hint('es', 'pt')

This method is used to set the list of likely languages for
detecting the text language (array reference). For example,
Spanish and Portuguese would be given as attributes.

translate
^^^^^^^^^^

.. code-block:: python

>>> print tr.translate()

This method is used to get the translated text (string)

detect_lang
^^^^^^^^^^^^

.. code-block:: python

>>> print tr.detect_lang()

This method is used to detect the language of the text. It returns a string.

get_langs_list
^^^^^^^^^^^^^^^

.. code-block:: python

>>> print tr.get_langs_list()

This method is used to get the list of supported translation directions.
In array context, it returns an array of these directions; in scalar context,
it returns the count of them.


SEE ALSO
---------
For more information, please visit Yandex <https://translate.yandex.com/developers>.


SUPPORT
--------

Bugs / Feature Requests
^^^^^^^^^^^^^^^^^^^^^^^^

Please report any bugs or feature requests on my email or created in the website.
yandex-translate-bugs <https://pypi.org/project/yandex-translater/>


Source Code
^^^^^^^^^^^^

This is open source software. The code repository is available for
public review and contribution under the terms of the license.

https://pypi.org/project/yandex-translater/


AUTHORS
--------

James Axl <axlrose112@gmail.com>


COPYLEFT AND LICENSE
---------------------

This software is copyleft © 2017 by James Axl.

This is free software; you can redistribute it and/or
modify it under the same terms as the Perl 5 programming language system itself.

..
vim: filetype=rst



Metadata

Release files for yandex-translater 6.0

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

Source distribution (sdist)

Source distribution for yandex-translater 6.0
File Size Uploaded Provenance Actions
yandex-translater-6.0.tar.gz 9.0 kB Without provenance Details for yandex-translater-6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for yandex-translater 6.0
File Interpreter ABI Platform Actions
yandex_translater-6.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for yandex_translater-6.0-py2.py3-none-any.whl

Total release size: 14.2 kB

Release files / yandex-translater-6.0.tar.gz

Download URL yandex-translater-6.0.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7419f704849345f803b0e9aa64eb4c9be13102d8751e1bcd32e4711b91e0f803
BLAKE2b-256 checksum
How to use checksums
e2ad82950e16b88aaf08a57da658b086c54699dd9360dfbc7a9b094b5063eb21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

Release files / yandex_translater-6.0-py2.py3-none-any.whl

Download URL yandex_translater-6.0-py2.py3-none-any.whl
Size 5.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e83856a0ec84a1673dae5f136b1276d1a9fa0a82b9b180f0cdcd6491f7d5a9d9
BLAKE2b-256 checksum
How to use checksums
8cfac65a83cd5a0e9860f8dae2c4dd27f76bc100241508a2e29127f6c4f63b9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

Security for yandex-translater 6.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.

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