Skip to main content

Python client library for the LMNT API

Project description

LMNT Python Library

The LMNT Python library provides convenient access to the LMNT API from applications written in the Python language.

[Documentation]

Installation

Installing from PyPI is the quickest way to get started:

pip install --upgrade lmnt

Install from source with:

python setup.py install

Getting started

The most common operation you'll perform is a synthesize request. Given some text and a voice, it will return an audio file that you can play back. Take a look at our documentation for a deeper dive into the SDK.

import asyncio

from lmnt.api import Speech


LMNT_API_KEY = ...  # fill in your API key here


async def main():
  async with Speech(LMNT_API_KEY) as speech:
    synthesis = await speech.synthesize('Hello, world.', voice='lily', format='wav')
    with open('output.wav', 'wb') as f:
      f.write(synthesis['audio'])


asyncio.run(main())

While you can provide an api_key argument, we recommend using python-dotenv to add LMNT_API_KEY="My API Key" to your .env file so that your API key is not stored in source control.

More examples

You can find more examples in the demo directory.

License

Apache 2.0

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

lmnt-1.1.3.tar.gz (175.5 kB view details)

Uploaded Source

Built Distribution

lmnt-1.1.3-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file lmnt-1.1.3.tar.gz.

File metadata

  • Download URL: lmnt-1.1.3.tar.gz
  • Upload date:
  • Size: 175.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for lmnt-1.1.3.tar.gz
Algorithm Hash digest
SHA256 d58af3a65f57b3789fcfe772c6108e1792f400afef539fa24c239a5530075a51
MD5 b970cf13f5194591b816d4261454fa1b
BLAKE2b-256 1e6d9985b6832f0437dfcea673b2e0fd99d2167077788b7a8e6c77527003fde6

See more details on using hashes here.

File details

Details for the file lmnt-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: lmnt-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for lmnt-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 32aa2b3e64326fa02f55210413899400a54d37639436a099d6e8fbd83ed1c424
MD5 18fe13497f139ccb2f1e1bb0b574eb3d
BLAKE2b-256 139423c16d824d597353e78eb15103320edd8cef0c04d5a1ad3bc465da0ee042

See more details on using hashes here.

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