Official Python SDK for the Tuplets API
Project description
Tuplets Python SDK
Official Python SDK for the Tuplets API.
Installation
pip install tuplets-ai
Usage
from tuplets_ai import JobCreateParams, TupletsClient
client = TupletsClient(api_key="tb_your_api_key")
job = client.jobs.create_from_file(
"interview.mp3",
params=JobCreateParams(language="en", diarization=True),
)
final_job = client.jobs.wait(job.id)
if final_job.status == "completed":
transcript = client.jobs.download_result(job.id)
print(transcript["text"])
elif final_job.status == "failed":
print(final_job.error_message)
When diarization=True, speaker attribution is treated as required. If the API cannot produce usable diarization, the job finishes as failed and result remains null/None.
Direct Uploads
from tuplets_ai import JobCreateParams, TupletsClient
client = TupletsClient(api_key="tb_your_api_key")
upload = client.uploads.create_target(
filename="large-audio.wav",
size=12_000_000,
content_type="audio/wav",
)
client.uploads.upload_file(upload, "large-audio.wav")
job = client.jobs.create_from_uploaded_audio(
object_key=upload.object_key,
upload_token=upload.upload_token,
params=JobCreateParams(language="en", transcription_model="premium"),
)
Async Usage
from tuplets_ai import AsyncTupletsClient, JobCreateParams
async def main() -> None:
async with AsyncTupletsClient(api_key="tb_your_api_key") as client:
job = await client.jobs.create_from_url(
"https://storage.example.com/call.mp3",
params=JobCreateParams(language="en", pii_processing=True),
)
final_job = await client.jobs.wait(job.id)
if final_job.status == "completed":
transcript = await client.jobs.download_result(job.id)
print(transcript["text"])
elif final_job.status == "failed":
print(final_job.error_message)
Supported Resources
client.jobsfor transcription job submission, polling, cancellation, and result downloadclient.uploadsfor signed browser/direct upload targets
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
tuplets_ai-0.2.0.tar.gz
(7.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tuplets_ai-0.2.0.tar.gz.
File metadata
- Download URL: tuplets_ai-0.2.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30d18a822159312ff4ff4c2f71bf86e1a3ca605d49b48473942ee0c3aaa7f82e
|
|
| MD5 |
a48e3af3ce4673c3e3974141d990dcb0
|
|
| BLAKE2b-256 |
b4958dbf35fde4299cc89e0bcdf7fd6b3b9451ebf2dc3ae18983dcebdeaf7d42
|
File details
Details for the file tuplets_ai-0.2.0-py3-none-any.whl.
File metadata
- Download URL: tuplets_ai-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
646a0fcf7505278273fbb55492ffe93754f6bf8a7725f444ddc1d594732fff64
|
|
| MD5 |
ff1e275e37b3ac6c6e80a464854b1a36
|
|
| BLAKE2b-256 |
5fa329f4b854062be5028ef91a65987263dd18c141d516b159fe4634e917b7db
|