typeless-sdk 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,97 @@
1
+ Typeless Python SDK License
2
+
3
+ Copyright (c) 2026 SIMPLY LLC. All rights reserved.
4
+
5
+ This software (the "SDK") is proprietary to SIMPLY LLC ("Typeless") and is
6
+ licensed, not sold. Your use of the SDK and of the Typeless services is also
7
+ governed by the Typeless Terms of Service at https://www.typeless.com/terms (the
8
+ "Terms"), which are incorporated by reference. Typeless's handling of personal
9
+ data is described in the Privacy Policy at https://www.typeless.com/privacy (the
10
+ "Privacy Policy"). With respect to the SDK, this license controls in the event of
11
+ a conflict; the Terms otherwise govern your use of the Typeless services.
12
+
13
+ BY INSTALLING, COPYING, OR OTHERWISE USING THE SDK, YOU AGREE TO BE BOUND BY
14
+ THIS LICENSE. IF YOU DO NOT AGREE, DO NOT INSTALL OR USE THE SDK.
15
+
16
+ 1. License Grant
17
+
18
+ Subject to your continued compliance with this license and the Terms, Typeless
19
+ grants you a limited, non-exclusive, non-transferable (except for the limited
20
+ distribution right in Section 2), revocable license to install and use the SDK
21
+ solely to develop and operate your own applications and services that access
22
+ the Typeless External Transcript API (the "Typeless API").
23
+
24
+ 2. Limited Distribution Exception
25
+
26
+ Notwithstanding the non-transferability in Section 1, you may reproduce and
27
+ distribute unmodified copies of the SDK solely as an embedded dependency of
28
+ your own applications and services that call the Typeless API — including
29
+ commercial products — and solely to the end users of those applications for
30
+ use with them. This is a limited distribution right only. You may not
31
+ distribute the SDK on a standalone basis, and you may not grant your end users
32
+ or any third party the right to further redistribute the SDK separately from
33
+ your application.
34
+
35
+ 3. Restrictions
36
+
37
+ Except as expressly permitted in Section 2 or the Terms, you may not:
38
+
39
+ (a) distribute, publish, sublicense, sell, rent, lease, or otherwise make the
40
+ SDK available on a standalone basis, or as part of any product whose
41
+ primary purpose is to redistribute the SDK itself;
42
+ (b) modify, adapt, translate, or create derivative works of the SDK, or
43
+ distribute any such modified or derivative version;
44
+ (c) reverse engineer, decompile, or disassemble the SDK, except to the extent
45
+ this restriction is prohibited by applicable law;
46
+ (d) remove, alter, or obscure any proprietary notices in the SDK; or
47
+ (e) use the SDK to access any service other than the Typeless API.
48
+
49
+ 4. API Credentials
50
+
51
+ API keys and tokens are confidential. You must not embed them in publicly
52
+ distributed client applications, public code repositories, or any other
53
+ location from which they can be extracted, and you must not share, sublicense,
54
+ resell, or otherwise transfer them. You are responsible for all activity that
55
+ occurs under your credentials.
56
+
57
+ 5. Reservation of Rights
58
+
59
+ The SDK is licensed, not sold, and Typeless retains all right, title, and
60
+ interest in and to the SDK. No rights are granted by implication or estoppel.
61
+ This license grants no right to use any Typeless name, logo, or trademark, and
62
+ grants no right of access to the Typeless service, API quota or capacity, or
63
+ any service level (SLA), all of which are governed solely by the Terms and
64
+ your plan.
65
+
66
+ 6. Third-Party Components
67
+
68
+ The SDK depends on third-party open-source packages (including httpx and
69
+ websockets), each licensed under its own terms. See THIRD_PARTY_NOTICES.md.
70
+ Nothing in this license limits your rights under those third-party licenses.
71
+
72
+ 7. Disclaimer of Warranty
73
+
74
+ THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE", WITHOUT WARRANTY OF ANY KIND,
75
+ WHETHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING THE IMPLIED WARRANTIES OF
76
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. Any
77
+ additional warranty terms in the Terms also apply.
78
+
79
+ 8. Limitation of Liability
80
+
81
+ TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, TYPELESS WILL NOT BE LIABLE
82
+ FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR
83
+ FOR ANY LOSS OF PROFITS, REVENUE, OR DATA, ARISING OUT OF OR RELATED TO YOUR
84
+ USE OF THE SDK, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. The
85
+ limitations of liability in the Terms also apply.
86
+
87
+ 9. Termination
88
+
89
+ This license terminates automatically if you breach it or the Terms. Upon
90
+ termination you must stop using the SDK and delete all copies in your
91
+ possession or control, except that you may retain one copy solely for archival
92
+ or legal-compliance purposes. Sections 3 through 8 and this Section 9 survive
93
+ termination.
94
+
95
+ 10. Contact
96
+
97
+ Questions about this license: hello@typeless.com.
@@ -0,0 +1,352 @@
1
+ Metadata-Version: 2.4
2
+ Name: typeless-sdk
3
+ Version: 0.1.0
4
+ Summary: Official Python SDK for the Typeless External Transcript API
5
+ Keywords: transcription,speech-to-text,api,typeless,websocket
6
+ Author: Typeless
7
+ Author-email: Typeless <hello@typeless.com>
8
+ License-Expression: LicenseRef-Proprietary
9
+ License-File: LICENSE
10
+ License-File: THIRD_PARTY_NOTICES.md
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Classifier: Typing :: Typed
21
+ Requires-Dist: httpx>=0.24,<0.29
22
+ Requires-Dist: websockets>=14.0,<17.0
23
+ Requires-Python: >=3.10
24
+ Project-URL: Homepage, https://www.typeless.com/
25
+ Project-URL: Documentation, https://docs.typelessapi.com
26
+ Project-URL: Console, https://platform.typelessapi.com
27
+ Project-URL: Changelog, https://docs.typelessapi.com/sdk/python#changelog
28
+ Project-URL: Terms of Service, https://www.typeless.com/terms
29
+ Description-Content-Type: text/markdown
30
+
31
+ # Typeless Python SDK
32
+
33
+ Official Python SDK for the [Typeless External Transcript API](https://docs.typelessapi.com).
34
+
35
+ ## Installation
36
+
37
+ Requires Python 3.10 or later.
38
+
39
+ ```bash
40
+ pip install typeless-sdk
41
+ ```
42
+
43
+ ## Quick Start
44
+
45
+ ```python
46
+ from typeless import TypelessClient
47
+
48
+ client = TypelessClient(api_key="tls_sk_xxx")
49
+ result = client.transcribe("recording.wav", model="typeless-1.0-max")
50
+
51
+ print(result.transcript)
52
+ print(result.detected_language)
53
+ print(result.duration_seconds)
54
+ print(result.request_id)
55
+ print(result.usage.billed_audio_seconds)
56
+ ```
57
+
58
+ ## Authentication
59
+
60
+ Read the API key from the environment:
61
+
62
+ ```bash
63
+ export TYPELESS_API_KEY=tls_sk_xxx
64
+ ```
65
+
66
+ ```python
67
+ from typeless import TypelessClient
68
+
69
+ client = TypelessClient()
70
+ ```
71
+
72
+ You can also override the API base URL:
73
+
74
+ ```bash
75
+ export TYPELESS_BASE_URL=https://api.typelessapi.com
76
+ ```
77
+
78
+ ## Audio Input
79
+
80
+ `transcribe()` accepts a file path, in-memory bytes, or a readable binary file object.
81
+ The API detects the audio format from the file content.
82
+ Supported container formats include WAV, OGG (Opus), and WebM.
83
+
84
+ ```python
85
+ # file path
86
+ result = client.transcribe("recording.wav", model="typeless-1.0-max")
87
+
88
+ # in-memory bytes
89
+ result = client.transcribe(audio_bytes, model="typeless-1.0-max")
90
+
91
+ # binary file object
92
+ with open("recording.wav", "rb") as audio_file:
93
+ result = client.transcribe(audio_file, model="typeless-1.0-max")
94
+ ```
95
+
96
+ Optional language hint:
97
+
98
+ ```python
99
+ result = client.transcribe("recording.wav", model="typeless-1.0-max", language="zh")
100
+ ```
101
+
102
+ ## Models
103
+
104
+ The `model` parameter is required on every request.
105
+ The SDK does not inject a default model.
106
+
107
+ | Tier | Model name |
108
+ | --- | --- |
109
+ | Lite | `typeless-1.0-lite` |
110
+ | Pro | `typeless-1.0-pro` |
111
+ | Max | `typeless-1.0-max` |
112
+
113
+ Unknown model values are rejected by the API with `INVALID_REQUEST`.
114
+
115
+ ## Limits
116
+
117
+ Per-request limits are enforced by the API and may vary by account.
118
+ Typical defaults include a maximum file size of about 50 MB and a maximum audio
119
+ duration of about 300 seconds per request.
120
+
121
+ ## WebSocket Streaming
122
+
123
+ Use `stream()` for real-time raw PCM16 audio such as microphone capture.
124
+ For offline files in WAV, OGG, or WebM format, use HTTP `transcribe()` instead.
125
+
126
+ ```python
127
+ from typeless import AudioReceived, StreamResult
128
+ from typeless.exceptions import TypelessError
129
+
130
+ client = TypelessClient(api_key="tls_sk_xxx")
131
+
132
+ with client.stream(
133
+ model="typeless-1.0-max",
134
+ sample_rate=16000,
135
+ channels=1,
136
+ read_timeout=None,
137
+ ) as conn:
138
+ conn.send(pcm_chunk_bytes)
139
+ conn.send(pcm_chunk_bytes)
140
+ conn.finish()
141
+
142
+ try:
143
+ for msg in conn:
144
+ if isinstance(msg, AudioReceived):
145
+ print(f"processed {msg.duration_seconds}s")
146
+ elif isinstance(msg, StreamResult):
147
+ print(msg.transcript)
148
+ print(msg.detected_language)
149
+ except TypelessError as exc:
150
+ print(f"stream failed: [{exc.code}] {exc.message}")
151
+ ```
152
+
153
+ `send()` accepts raw PCM16 bytes only (16-bit signed integer, little-endian).
154
+ The SDK sends keep-alive messages automatically while the connection is open.
155
+
156
+ | Parameter | Description |
157
+ | --- | --- |
158
+ | `channels` | Number of audio channels from 1 to 2 (default `1`) |
159
+ | `read_timeout` | Maximum seconds to wait for each server message during iteration, or `None` for no limit |
160
+
161
+ ## Async Client
162
+
163
+ ```python
164
+ from typeless import AsyncTypelessClient
165
+ import asyncio
166
+
167
+ async def main() -> None:
168
+ async with AsyncTypelessClient(api_key="tls_sk_xxx") as client:
169
+ result = await client.transcribe("audio.wav", model="typeless-1.0-max")
170
+
171
+ results = await asyncio.gather(
172
+ client.transcribe("a.wav", model="typeless-1.0-max"),
173
+ client.transcribe("b.wav", model="typeless-1.0-max"),
174
+ client.transcribe("c.wav", model="typeless-1.0-max"),
175
+ )
176
+
177
+ asyncio.run(main())
178
+ ```
179
+
180
+ Async streaming:
181
+
182
+ ```python
183
+ from typeless import AsyncTypelessClient, StreamResult
184
+ from typeless.exceptions import TypelessError
185
+
186
+ async with AsyncTypelessClient(api_key="tls_sk_xxx") as client:
187
+ async with client.stream(model="typeless-1.0-max", sample_rate=16000) as conn:
188
+ await conn.send(pcm_chunk_bytes)
189
+ await conn.finish()
190
+ try:
191
+ async for msg in conn:
192
+ if isinstance(msg, StreamResult):
193
+ print(msg.transcript)
194
+ except TypelessError as exc:
195
+ print(f"stream failed: [{exc.code}] {exc.message}")
196
+ ```
197
+
198
+ ## Error Handling
199
+
200
+ ```python
201
+ from typeless.exceptions import (
202
+ APIConnectionError,
203
+ APITimeoutError,
204
+ AudioFormatError,
205
+ AudioTooLargeError,
206
+ AudioTooLongError,
207
+ AuthenticationError,
208
+ ConcurrentLimitError,
209
+ InsufficientBalanceError,
210
+ InvalidRequestError,
211
+ RateLimitError,
212
+ TypelessError,
213
+ )
214
+
215
+ try:
216
+ result = client.transcribe("audio.wav", model="typeless-1.0-max")
217
+ except AuthenticationError:
218
+ print("invalid api key")
219
+ except InvalidRequestError as exc:
220
+ print(f"invalid request: {exc.message}")
221
+ except RateLimitError as exc:
222
+ print(f"rate limited, retry after {exc.retry_after}s")
223
+ except InsufficientBalanceError:
224
+ print("insufficient account balance")
225
+ except AudioTooLongError as exc:
226
+ print(
227
+ f"audio too long: limit {exc.max_duration_seconds}s, "
228
+ f"actual {exc.actual_duration_seconds}s"
229
+ )
230
+ except AudioFormatError as exc:
231
+ print(f"unsupported format: {exc.supported_formats}")
232
+ except AudioTooLargeError as exc:
233
+ print(f"file too large: limit {exc.max_size_bytes} bytes")
234
+ except ConcurrentLimitError as exc:
235
+ print(f"concurrent limit exceeded: {exc.message}")
236
+ except APIConnectionError as exc:
237
+ print(f"connection failed: {exc.message}")
238
+ except APITimeoutError as exc:
239
+ print(f"request timed out: {exc.message}")
240
+ except TypelessError as exc:
241
+ print(f"[{exc.code}] {exc.message} (req_id={exc.request_id})")
242
+ ```
243
+
244
+ ## Configuration
245
+
246
+ ```python
247
+ client = TypelessClient(
248
+ api_key="tls_sk_xxx",
249
+ base_url="https://api.typelessapi.com",
250
+ timeout=300.0,
251
+ max_retries=3,
252
+ )
253
+ ```
254
+
255
+ | Parameter | Description |
256
+ | --- | --- |
257
+ | `api_key` | API key, or read from `TYPELESS_API_KEY` when omitted |
258
+ | `base_url` | API base URL, or read from `TYPELESS_BASE_URL` when omitted |
259
+ | `timeout` | Request timeout in seconds (default `300`) |
260
+ | `max_retries` | Maximum retries for transient HTTP failures (default `3`) |
261
+
262
+ ## Resource Management
263
+
264
+ Reuse a single client instance across multiple requests so the HTTP connection pool can reuse TCP connections.
265
+
266
+ ```python
267
+ with TypelessClient(api_key="tls_sk_xxx") as client:
268
+ result = client.transcribe("audio.wav", model="typeless-1.0-max")
269
+ ```
270
+
271
+ ```python
272
+ client = TypelessClient(api_key="tls_sk_xxx")
273
+ try:
274
+ result = client.transcribe("audio.wav", model="typeless-1.0-max")
275
+ finally:
276
+ client.close()
277
+ ```
278
+
279
+ Async client:
280
+
281
+ ```python
282
+ async with AsyncTypelessClient(api_key="tls_sk_xxx") as client:
283
+ result = await client.transcribe("audio.wav", model="typeless-1.0-max")
284
+ ```
285
+
286
+ ## Response Fields
287
+
288
+ A successful HTTP transcription returns a `TranscriptResult`:
289
+
290
+ | Field | Description |
291
+ | --- | --- |
292
+ | `transcript` | Final transcript text |
293
+ | `detected_language` | Detected language code, or `None` when unknown |
294
+ | `duration_seconds` | Audio duration in seconds |
295
+ | `request_id` | Request identifier for support |
296
+ | `usage.billed_audio_seconds` | Billed audio duration in seconds |
297
+ | `usage.output_token_count` | Output token count reported by the API |
298
+
299
+ ## Logging
300
+
301
+ The SDK uses the standard library `logging` module with logger name `typeless`.
302
+ By default it attaches a `NullHandler` and does not write to stderr.
303
+
304
+ ```python
305
+ import logging
306
+
307
+ logging.getLogger("typeless").setLevel(logging.DEBUG)
308
+ ```
309
+
310
+ ## Development
311
+
312
+ Install the package and development dependencies in your local environment:
313
+
314
+ ```bash
315
+ pip install typeless-sdk
316
+ uv sync
317
+ uv run ruff check src/typeless tests
318
+ uv run mypy
319
+ uv run pytest -m "not integration" -q
320
+ uv build --no-sources
321
+ ```
322
+
323
+ ### Integration tests
324
+
325
+ Unit tests run by default and do not require API credentials.
326
+ Integration tests call a live API endpoint.
327
+
328
+ ```bash
329
+ export TYPELESS_API_KEY=tls_sk_xxx
330
+ export TYPELESS_BASE_URL=https://your-test-endpoint
331
+ uv run pytest tests/integration -m integration -v
332
+ ```
333
+
334
+ ## Support
335
+
336
+ Questions, bug reports, or access requests: email [hello@typeless.com](mailto:hello@typeless.com)
337
+ and include the `request_id` from any failed response.
338
+
339
+ ## License
340
+
341
+ Proprietary. See the [LICENSE](LICENSE) file. Use of this SDK is also subject to
342
+ the Typeless [Terms of Service](https://www.typeless.com/terms) and
343
+ [Privacy Policy](https://www.typeless.com/privacy).
344
+
345
+ You may install the SDK and distribute it, unmodified, as an embedded dependency
346
+ of your own applications (including commercial products) that call the Typeless
347
+ API, and to the end users of those applications. Standalone redistribution,
348
+ modification, and reverse engineering are not permitted. See the LICENSE file for
349
+ the full terms.
350
+
351
+ Third-party open-source components are listed in
352
+ [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).