Official Python SDK for Yunmao APIs
Project description
Yunmao Python SDK
Official Python SDK for Yunmao APIs.
Install
pip install yunmao
Quick Start
from yunmao import YunmaoClient
client = YunmaoClient(
api_key="<YOUR_API_KEY>",
base_url="<YOUR_BASE_URL>",
)
Pass the appropriate base_url for your environment.
For API methods, supported parameters, and full examples, see the official Yunmao developer documentation.
Realtime ASR
async with client.asr.stream(
language_hint="<LANGUAGE_HINT>",
audio_format="pcm",
sample_rate=16000,
) as stream:
await stream.send(pcm16_chunk)
await stream.end()
async for event in stream:
print(event["type"])
client.asr.stream() uses Authorization: Bearer <YOUR_API_KEY> by default. If a WebSocket environment cannot set custom headers, pass auth="query".
Errors
from yunmao import YunmaoAPIError
try:
# Call a Yunmao API method here.
pass
except YunmaoAPIError as error:
print(error.status_code)
print(error.code)
print(error.message)
print(error.request_id)
The SDK preserves:
status_code: HTTP statuscode: Yunmao business error codemessage: server messagerequest_id: request id when the server provides itresponse_body: parsed raw response body
Test
python -m venv .venv
.venv/bin/python -m pip install -e ".[test]"
.venv/bin/python -m pytest
Automated tests use mocks and do not call paid APIs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 yunmao-0.1.10.tar.gz.
File metadata
- Download URL: yunmao-0.1.10.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9bfcaceb04058e3aa68a99fb5a973b31f8f126c39f44790cdc5b6282894368f
|
|
| MD5 |
dff39ffcd1ba5cf4ef4dba8ae0e5e300
|
|
| BLAKE2b-256 |
89d04a49223d8cadbe99ed45066bee155d28c2bdcf400c0e88145c73b6cae85f
|
File details
Details for the file yunmao-0.1.10-py3-none-any.whl.
File metadata
- Download URL: yunmao-0.1.10-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac22a0f0b2d4b13f85f4de442bae9b0d562d8ee7ef5d8bcb95ef2ca8486e7adb
|
|
| MD5 |
0db3edef48ddf9196a137fccf28f126d
|
|
| BLAKE2b-256 |
08efc18c26be88c62634e5a9f58b886c480967837f15aaf00a00ff20878466e5
|