Talksign Python SDK
The official Python library for the Talksign API: turn speech or text into sign language video with Echo 2.0, in a few lines.
pip install talksign # REST client + live stream
pip install "talksign[video]" # + RGB frame decoder for video pipelines (PyAV, numpy)
Python 3.10+. Get an API key (sk-live-…) in the Developer Console
and set it as TALKSIGN_API_KEY.
REST quickstart
from talksign import Talksign
client = Talksign() # reads TALKSIGN_API_KEY
res = client.speech_to_sign.realtime("Hello, how are you?", avatar="arthur", language="asl")
for clip in res["data"]["playlist"]:
print(clip["gloss"], clip["url"])
print("cost:", res["usage"]["costUsd"], "USD")
# One rendered MP4 instead of a clip playlist
video = client.speech_to_sign.studio("Welcome to our store", avatar="amara")
print(video["data"]["download_url"])
print(client.balance.retrieve()["available_usd"])
Async: use AsyncTalksign — same resources, await every call.
| Resource | Methods |
|---|---|
speech_to_sign |
realtime, create, studio, gloss, video |
avatars |
list, get, create, delete, validate |
jobs |
create, get, list, cancel, wait |
speech_to_speech |
create |
voice |
create (MP3 bytes), create_json, voices |
sign_to_speech |
create (not available in the API yet: raises APIError 501) |
uploads, meetings |
create / create, get, stop |
models |
list, warmup |
usage, balance |
list, retrieve |
| client | openapi() |
Responses are plain dicts typed with TypedDicts from talksign.types.
Live signing from streamed text
client.echo.stream() turns text as it arrives (LLM tokens, TTS text) into an ordered stream of sign clips.
It cuts sentences, makes one realtime call per sentence with the next one prefetched, and can be interrupted.
import asyncio
from talksign import AsyncTalksign
async def main():
async with AsyncTalksign() as client:
stream = client.echo.stream(avatar="arthur", language="asl")
async def feed():
for chunk in ["Hi there! ", "How can I ", "help you today?"]:
stream.push_text(chunk)
await stream.aclose() # flush the rest, then "done"
asyncio.create_task(feed())
async for event in stream:
if event.type == "sentence":
print("signing:", event.text, event.glosses)
elif event.type == "clip":
print(" play", event.clip["gloss"], event.clip["url"])
elif event.type == "idle":
print("idle loop:", event.idle and event.idle["url"])
asyncio.run(main())
Events: sentence (has glosses, usage, has_missing), clip (in order; clips without a URL are skipped), interrupted, idle (reason: ready = the avatar's idle loop fetched at start with one free
GET /v1/avatars/{id}, so you can show the avatar before the first sentence; drained; interrupt), error (a sentence failed and was
skipped), done. Call stream.interrupt() when the user barges in: in-flight calls are aborted and the queue is dropped.
Each word's clip plays in_url → url from active_start_s to active_end_s → out_url; loop the idle clip in between.
Options of echo.stream(...):
chunking="sentence"(default) signs each sentence as soon as it is complete.chunking="full"buffers everything untilflush()/ close and signs it in one call (fewer calls, later start).first_chunk_chars=40(default): the first piece of each reply may be cut at a comma or clause once it has 40 characters, so the avatar starts sooner.0turns it off.fetch_idle=True(default): fetch the avatar's idle loop at start (free).Falseskips it.
Avatars and their idle loop
avatar = client.avatars.get("arthur") # free
idle = avatar["data"]["idle"] # {"url": ..., "expires_at": ...} or None
Every avatar from avatars.list() / avatars.get() carries idle, a short-lived signed URL of its idle loop.
Browser apps: short-lived tokens
Never put your secret key in a web page. Mint a short-lived token on your server and hand it to the page:
token = client.tokens.create(expires_in=600, allowed_origins=["https://app.example.com"])
# -> {"token": "tst_…", "expires_at": "…", "scopes": ["sign:realtime", "avatars:read"], ...}
The token can only call POST /v1/speech-to-sign/realtime and GET /v1/avatars[/{id}], bills your wallet like the
key, and ends when the key is revoked. Set allowed_origins in production. In the page, use the JavaScript SDK
(new Talksign({ token })).
Video frames (for video pipelines and agent plugins)
from talksign import AsyncTalksign
from talksign.video import EchoFrameSource
source = EchoFrameSource.from_client(AsyncTalksign(), avatar="arthur", width=1280, height=720, fps=30)
source.push_text("Nice to meet you.")
async for frame in source: # numpy uint8 array (720, 1280, 3), RGB, at 30 FPS
publish(frame)
It loops the idle clip while nothing is signing, crossfades between clips (150 ms), downloads clips with bounded
concurrency and an LRU cache, and decodes in a worker thread. source.interrupt() returns to idle at once.
The idle loop is fetched at start (free), so the avatar is visible from the first frame. With realtime=False
(offline rendering) frames are produced as fast as possible and never padded with idle/background frames while a
sentence is still being fetched or downloaded.
Errors and retries
All errors derive from talksign.TalksignError and carry status_code, code, param and request_id:
APIError (any HTTP error; base of) AuthenticationError (401), InsufficientBalanceError (402), PermissionDeniedError (403), NotFoundError (404),
BadRequestError (400/409/413/422), RateLimitError (429, retry_after), plus APIConnectionError / APITimeoutError. status is an alias of status_code.
429, 5xx and network errors are retried max_retries times (default 2) with exponential backoff, honouring Retry-After.
Every POST carries an Idempotency-Key (reused across retries), so a retried call is never charged twice. Pass your own
with idempotency_key=.
client = Talksign(api_key="sk-live-…", base_url="https://api.talksign.co", timeout=30, max_retries=3)
Licence
Apache-2.0. See LICENSE.
Metadata
Release files for talksign 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| talksign-0.2.0.tar.gz | 43.2 kB | Without provenance | Details for talksign-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| talksign-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for talksign-0.2.0-py3-none-any.whl |
Total release size: 79.6 kB
Release files / talksign-0.2.0.tar.gz
| Download URL | talksign-0.2.0.tar.gz |
|---|---|
| Size | 43.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d9da6c5ca65c3411d78a4cf491a3f469ed5232c18b7dd9c13610c707c2ab47a9
|
|
BLAKE2b-256 checksum How to use checksums |
81f61b3f3fb569745f6f0557e30b20b47e25246588b233c979ca96070054d438
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / talksign-0.2.0-py3-none-any.whl
| Download URL | talksign-0.2.0-py3-none-any.whl |
|---|---|
| Size | 36.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1e2c6836de3c80631f9bbe0146df18b4c5b69ada6629e0278a6a5aa51936a539
|
|
BLAKE2b-256 checksum How to use checksums |
bb7f53095883603f1ed76e9c901821269853afe44716c8f6a8cf30fbb987f949
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for talksign 0.2.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.