verbum-sdk 1.0.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.
- verbum_sdk-1.0.0/.github/workflows/ci.yml +218 -0
- verbum_sdk-1.0.0/.gitignore +19 -0
- verbum_sdk-1.0.0/.gitmodules +3 -0
- verbum_sdk-1.0.0/CHANGELOG.md +71 -0
- verbum_sdk-1.0.0/LICENSE +21 -0
- verbum_sdk-1.0.0/PKG-INFO +234 -0
- verbum_sdk-1.0.0/PR_VSDK-763.md +177 -0
- verbum_sdk-1.0.0/PR_VSDK-764.md +148 -0
- verbum_sdk-1.0.0/PR_VSDK-765.md +165 -0
- verbum_sdk-1.0.0/PR_VSDK-766.md +193 -0
- verbum_sdk-1.0.0/PR_VSDK-857.md +95 -0
- verbum_sdk-1.0.0/PUBLISHING.md +192 -0
- verbum_sdk-1.0.0/README.md +186 -0
- verbum_sdk-1.0.0/docs/api/auth.rst +10 -0
- verbum_sdk-1.0.0/docs/api/client.rst +10 -0
- verbum_sdk-1.0.0/docs/api/index.rst +18 -0
- verbum_sdk-1.0.0/docs/api/rest.rst +51 -0
- verbum_sdk-1.0.0/docs/api/stt.rst +14 -0
- verbum_sdk-1.0.0/docs/api/ws.rst +10 -0
- verbum_sdk-1.0.0/docs/changelog.rst +5 -0
- verbum_sdk-1.0.0/docs/conf.py +67 -0
- verbum_sdk-1.0.0/docs/index.rst +21 -0
- verbum_sdk-1.0.0/docs/quickstart.rst +56 -0
- verbum_sdk-1.0.0/examples/README.md +57 -0
- verbum_sdk-1.0.0/examples/batch_transcribe.py +90 -0
- verbum_sdk-1.0.0/examples/stt_async.py +75 -0
- verbum_sdk-1.0.0/examples/stt_microphone.py +105 -0
- verbum_sdk-1.0.0/examples/stt_sync.py +71 -0
- verbum_sdk-1.0.0/examples/text_analysis.py +74 -0
- verbum_sdk-1.0.0/examples/translate.py +65 -0
- verbum_sdk-1.0.0/examples/tts_synthesize.py +86 -0
- verbum_sdk-1.0.0/notebooks/realtime_transcription.ipynb +307 -0
- verbum_sdk-1.0.0/pyproject.toml +104 -0
- verbum_sdk-1.0.0/specs/PROTOCOL.md +614 -0
- verbum_sdk-1.0.0/specs/README.md +175 -0
- verbum_sdk-1.0.0/specs/conformance/README.md +151 -0
- verbum_sdk-1.0.0/specs/conformance/adapter/PROTOCOL.md +243 -0
- verbum_sdk-1.0.0/specs/conformance/adapter/README.md +254 -0
- verbum_sdk-1.0.0/specs/conformance/adapter/reference/.gitignore +2 -0
- verbum_sdk-1.0.0/specs/conformance/adapter/reference/package-lock.json +150 -0
- verbum_sdk-1.0.0/specs/conformance/adapter/reference/package.json +22 -0
- verbum_sdk-1.0.0/specs/conformance/adapter/reference/src/index.ts +240 -0
- verbum_sdk-1.0.0/specs/conformance/adapter/reference/tsconfig.json +17 -0
- verbum_sdk-1.0.0/specs/conformance/runner/.gitignore +4 -0
- verbum_sdk-1.0.0/specs/conformance/runner/package-lock.json +145 -0
- verbum_sdk-1.0.0/specs/conformance/runner/package.json +30 -0
- verbum_sdk-1.0.0/specs/conformance/runner/pnpm-lock.yaml +107 -0
- verbum_sdk-1.0.0/specs/conformance/runner/src/assertions.ts +119 -0
- verbum_sdk-1.0.0/specs/conformance/runner/src/index.ts +141 -0
- verbum_sdk-1.0.0/specs/conformance/runner/src/loader.ts +96 -0
- verbum_sdk-1.0.0/specs/conformance/runner/src/reporter.ts +81 -0
- verbum_sdk-1.0.0/specs/conformance/runner/src/runner.ts +459 -0
- verbum_sdk-1.0.0/specs/conformance/runner/src/types.ts +179 -0
- verbum_sdk-1.0.0/specs/conformance/runner/tsconfig.json +18 -0
- verbum_sdk-1.0.0/specs/conformance/schema/test-case.schema.json +260 -0
- verbum_sdk-1.0.0/specs/conformance/suite/TC-001-valid-auth.yaml +26 -0
- verbum_sdk-1.0.0/specs/conformance/suite/TC-002-invalid-auth.yaml +34 -0
- verbum_sdk-1.0.0/specs/conformance/suite/TC-003-audio-transcript.yaml +46 -0
- verbum_sdk-1.0.0/specs/conformance/suite/TC-004-reconnection.yaml +51 -0
- verbum_sdk-1.0.0/specs/conformance/suite/TC-005-graceful-disconnect.yaml +43 -0
- verbum_sdk-1.0.0/specs/conformance/suite/TC-006-partial-final-transcript.yaml +52 -0
- verbum_sdk-1.0.0/specs/fixtures/audio/.gitkeep +0 -0
- verbum_sdk-1.0.0/specs/fixtures/audio/en-US_hello_8k.pcm +0 -0
- verbum_sdk-1.0.0/specs/fixtures/audio/en-US_long_sentence_16k.pcm +0 -0
- verbum_sdk-1.0.0/specs/fixtures/audio/en-US_short_sentence_8k.pcm +0 -0
- verbum_sdk-1.0.0/specs/fixtures/audio/es-ES_hola_8k.pcm +0 -0
- verbum_sdk-1.0.0/specs/fixtures/audio/fr-FR_bonjour_8k.pcm +0 -0
- verbum_sdk-1.0.0/specs/fixtures/transcripts/.gitkeep +0 -0
- verbum_sdk-1.0.0/specs/fixtures/transcripts/en-US_hello_8k.json +7 -0
- verbum_sdk-1.0.0/specs/fixtures/transcripts/en-US_long_sentence_16k.json +7 -0
- verbum_sdk-1.0.0/specs/fixtures/transcripts/en-US_short_sentence_8k.json +7 -0
- verbum_sdk-1.0.0/specs/fixtures/transcripts/es-ES_hola_8k.json +7 -0
- verbum_sdk-1.0.0/specs/fixtures/transcripts/fr-FR_bonjour_8k.json +7 -0
- verbum_sdk-1.0.0/src/verbum/__init__.py +54 -0
- verbum_sdk-1.0.0/src/verbum/_types.py +29 -0
- verbum_sdk-1.0.0/src/verbum/_version.py +1 -0
- verbum_sdk-1.0.0/src/verbum/auth/__init__.py +15 -0
- verbum_sdk-1.0.0/src/verbum/auth/types.py +59 -0
- verbum_sdk-1.0.0/src/verbum/client.py +122 -0
- verbum_sdk-1.0.0/src/verbum/py.typed +0 -0
- verbum_sdk-1.0.0/src/verbum/rest/__init__.py +272 -0
- verbum_sdk-1.0.0/src/verbum/rest/_serde.py +14 -0
- verbum_sdk-1.0.0/src/verbum/rest/invitations.py +20 -0
- verbum_sdk-1.0.0/src/verbum/rest/metrics.py +20 -0
- verbum_sdk-1.0.0/src/verbum/rest/projects.py +20 -0
- verbum_sdk-1.0.0/src/verbum/rest/scribe.py +286 -0
- verbum_sdk-1.0.0/src/verbum/rest/speech.py +107 -0
- verbum_sdk-1.0.0/src/verbum/rest/text_analysis.py +243 -0
- verbum_sdk-1.0.0/src/verbum/rest/translator.py +119 -0
- verbum_sdk-1.0.0/src/verbum/rest/types.py +466 -0
- verbum_sdk-1.0.0/src/verbum/rest/usage.py +63 -0
- verbum_sdk-1.0.0/src/verbum/rest/users.py +20 -0
- verbum_sdk-1.0.0/src/verbum/stt/__init__.py +197 -0
- verbum_sdk-1.0.0/src/verbum/stt/session.py +395 -0
- verbum_sdk-1.0.0/src/verbum/stt/types.py +64 -0
- verbum_sdk-1.0.0/src/verbum/ws/__init__.py +438 -0
- verbum_sdk-1.0.0/src/verbum/ws/types.py +154 -0
- verbum_sdk-1.0.0/tests/conformance/adapter.py +151 -0
- verbum_sdk-1.0.0/tests/integration/.gitkeep +0 -0
- verbum_sdk-1.0.0/tests/integration/conftest.py +54 -0
- verbum_sdk-1.0.0/tests/integration/test_auth.py +33 -0
- verbum_sdk-1.0.0/tests/integration/test_rest.py +61 -0
- verbum_sdk-1.0.0/tests/unit/test_coverage_gaps.py +844 -0
- verbum_sdk-1.0.0/tests/unit/test_package.py +38 -0
- verbum_sdk-1.0.0/tests/unit/test_rest_client.py +175 -0
- verbum_sdk-1.0.0/tests/unit/test_rest_resources.py +612 -0
- verbum_sdk-1.0.0/tests/unit/test_session_features.py +511 -0
- verbum_sdk-1.0.0/tests/unit/test_stt_session.py +143 -0
- verbum_sdk-1.0.0/tests/unit/test_ws_transport.py +632 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
tags: ['v*.*.*']
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [main]
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
13
|
+
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
# ── Lint ────────────────────────────────────────────────────────────────────
|
|
17
|
+
lint:
|
|
18
|
+
name: Lint
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: '3.12'
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: pip install -e ".[dev]"
|
|
29
|
+
|
|
30
|
+
- name: ruff check
|
|
31
|
+
run: ruff check .
|
|
32
|
+
|
|
33
|
+
- name: ruff format --check
|
|
34
|
+
run: ruff format --check .
|
|
35
|
+
|
|
36
|
+
# ── Type Check ──────────────────────────────────────────────────────────────
|
|
37
|
+
typecheck:
|
|
38
|
+
name: Type Check
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
steps:
|
|
41
|
+
- uses: actions/checkout@v4
|
|
42
|
+
|
|
43
|
+
- uses: actions/setup-python@v5
|
|
44
|
+
with:
|
|
45
|
+
python-version: '3.12'
|
|
46
|
+
|
|
47
|
+
- name: Install dependencies
|
|
48
|
+
run: pip install -e ".[dev]"
|
|
49
|
+
|
|
50
|
+
- name: mypy
|
|
51
|
+
run: mypy
|
|
52
|
+
|
|
53
|
+
- name: mypy (examples)
|
|
54
|
+
run: mypy examples/
|
|
55
|
+
|
|
56
|
+
# ── Unit Tests ──────────────────────────────────────────────────────────────
|
|
57
|
+
test-unit:
|
|
58
|
+
name: Unit Tests / Python ${{ matrix.python-version }}
|
|
59
|
+
runs-on: ubuntu-latest
|
|
60
|
+
strategy:
|
|
61
|
+
fail-fast: false
|
|
62
|
+
matrix:
|
|
63
|
+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
|
|
64
|
+
steps:
|
|
65
|
+
- uses: actions/checkout@v4
|
|
66
|
+
|
|
67
|
+
- uses: actions/setup-python@v5
|
|
68
|
+
with:
|
|
69
|
+
python-version: ${{ matrix.python-version }}
|
|
70
|
+
|
|
71
|
+
- name: Install dependencies
|
|
72
|
+
run: pip install -e ".[dev]"
|
|
73
|
+
|
|
74
|
+
- name: pytest (unit + coverage ≥90 %)
|
|
75
|
+
run: pytest --cov --cov-report=term-missing --cov-fail-under=90
|
|
76
|
+
|
|
77
|
+
# ── Integration Tests ───────────────────────────────────────────────────────
|
|
78
|
+
# Skipped automatically when VERBUM_SDK_TEST_API_KEY is not configured.
|
|
79
|
+
# Set the secret (organisation-level) and the VERBUM_SDK_TEST_BASE_URL
|
|
80
|
+
# variable to enable live testing.
|
|
81
|
+
test-integration:
|
|
82
|
+
name: Integration Tests
|
|
83
|
+
runs-on: ubuntu-latest
|
|
84
|
+
needs: [lint, typecheck]
|
|
85
|
+
env:
|
|
86
|
+
VERBUM_SDK_TEST_API_KEY: ${{ secrets.VERBUM_SDK_TEST_API_KEY }}
|
|
87
|
+
VERBUM_SDK_TEST_BASE_URL: ${{ vars.VERBUM_SDK_TEST_BASE_URL || 'wss://sdk.verbum.ai' }}
|
|
88
|
+
steps:
|
|
89
|
+
- uses: actions/checkout@v4
|
|
90
|
+
|
|
91
|
+
- uses: actions/setup-python@v5
|
|
92
|
+
with:
|
|
93
|
+
python-version: '3.12'
|
|
94
|
+
|
|
95
|
+
- name: Install dependencies
|
|
96
|
+
run: pip install -e ".[dev]"
|
|
97
|
+
|
|
98
|
+
- name: pytest (integration)
|
|
99
|
+
run: pytest tests/integration/ -v -p no:cacheprovider
|
|
100
|
+
|
|
101
|
+
# ── Conformance Suite (mandatory gate) ─────────────────────────────────────
|
|
102
|
+
conformance:
|
|
103
|
+
name: Conformance Suite
|
|
104
|
+
runs-on: ubuntu-latest
|
|
105
|
+
needs: [test-unit]
|
|
106
|
+
env:
|
|
107
|
+
VERBUM_SDK_API_KEY: ${{ secrets.VERBUM_SDK_TEST_API_KEY }}
|
|
108
|
+
VERBUM_SDK_BASE_URL: ${{ vars.VERBUM_SDK_TEST_BASE_URL || 'wss://sdk.verbum.ai' }}
|
|
109
|
+
steps:
|
|
110
|
+
# Do NOT use submodules: recursive — the specs submodule URL may be
|
|
111
|
+
# inaccessible (private / not yet published). A dedicated step below
|
|
112
|
+
# handles the init and sets an output flag so downstream steps can skip
|
|
113
|
+
# gracefully without failing the job.
|
|
114
|
+
- uses: actions/checkout@v4
|
|
115
|
+
|
|
116
|
+
- name: Initialize specs submodule
|
|
117
|
+
id: specs
|
|
118
|
+
run: |
|
|
119
|
+
if git submodule update --init --depth=1 specs 2>/dev/null; then
|
|
120
|
+
echo "available=true" >> "$GITHUB_OUTPUT"
|
|
121
|
+
else
|
|
122
|
+
echo "::warning::specs submodule could not be fetched (repo may be private or not yet published) — conformance suite will be skipped."
|
|
123
|
+
echo "available=false" >> "$GITHUB_OUTPUT"
|
|
124
|
+
fi
|
|
125
|
+
|
|
126
|
+
- uses: actions/setup-node@v4
|
|
127
|
+
if: steps.specs.outputs.available == 'true'
|
|
128
|
+
with:
|
|
129
|
+
node-version: '22'
|
|
130
|
+
|
|
131
|
+
- name: Install pnpm
|
|
132
|
+
if: steps.specs.outputs.available == 'true'
|
|
133
|
+
uses: pnpm/action-setup@v4
|
|
134
|
+
with:
|
|
135
|
+
version: '11'
|
|
136
|
+
|
|
137
|
+
- uses: actions/setup-python@v5
|
|
138
|
+
if: steps.specs.outputs.available == 'true'
|
|
139
|
+
with:
|
|
140
|
+
python-version: '3.12'
|
|
141
|
+
|
|
142
|
+
- name: Install Python dependencies
|
|
143
|
+
if: steps.specs.outputs.available == 'true'
|
|
144
|
+
run: pip install -e ".[dev]"
|
|
145
|
+
|
|
146
|
+
- name: Build conformance runner
|
|
147
|
+
if: steps.specs.outputs.available == 'true'
|
|
148
|
+
run: |
|
|
149
|
+
cd specs/conformance/runner
|
|
150
|
+
pnpm install --frozen-lockfile
|
|
151
|
+
pnpm build
|
|
152
|
+
|
|
153
|
+
- name: Run conformance suite (TC-001–TC-006)
|
|
154
|
+
if: steps.specs.outputs.available == 'true'
|
|
155
|
+
run: |
|
|
156
|
+
if [[ -z "$VERBUM_SDK_API_KEY" ]]; then
|
|
157
|
+
echo "::warning::VERBUM_SDK_TEST_API_KEY is not set (forked PR or secret unavailable) — skipping conformance suite."
|
|
158
|
+
exit 0
|
|
159
|
+
fi
|
|
160
|
+
node specs/conformance/runner/dist/index.js run \
|
|
161
|
+
--adapter "python tests/conformance/adapter.py" \
|
|
162
|
+
--suite specs/conformance/suite \
|
|
163
|
+
--specs-root specs \
|
|
164
|
+
--base-url "$VERBUM_SDK_BASE_URL"
|
|
165
|
+
|
|
166
|
+
# ── Build ───────────────────────────────────────────────────────────────────
|
|
167
|
+
build:
|
|
168
|
+
name: Build
|
|
169
|
+
needs: [lint, typecheck, test-unit]
|
|
170
|
+
runs-on: ubuntu-latest
|
|
171
|
+
steps:
|
|
172
|
+
- uses: actions/checkout@v4
|
|
173
|
+
|
|
174
|
+
- uses: actions/setup-python@v5
|
|
175
|
+
with:
|
|
176
|
+
python-version: '3.12'
|
|
177
|
+
|
|
178
|
+
- name: Install build backend
|
|
179
|
+
run: pip install build
|
|
180
|
+
|
|
181
|
+
- name: Build sdist + wheel
|
|
182
|
+
run: python -m build
|
|
183
|
+
|
|
184
|
+
- name: Upload dist artifact
|
|
185
|
+
uses: actions/upload-artifact@v4
|
|
186
|
+
with:
|
|
187
|
+
name: dist-${{ github.sha }}
|
|
188
|
+
path: dist/
|
|
189
|
+
retention-days: 7
|
|
190
|
+
|
|
191
|
+
# ── Publish to PyPI (Trusted Publisher / OIDC) ─────────────────────────────
|
|
192
|
+
# Triggered only on v*.*.* tags. Requires a PyPI Trusted Publisher entry:
|
|
193
|
+
# Publisher: GitHub Actions
|
|
194
|
+
# Owner: getstandup
|
|
195
|
+
# Repository: verbum-python-sdk
|
|
196
|
+
# Workflow: ci.yml
|
|
197
|
+
# Environment: pypi
|
|
198
|
+
publish:
|
|
199
|
+
name: Publish to PyPI
|
|
200
|
+
needs: [conformance, build]
|
|
201
|
+
runs-on: ubuntu-latest
|
|
202
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
203
|
+
environment:
|
|
204
|
+
name: pypi
|
|
205
|
+
url: https://pypi.org/p/verbum-sdk
|
|
206
|
+
permissions:
|
|
207
|
+
id-token: write # required for OIDC Trusted Publisher
|
|
208
|
+
steps:
|
|
209
|
+
- name: Download dist artifact
|
|
210
|
+
uses: actions/download-artifact@v4
|
|
211
|
+
with:
|
|
212
|
+
name: dist-${{ github.sha }}
|
|
213
|
+
path: dist/
|
|
214
|
+
|
|
215
|
+
- name: Publish to PyPI
|
|
216
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
217
|
+
with:
|
|
218
|
+
attestations: true
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [1.0.0] - 2026-07-09
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Testing**: complete unit test suite (`test_package`, `test_rest_client`,
|
|
15
|
+
`test_rest_resources`, `test_stt_session`, `test_session_features`,
|
|
16
|
+
`test_ws_transport`) with ≥90 % branch-coverage gate enforced via
|
|
17
|
+
`coverage.report.fail_under = 90`.
|
|
18
|
+
- **Integration tests** (`tests/integration/`): auth, REST resources, and live
|
|
19
|
+
STT smoke tests — auto-skipped when `VERBUM_SDK_TEST_API_KEY` is absent.
|
|
20
|
+
- **Conformance suite** wired as a mandatory CI gate (TC-001–TC-006 via the
|
|
21
|
+
Python adapter at `tests/conformance/adapter.py` and the shared runner in
|
|
22
|
+
`specs/conformance/runner/`).
|
|
23
|
+
- **Jupyter notebook** `notebooks/realtime_transcription.ipynb` — end-to-end
|
|
24
|
+
real-time transcription demo with `sounddevice` + `verbum-sdk`.
|
|
25
|
+
- **Sphinx API documentation** (`docs/`) using `furo` theme, `autodoc`, and
|
|
26
|
+
`sphinx-autodoc-typehints`; `pyproject.toml` `docs` extra added.
|
|
27
|
+
- **CI/CD pipeline** (`ci.yml`): ruff lint, mypy type check, pytest unit
|
|
28
|
+
(matrix 3.9–3.13), pytest integration, conformance suite gate,
|
|
29
|
+
`python -m build`, publish to PyPI on `v*.*.*` tags via Trusted Publisher
|
|
30
|
+
(OIDC — no stored secrets).
|
|
31
|
+
- `pyproject.toml`: `docs` and `notebooks` optional-dependency groups;
|
|
32
|
+
`coverage.run.branch = true`; `coverage.report.fail_under = 90`.
|
|
33
|
+
- `verbum.stt.session`: `SttSession` / `AsyncSttSession` gain context-manager
|
|
34
|
+
support (`__enter__`/`__exit__`, `__aenter__`/`__aexit__`) and an
|
|
35
|
+
`on_recognized` typed convenience callback.
|
|
36
|
+
- `verbum.stt`: `_AsyncSttConnectHandle` — dual awaitable + async-context-manager
|
|
37
|
+
interface; `AsyncSttModule.connect_sync` for non-async scripts.
|
|
38
|
+
- `verbum.client`: `batch` and `usage` feature-layer shortcuts on both
|
|
39
|
+
`VerbumClient` and `AsyncVerbumClient`.
|
|
40
|
+
- `verbum.ws`: full Socket.IO transport (`VerbumWebSocket` / `AsyncVerbumWebSocket`)
|
|
41
|
+
with custom exponential-backoff reconnection (max_retries, initial_backoff_ms,
|
|
42
|
+
max_backoff_ms).
|
|
43
|
+
- `verbum.rest.*`: complete implementations for translator, text-analysis,
|
|
44
|
+
speech/TTS, scribe, usage; circuit-breaker + retry on base client.
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
|
|
48
|
+
- Package version `0.1.0` → `1.0.0` (first stable release).
|
|
49
|
+
- Development Status classifier: `Alpha` → `Production/Stable`.
|
|
50
|
+
- `README.md`: complete sync quickstart, async quickstart, REST quickstart,
|
|
51
|
+
Jupyter notebook link, Sphinx docs link, and updated project-status table.
|
|
52
|
+
|
|
53
|
+
## [0.1.0] - 2026-06-01
|
|
54
|
+
|
|
55
|
+
Initial bootstrap — not published to PyPI.
|
|
56
|
+
|
|
57
|
+
### Added
|
|
58
|
+
|
|
59
|
+
- Project scaffold: `pyproject.toml` (hatchling), `src/verbum` package layout,
|
|
60
|
+
lint/type/test tooling (ruff, mypy, pytest), initial CI workflow.
|
|
61
|
+
- `verbum.auth`: `ApiToken`, `ApiTokenAuth`, `create_api_token`.
|
|
62
|
+
- `verbum.stt`: `SttModule` / `AsyncSttModule`, `SttSession` / `AsyncSttSession`
|
|
63
|
+
state machine.
|
|
64
|
+
- `verbum.client`: `VerbumClient` / `AsyncVerbumClient`.
|
|
65
|
+
- `specs/` submodule (`verbum-sdk-specs`) with the shared WebSocket protocol
|
|
66
|
+
spec and conformance suite.
|
|
67
|
+
- Conformance adapter skeleton at `tests/conformance/adapter.py`.
|
|
68
|
+
|
|
69
|
+
[Unreleased]: https://github.com/getstandup/verbum-python-sdk/compare/v1.0.0...HEAD
|
|
70
|
+
[1.0.0]: https://github.com/getstandup/verbum-python-sdk/compare/v0.1.0...v1.0.0
|
|
71
|
+
[0.1.0]: https://github.com/getstandup/verbum-python-sdk/releases/tag/v0.1.0
|
verbum_sdk-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Verbum
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: verbum-sdk
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Python SDK for Verbum AI speech services (sync and async)
|
|
5
|
+
Project-URL: Homepage, https://github.com/getstandup/verbum-python-sdk
|
|
6
|
+
Project-URL: Repository, https://github.com/getstandup/verbum-python-sdk
|
|
7
|
+
Project-URL: Issues, https://github.com/getstandup/verbum-python-sdk/issues
|
|
8
|
+
Author: Verbum
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: s2s,sdk,speech-to-speech,speech-to-text,stt,translation,verbum
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Requires-Python: >=3.9
|
|
25
|
+
Requires-Dist: aiohttp<4,>=3.9
|
|
26
|
+
Requires-Dist: httpx<1,>=0.27
|
|
27
|
+
Requires-Dist: python-socketio[asyncio-client,client]<6,>=5.11
|
|
28
|
+
Requires-Dist: requests<3,>=2.31
|
|
29
|
+
Requires-Dist: websocket-client<2,>=1.8
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: mypy>=1.11; extra == 'dev'
|
|
32
|
+
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
|
|
33
|
+
Requires-Dist: pytest-cov>=5; extra == 'dev'
|
|
34
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
35
|
+
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
36
|
+
Requires-Dist: types-requests>=2.31; extra == 'dev'
|
|
37
|
+
Provides-Extra: docs
|
|
38
|
+
Requires-Dist: furo>=2024; extra == 'docs'
|
|
39
|
+
Requires-Dist: myst-parser>=3; extra == 'docs'
|
|
40
|
+
Requires-Dist: sphinx-autodoc-typehints>=2; extra == 'docs'
|
|
41
|
+
Requires-Dist: sphinx>=7; extra == 'docs'
|
|
42
|
+
Provides-Extra: notebooks
|
|
43
|
+
Requires-Dist: ipykernel>=6; extra == 'notebooks'
|
|
44
|
+
Requires-Dist: jupyter>=1.1; extra == 'notebooks'
|
|
45
|
+
Requires-Dist: numpy>=1.26; extra == 'notebooks'
|
|
46
|
+
Requires-Dist: sounddevice>=0.4; extra == 'notebooks'
|
|
47
|
+
Description-Content-Type: text/markdown
|
|
48
|
+
|
|
49
|
+
# verbum-sdk (Python)
|
|
50
|
+
|
|
51
|
+
[](https://github.com/getstandup/verbum-python-sdk/actions/workflows/ci.yml)
|
|
52
|
+
[](https://pypi.org/project/verbum-sdk/)
|
|
53
|
+
[](https://pypi.org/project/verbum-sdk/)
|
|
54
|
+
[](LICENSE)
|
|
55
|
+
|
|
56
|
+
Python SDK for [Verbum](https://verbum.ai) AI speech services — real-time
|
|
57
|
+
speech-to-text and speech-to-speech streaming, translation, text analysis,
|
|
58
|
+
text-to-speech, and batch transcription. Sync and async clients ship from a
|
|
59
|
+
single package.
|
|
60
|
+
|
|
61
|
+
## Install
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pip install verbum-sdk
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Quickstart — sync
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
from verbum import VerbumClient, VerbumClientOptions, SttConnectOptions, create_api_token
|
|
71
|
+
|
|
72
|
+
client = VerbumClient(VerbumClientOptions(
|
|
73
|
+
api_token=create_api_token("sk-..."),
|
|
74
|
+
base_url="wss://sdk.verbum.ai",
|
|
75
|
+
))
|
|
76
|
+
|
|
77
|
+
# Context manager — session.stop() is called automatically on exit
|
|
78
|
+
with client.stt.connect(SttConnectOptions(language=["en-US"], encoding="PCM")) as session:
|
|
79
|
+
session.on_recognized(lambda result: print(result.text))
|
|
80
|
+
session.stream(pcm_bytes) # call repeatedly with PCM audio chunks
|
|
81
|
+
# session is stopped here
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Or without the context manager:
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
session = client.stt.connect(SttConnectOptions(language=["en-US"], encoding="PCM"))
|
|
88
|
+
session.on_recognized(lambda result: print(result.text))
|
|
89
|
+
session.stream(pcm_bytes)
|
|
90
|
+
session.stop()
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Quickstart — async
|
|
94
|
+
|
|
95
|
+
```python
|
|
96
|
+
import asyncio
|
|
97
|
+
from verbum import AsyncVerbumClient, VerbumClientOptions, SttConnectOptions, create_api_token
|
|
98
|
+
|
|
99
|
+
async def main() -> None:
|
|
100
|
+
client = AsyncVerbumClient(VerbumClientOptions(
|
|
101
|
+
api_token=create_api_token("sk-..."),
|
|
102
|
+
base_url="wss://sdk.verbum.ai",
|
|
103
|
+
))
|
|
104
|
+
|
|
105
|
+
# Awaitable + async context manager — both patterns work
|
|
106
|
+
async with client.stt.connect(SttConnectOptions(language=["en-US"], encoding="PCM")) as session:
|
|
107
|
+
session.on_recognized(lambda result: print(result.text))
|
|
108
|
+
await session.stream(pcm_bytes)
|
|
109
|
+
|
|
110
|
+
asyncio.run(main())
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
From a non-async context (e.g. an ML pipeline):
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
session = client.stt.connect_sync(SttConnectOptions(language=["en-US"], encoding="PCM"))
|
|
117
|
+
session.stream_sync(pcm_bytes) # thread-safe, no event loop required
|
|
118
|
+
session.stop_sync()
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Quickstart — REST resources
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
from verbum.rest.types import TranslateRequest, SingleText
|
|
125
|
+
|
|
126
|
+
# Translation
|
|
127
|
+
result = client.rest.translator.translate(
|
|
128
|
+
TranslateRequest(texts=[SingleText("Hello, world!")], to=["es", "fr"])
|
|
129
|
+
)
|
|
130
|
+
print(result.translations)
|
|
131
|
+
|
|
132
|
+
# Batch transcription (shortcut via client.batch)
|
|
133
|
+
from verbum.rest.types import BatchTranscribeRequest
|
|
134
|
+
job = client.batch.create_batch_job(BatchTranscribeRequest(urls=["https://..."], language="en-US"))
|
|
135
|
+
status = client.batch.get_batch_job_status(job.transcription_id)
|
|
136
|
+
result = client.batch.get_batch_job_result(job.transcription_id)
|
|
137
|
+
|
|
138
|
+
# Usage / consumption (shortcut via client.usage)
|
|
139
|
+
from verbum.rest.types import ConsumptionQuery
|
|
140
|
+
records = client.usage.get_consumption(ConsumptionQuery(start_date="2026-01-01", end_date="2026-12-31"))
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Jupyter notebook
|
|
144
|
+
|
|
145
|
+
A live microphone transcription demo is available at
|
|
146
|
+
[`notebooks/realtime_transcription.ipynb`](./notebooks/realtime_transcription.ipynb).
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
pip install "verbum-sdk[notebooks]"
|
|
150
|
+
jupyter lab notebooks/realtime_transcription.ipynb
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## API docs
|
|
154
|
+
|
|
155
|
+
Full API reference generated by Sphinx:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
pip install "verbum-sdk[docs]"
|
|
159
|
+
cd docs && make html
|
|
160
|
+
# open docs/_build/html/index.html
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Project layout
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
src/verbum/
|
|
167
|
+
client.py VerbumClient / AsyncVerbumClient
|
|
168
|
+
auth/ API token auth provider
|
|
169
|
+
stt/ SttModule / SttSession (+ Async variants) — full implementation
|
|
170
|
+
ws/ Socket.IO transport (VerbumWebSocket / AsyncVerbumWebSocket)
|
|
171
|
+
rest/ REST resource clients — translator, text-analysis, speech/TTS,
|
|
172
|
+
scribe, usage; circuit-breaker + retry on the base client
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
This mirrors the reference [TypeScript SDK](https://github.com/getstandup/verbum-sdk)
|
|
176
|
+
(`src/*.ts`) module-for-module so the two implementations stay easy to diff
|
|
177
|
+
against each other during development.
|
|
178
|
+
|
|
179
|
+
## Protocol & conformance
|
|
180
|
+
|
|
181
|
+
This SDK speaks the wire protocol documented in
|
|
182
|
+
[`specs/PROTOCOL.md`](./specs/PROTOCOL.md) (Engine.IO v4 over WebSocket,
|
|
183
|
+
Socket.IO `/listen` and `/repeat` namespaces) and passes the shared
|
|
184
|
+
[conformance suite](./specs/conformance/README.md) (TC-001–TC-006) as a
|
|
185
|
+
mandatory CI gate.
|
|
186
|
+
|
|
187
|
+
`specs/` is a git submodule of
|
|
188
|
+
[`verbum-sdk-specs`](https://github.com/getstandup/verbum-sdk-specs); after
|
|
189
|
+
cloning, run:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
git submodule update --init --recursive
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Development
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
python -m venv .venv && source .venv/bin/activate
|
|
199
|
+
pip install -e ".[dev]"
|
|
200
|
+
|
|
201
|
+
ruff check . # lint
|
|
202
|
+
ruff format --check . # format check
|
|
203
|
+
mypy # type check
|
|
204
|
+
pytest # unit tests (≥90 % coverage enforced)
|
|
205
|
+
pytest tests/integration/ -v # integration tests (requires VERBUM_SDK_TEST_API_KEY)
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Run the conformance suite locally (requires Node ≥ 22 + pnpm ≥ 11):
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
cd specs/conformance/runner && pnpm install && pnpm build && cd ../../..
|
|
212
|
+
VERBUM_SDK_API_KEY=<key> node specs/conformance/runner/dist/index.js run \
|
|
213
|
+
--adapter "python tests/conformance/adapter.py" \
|
|
214
|
+
--suite specs/conformance/suite \
|
|
215
|
+
--specs-root specs
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Project status
|
|
219
|
+
|
|
220
|
+
| Area | Status |
|
|
221
|
+
| --- | --- |
|
|
222
|
+
| Packaging / tooling | Done |
|
|
223
|
+
| `verbum.auth` | Done |
|
|
224
|
+
| `verbum.stt` session state machine | Done |
|
|
225
|
+
| `verbum.ws` Socket.IO transport | Done |
|
|
226
|
+
| `verbum.rest.*` (translator, text-analysis, speech, scribe, usage) | Done |
|
|
227
|
+
| `verbum.rest.*` (users, projects, invitations, metrics — manager-api) | Not planned |
|
|
228
|
+
| Unit tests (≥90 % coverage) | Done |
|
|
229
|
+
| Integration tests | Done |
|
|
230
|
+
| Conformance suite (TC-001–TC-006) | Done |
|
|
231
|
+
| Sphinx API docs | Done |
|
|
232
|
+
| Jupyter quickstart notebook | Done |
|
|
233
|
+
| PyPI publish (CI/CD) | Done |
|
|
234
|
+
|