Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

A library for Yandex speech kit

Project description


.. image::

.. image::

.. image::

Use ``Pip``, Luke

.. code-block:: bash

$ pip install yandex_speech

`Text to speech <>`_

Speech to text (not ready)

`Natural language understanding <>`_


Text to speech
Generation of speech using `Yandex SpeechKit <>`_.
SpeechKit Cloud allows you to voice any text in Russian, English, Turkish, or Ukrainian.
You can choose the voice (male or female), tempo and intonation (e.g., joy).

.. code-block:: python

>>> from yandex_speech import TTS
>>> tts = TTS("jane", "mp3", "60589d42-0e42-b742-8942-thekeyisalie")
>>> tts.generate("Привет мир")

TTS(speaker, audio_format, key, lang="ru‑RU", emotion="neutral", speed=1)
- ``speaker`` - Speaker. Female: "jane", "oksana", "alyss", "omazh". Male: "zahar", "ermil";
- ``audio_format`` - Audio file format: "mp3", "wav", "opus";
- ``key`` - `API‑key for Yandex speech kit <>`_.
- ``lang`` (optional) - Language: "ru‑RU" (by default), "en-US", "tr-TR", "uk-UK";
- ``emotion`` (optional) - The color of the voice: "neutral" (by default), "evil", "good";
- ``speed`` (optional) - Speech tempo: a value between 0.1 (slowest) to 3.0 (fastest).

- ``text`` - Text to speech: "з+амок" (before the stressed vowel can be put "+"; the restriction on line length: 2000 bytes);"speech")
- ``path`` (optional) - A path to save file: "test", "dirname/test.mp3", ...;
Returns the path.

`Overview tts technology

`The format of request and response


Natural language understanding
Natural language understanding is a technology that allows you to find certain objects in arbitrary text and mark them.

.. code-block:: python

>>> from yandex_speech import NLU
>>> nlu = NLU("60589d42-0e42-b742-8942-thekeyisalie")
>>> nlu.parse("31 апреля родился Хлусов Геннадий Викторович", ("Date", "Fio"))
{'Date': [{'Tokens': {'Begin': 0, 'End': 2}, 'Month': 4, 'Day': 31}], 'Fio': [{'Patronymic': 'викторович', 'Type': 'fioname', 'Tokens': {'Begin': 3, 'End': 6}, 'FirstName': 'генадий', 'LastName': 'хлусов'}]}

- ``key`` - `API‑key for Yandex speech kit <>`_.

NLU.parse(text, layers=None)
- ``text`` - Text to parse.
- ``layers`` (optional) - Special fields. Only one string or iterable object (e.g "Data", ("Data", "Fio")). Only these fields will be returned.

Returns the parsed text into a json object.


`Overview nlu technology

The format of `request <>`_ and `response <>`_

Project details

Release history Release notifications

This version
History Node


History Node


History Node


History Node


History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
yandex_speech-0.4.tar.gz (4.6 kB) Copy SHA256 hash SHA256 Source None Jan 15, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page