Skip to main content

pyplayht

Python wrapper for PlayHT API https://docs.play.ht/reference/api-getting-started

Installation

pip install pyplayht

Environmental Variables

Get your keys from https://play.ht/app/api-access

Name Value
PLAY_HT_USER_ID account user id
PLAY_HT_API_KEY account secret key

Sample Code

from pathlib import Path

from pyplayht.classes import Client

# create new client
client = Client()

# create new conversion job
job = client.new_conversion_job(
    text="Hello, World!",
    voice="en-US-JennyNeural",
)

# check job status
job = client.get_coversion_job_status(job.get("transcriptionId"))

# download audio from job
data = client.download_file(job.get('audioUrl'))

# do something with audio bytes
path = Path("demo.mp3")
path.write_bytes(data)

Developer Instructions

Run the dev setup scripts inside scripts directory

├── scripts
│   ├── setup-dev.bat # windows
│   └── setup-dev.sh # linux

Install the pyplayht package as editable https://setuptools.pypa.io/en/latest/userguide/development_mode.html

pip install -e .

When making a commit, use the command cz commit or cz c

You may also use the regular git commit command but make sure to follow the Conventional Commits specification https://www.conventionalcommits.org/en/v1.0.0/

Metadata

Release files for pyplayht 0.1.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 pyplayht 0.1.0
File Size Uploaded
pyplayht-0.1.0.tar.gz 18.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyplayht 0.1.0
File Interpreter ABI Platform
pyplayht-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 31.0 kB

Release files / pyplayht-0.1.0.tar.gz

Download URL pyplayht-0.1.0.tar.gz
Size 18.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b00f0f5d6bb07c8edb508394097b536c4dc912b0a569ff8675d87cc697740d7d
BLAKE2b-256 checksum
How to use checksums
b9d3720ad88de2c800a7b8fc272e6df530d9c948ff1433e50beecaed5a12668d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / pyplayht-0.1.0-py3-none-any.whl

Download URL pyplayht-0.1.0-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dedb1c8267236f53901eaa82fb8ede5414768e3f1d3115167e35761e3c11f281
BLAKE2b-256 checksum
How to use checksums
8e37d4340f4a2a2bc628fd4eeb017862ecaa6be23ce6508e5d5a07fcd743c635
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.0

2 release files

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