speechall 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.
- speechall-0.1.0/.github/workflows/publish-to-pypi.yml +43 -0
- speechall-0.1.0/.gitignore +196 -0
- speechall-0.1.0/.gitlab-ci.yml +31 -0
- speechall-0.1.0/.openapi-generator/FILES +95 -0
- speechall-0.1.0/.openapi-generator/VERSION +1 -0
- speechall-0.1.0/.openapi-generator-ignore +41 -0
- speechall-0.1.0/.travis.yml +17 -0
- speechall-0.1.0/EXAMPLE_README.md +126 -0
- speechall-0.1.0/LICENSE +21 -0
- speechall-0.1.0/Makefile +104 -0
- speechall-0.1.0/PKG-INFO +183 -0
- speechall-0.1.0/README.md +150 -0
- speechall-0.1.0/REGENERATION_GUIDE.md +290 -0
- speechall-0.1.0/docs/BaseTranscriptionConfiguration.md +40 -0
- speechall-0.1.0/docs/CreateReplacementRuleset201Response.md +28 -0
- speechall-0.1.0/docs/CreateReplacementRulesetRequest.md +29 -0
- speechall-0.1.0/docs/ErrorResponse.md +29 -0
- speechall-0.1.0/docs/ExactRule.md +32 -0
- speechall-0.1.0/docs/OpenAICreateTranslationRequestModel.md +28 -0
- speechall-0.1.0/docs/OpenaiCompatibleCreateTranscription200Response.md +32 -0
- speechall-0.1.0/docs/OpenaiCompatibleCreateTranslation200Response.md +31 -0
- speechall-0.1.0/docs/RegexGroupRule.md +32 -0
- speechall-0.1.0/docs/RegexRule.md +32 -0
- speechall-0.1.0/docs/RemoteTranscriptionConfiguration.md +42 -0
- speechall-0.1.0/docs/ReplacementRule.md +35 -0
- speechall-0.1.0/docs/ReplacementRulesApi.md +96 -0
- speechall-0.1.0/docs/SpeechToTextApi.md +300 -0
- speechall-0.1.0/docs/SpeechToTextModel.md +57 -0
- speechall-0.1.0/docs/TranscriptLanguageCode.md +215 -0
- speechall-0.1.0/docs/TranscriptOutputFormat.md +19 -0
- speechall-0.1.0/docs/TranscriptionDetailed.md +35 -0
- speechall-0.1.0/docs/TranscriptionModelIdentifier.md +149 -0
- speechall-0.1.0/docs/TranscriptionOnlyText.md +30 -0
- speechall-0.1.0/docs/TranscriptionProvider.md +39 -0
- speechall-0.1.0/docs/TranscriptionResponse.md +35 -0
- speechall-0.1.0/docs/TranscriptionSegment.md +33 -0
- speechall-0.1.0/docs/TranscriptionWord.md +33 -0
- speechall-0.1.0/example_transcribe.py +219 -0
- speechall-0.1.0/fix_transcription_response.py +266 -0
- speechall-0.1.0/git_push.sh +57 -0
- speechall-0.1.0/pyproject.toml +51 -0
- speechall-0.1.0/regenerate.sh +223 -0
- speechall-0.1.0/requirements.txt +5 -0
- speechall-0.1.0/setup.cfg +2 -0
- speechall-0.1.0/setup.py +50 -0
- speechall-0.1.0/simple_example.py +46 -0
- speechall-0.1.0/speechall/__init__.py +56 -0
- speechall-0.1.0/speechall/api/__init__.py +6 -0
- speechall-0.1.0/speechall/api/replacement_rules_api.py +199 -0
- speechall-0.1.0/speechall/api/speech_to_text_api.py +603 -0
- speechall-0.1.0/speechall/api_client.py +766 -0
- speechall-0.1.0/speechall/api_response.py +25 -0
- speechall-0.1.0/speechall/configuration.py +443 -0
- speechall-0.1.0/speechall/exceptions.py +166 -0
- speechall-0.1.0/speechall/models/__init__.py +38 -0
- speechall-0.1.0/speechall/models/base_transcription_configuration.py +106 -0
- speechall-0.1.0/speechall/models/create_replacement_ruleset201_response.py +71 -0
- speechall-0.1.0/speechall/models/create_replacement_ruleset_request.py +81 -0
- speechall-0.1.0/speechall/models/error_response.py +83 -0
- speechall-0.1.0/speechall/models/exact_rule.py +84 -0
- speechall-0.1.0/speechall/models/open_ai_create_translation_request_model.py +139 -0
- speechall-0.1.0/speechall/models/openai_compatible_create_transcription200_response.py +139 -0
- speechall-0.1.0/speechall/models/openai_compatible_create_translation200_response.py +139 -0
- speechall-0.1.0/speechall/models/regex_group_rule.py +95 -0
- speechall-0.1.0/speechall/models/regex_rule.py +95 -0
- speechall-0.1.0/speechall/models/remote_transcription_configuration.py +118 -0
- speechall-0.1.0/speechall/models/replacement_rule.py +158 -0
- speechall-0.1.0/speechall/models/speech_to_text_model.py +294 -0
- speechall-0.1.0/speechall/models/transcript_language_code.py +141 -0
- speechall-0.1.0/speechall/models/transcript_output_format.py +43 -0
- speechall-0.1.0/speechall/models/transcription_detailed.py +99 -0
- speechall-0.1.0/speechall/models/transcription_model_identifier.py +108 -0
- speechall-0.1.0/speechall/models/transcription_only_text.py +73 -0
- speechall-0.1.0/speechall/models/transcription_provider.py +53 -0
- speechall-0.1.0/speechall/models/transcription_response.py +142 -0
- speechall-0.1.0/speechall/models/transcription_segment.py +79 -0
- speechall-0.1.0/speechall/models/transcription_word.py +79 -0
- speechall-0.1.0/speechall/py.typed +0 -0
- speechall-0.1.0/speechall/rest.py +329 -0
- speechall-0.1.0/test/__init__.py +0 -0
- speechall-0.1.0/test/test_base_transcription_configuration.py +64 -0
- speechall-0.1.0/test/test_create_replacement_ruleset201_response.py +53 -0
- speechall-0.1.0/test/test_create_replacement_ruleset_request.py +59 -0
- speechall-0.1.0/test/test_error_response.py +53 -0
- speechall-0.1.0/test/test_exact_rule.py +58 -0
- speechall-0.1.0/test/test_open_ai_create_translation_request_model.py +51 -0
- speechall-0.1.0/test/test_openai_compatible_create_transcription200_response.py +78 -0
- speechall-0.1.0/test/test_openai_compatible_create_translation200_response.py +72 -0
- speechall-0.1.0/test/test_regex_group_rule.py +58 -0
- speechall-0.1.0/test/test_regex_rule.py +58 -0
- speechall-0.1.0/test/test_remote_transcription_configuration.py +69 -0
- speechall-0.1.0/test/test_replacement_rule.py +63 -0
- speechall-0.1.0/test/test_replacement_rules_api.py +38 -0
- speechall-0.1.0/test/test_speech_to_text_api.py +52 -0
- speechall-0.1.0/test/test_speech_to_text_model.py +86 -0
- speechall-0.1.0/test/test_transcript_language_code.py +34 -0
- speechall-0.1.0/test/test_transcript_output_format.py +34 -0
- speechall-0.1.0/test/test_transcription_detailed.py +74 -0
- speechall-0.1.0/test/test_transcription_model_identifier.py +34 -0
- speechall-0.1.0/test/test_transcription_only_text.py +55 -0
- speechall-0.1.0/test/test_transcription_provider.py +34 -0
- speechall-0.1.0/test/test_transcription_response.py +74 -0
- speechall-0.1.0/test/test_transcription_segment.py +56 -0
- speechall-0.1.0/test/test_transcription_word.py +59 -0
- speechall-0.1.0/test-requirements.txt +3 -0
- speechall-0.1.0/tox.ini +9 -0
- speechall-0.1.0/uv.lock +657 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: Publish Python Package to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build-and-publish:
|
|
10
|
+
name: Build and publish Python distribution to PyPI
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
environment: release # Optional: if you have a GitHub environment for releases
|
|
13
|
+
permissions:
|
|
14
|
+
id-token: write # Required for trusted publishing, if you choose that route later
|
|
15
|
+
contents: read # Needed to check out the repository
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout repository
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Set up Python
|
|
22
|
+
uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: "3.9" # Or another version like "3.x" or based on pyproject.toml
|
|
25
|
+
|
|
26
|
+
- name: Install build dependencies
|
|
27
|
+
run: python -m pip install --upgrade pip build
|
|
28
|
+
|
|
29
|
+
- name: Build package
|
|
30
|
+
run: python -m build
|
|
31
|
+
|
|
32
|
+
# Test with TestPyPI first using Trusted Publishing
|
|
33
|
+
# - name: Publish package to TestPyPI
|
|
34
|
+
# uses: pypa/gh-action-pypi-publish@release/v1
|
|
35
|
+
# with:
|
|
36
|
+
# repository-url: https://test.pypi.org/legacy/
|
|
37
|
+
|
|
38
|
+
- name: Publish package to PyPI
|
|
39
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
40
|
+
with:
|
|
41
|
+
user: __token__
|
|
42
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
43
|
+
# skip_existing: true # To skip publishing if the version already exists
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
|
|
110
|
+
# pdm
|
|
111
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
112
|
+
#pdm.lock
|
|
113
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
114
|
+
# in version control.
|
|
115
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
116
|
+
.pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
121
|
+
__pypackages__/
|
|
122
|
+
|
|
123
|
+
# Celery stuff
|
|
124
|
+
celerybeat-schedule
|
|
125
|
+
celerybeat.pid
|
|
126
|
+
|
|
127
|
+
# SageMath parsed files
|
|
128
|
+
*.sage.py
|
|
129
|
+
|
|
130
|
+
# Environments
|
|
131
|
+
.env
|
|
132
|
+
.venv
|
|
133
|
+
env/
|
|
134
|
+
venv/
|
|
135
|
+
ENV/
|
|
136
|
+
env.bak/
|
|
137
|
+
venv.bak/
|
|
138
|
+
|
|
139
|
+
# Spyder project settings
|
|
140
|
+
.spyderproject
|
|
141
|
+
.spyproject
|
|
142
|
+
|
|
143
|
+
# Rope project settings
|
|
144
|
+
.ropeproject
|
|
145
|
+
|
|
146
|
+
# mkdocs documentation
|
|
147
|
+
/site
|
|
148
|
+
|
|
149
|
+
# mypy
|
|
150
|
+
.mypy_cache/
|
|
151
|
+
.dmypy.json
|
|
152
|
+
dmypy.json
|
|
153
|
+
|
|
154
|
+
# Pyre type checker
|
|
155
|
+
.pyre/
|
|
156
|
+
|
|
157
|
+
# pytype static type analyzer
|
|
158
|
+
.pytype/
|
|
159
|
+
|
|
160
|
+
# Cython debug symbols
|
|
161
|
+
cython_debug/
|
|
162
|
+
|
|
163
|
+
# PyCharm
|
|
164
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
165
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
166
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
167
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
168
|
+
#.idea/
|
|
169
|
+
|
|
170
|
+
# Abstra
|
|
171
|
+
# Abstra is an AI-powered process automation framework.
|
|
172
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
173
|
+
# Learn more at https://abstra.io/docs
|
|
174
|
+
.abstra/
|
|
175
|
+
|
|
176
|
+
# Visual Studio Code
|
|
177
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
178
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
179
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
180
|
+
# you could uncomment the following to ignore the enitre vscode folder
|
|
181
|
+
# .vscode/
|
|
182
|
+
|
|
183
|
+
# Ruff stuff:
|
|
184
|
+
.ruff_cache/
|
|
185
|
+
|
|
186
|
+
# PyPI configuration file
|
|
187
|
+
.pypirc
|
|
188
|
+
|
|
189
|
+
# Cursor
|
|
190
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
191
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
192
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
193
|
+
.cursorignore
|
|
194
|
+
.cursorindexingignore
|
|
195
|
+
|
|
196
|
+
.DS_Store
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# NOTE: This file is auto generated by OpenAPI Generator.
|
|
2
|
+
# URL: https://openapi-generator.tech
|
|
3
|
+
#
|
|
4
|
+
# ref: https://docs.gitlab.com/ee/ci/README.html
|
|
5
|
+
# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml
|
|
6
|
+
|
|
7
|
+
stages:
|
|
8
|
+
- test
|
|
9
|
+
|
|
10
|
+
.pytest:
|
|
11
|
+
stage: test
|
|
12
|
+
script:
|
|
13
|
+
- pip install -r requirements.txt
|
|
14
|
+
- pip install -r test-requirements.txt
|
|
15
|
+
- pytest --cov=speechall
|
|
16
|
+
|
|
17
|
+
pytest-3.7:
|
|
18
|
+
extends: .pytest
|
|
19
|
+
image: python:3.7-alpine
|
|
20
|
+
pytest-3.8:
|
|
21
|
+
extends: .pytest
|
|
22
|
+
image: python:3.8-alpine
|
|
23
|
+
pytest-3.9:
|
|
24
|
+
extends: .pytest
|
|
25
|
+
image: python:3.9-alpine
|
|
26
|
+
pytest-3.10:
|
|
27
|
+
extends: .pytest
|
|
28
|
+
image: python:3.10-alpine
|
|
29
|
+
pytest-3.11:
|
|
30
|
+
extends: .pytest
|
|
31
|
+
image: python:3.11-alpine
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
.github/workflows/python.yml
|
|
2
|
+
.gitignore
|
|
3
|
+
.gitlab-ci.yml
|
|
4
|
+
.openapi-generator-ignore
|
|
5
|
+
.travis.yml
|
|
6
|
+
README.md
|
|
7
|
+
docs/BaseTranscriptionConfiguration.md
|
|
8
|
+
docs/CreateReplacementRuleset201Response.md
|
|
9
|
+
docs/CreateReplacementRulesetRequest.md
|
|
10
|
+
docs/ErrorResponse.md
|
|
11
|
+
docs/ExactRule.md
|
|
12
|
+
docs/OpenAICreateTranslationRequestModel.md
|
|
13
|
+
docs/OpenaiCompatibleCreateTranscription200Response.md
|
|
14
|
+
docs/OpenaiCompatibleCreateTranslation200Response.md
|
|
15
|
+
docs/RegexGroupRule.md
|
|
16
|
+
docs/RegexRule.md
|
|
17
|
+
docs/RemoteTranscriptionConfiguration.md
|
|
18
|
+
docs/ReplacementRule.md
|
|
19
|
+
docs/ReplacementRulesApi.md
|
|
20
|
+
docs/SpeechToTextApi.md
|
|
21
|
+
docs/SpeechToTextModel.md
|
|
22
|
+
docs/TranscriptLanguageCode.md
|
|
23
|
+
docs/TranscriptOutputFormat.md
|
|
24
|
+
docs/TranscriptionDetailed.md
|
|
25
|
+
docs/TranscriptionModelIdentifier.md
|
|
26
|
+
docs/TranscriptionOnlyText.md
|
|
27
|
+
docs/TranscriptionProvider.md
|
|
28
|
+
docs/TranscriptionResponse.md
|
|
29
|
+
docs/TranscriptionSegment.md
|
|
30
|
+
docs/TranscriptionWord.md
|
|
31
|
+
git_push.sh
|
|
32
|
+
pyproject.toml
|
|
33
|
+
requirements.txt
|
|
34
|
+
setup.cfg
|
|
35
|
+
setup.py
|
|
36
|
+
speechall/__init__.py
|
|
37
|
+
speechall/api/__init__.py
|
|
38
|
+
speechall/api/replacement_rules_api.py
|
|
39
|
+
speechall/api/speech_to_text_api.py
|
|
40
|
+
speechall/api_client.py
|
|
41
|
+
speechall/api_response.py
|
|
42
|
+
speechall/configuration.py
|
|
43
|
+
speechall/exceptions.py
|
|
44
|
+
speechall/models/__init__.py
|
|
45
|
+
speechall/models/base_transcription_configuration.py
|
|
46
|
+
speechall/models/create_replacement_ruleset201_response.py
|
|
47
|
+
speechall/models/create_replacement_ruleset_request.py
|
|
48
|
+
speechall/models/error_response.py
|
|
49
|
+
speechall/models/exact_rule.py
|
|
50
|
+
speechall/models/open_ai_create_translation_request_model.py
|
|
51
|
+
speechall/models/openai_compatible_create_transcription200_response.py
|
|
52
|
+
speechall/models/openai_compatible_create_translation200_response.py
|
|
53
|
+
speechall/models/regex_group_rule.py
|
|
54
|
+
speechall/models/regex_rule.py
|
|
55
|
+
speechall/models/remote_transcription_configuration.py
|
|
56
|
+
speechall/models/replacement_rule.py
|
|
57
|
+
speechall/models/speech_to_text_model.py
|
|
58
|
+
speechall/models/transcript_language_code.py
|
|
59
|
+
speechall/models/transcript_output_format.py
|
|
60
|
+
speechall/models/transcription_detailed.py
|
|
61
|
+
speechall/models/transcription_model_identifier.py
|
|
62
|
+
speechall/models/transcription_only_text.py
|
|
63
|
+
speechall/models/transcription_provider.py
|
|
64
|
+
speechall/models/transcription_response.py
|
|
65
|
+
speechall/models/transcription_segment.py
|
|
66
|
+
speechall/models/transcription_word.py
|
|
67
|
+
speechall/py.typed
|
|
68
|
+
speechall/rest.py
|
|
69
|
+
test-requirements.txt
|
|
70
|
+
test/__init__.py
|
|
71
|
+
test/test_base_transcription_configuration.py
|
|
72
|
+
test/test_create_replacement_ruleset201_response.py
|
|
73
|
+
test/test_create_replacement_ruleset_request.py
|
|
74
|
+
test/test_error_response.py
|
|
75
|
+
test/test_exact_rule.py
|
|
76
|
+
test/test_open_ai_create_translation_request_model.py
|
|
77
|
+
test/test_openai_compatible_create_transcription200_response.py
|
|
78
|
+
test/test_openai_compatible_create_translation200_response.py
|
|
79
|
+
test/test_regex_group_rule.py
|
|
80
|
+
test/test_regex_rule.py
|
|
81
|
+
test/test_remote_transcription_configuration.py
|
|
82
|
+
test/test_replacement_rule.py
|
|
83
|
+
test/test_replacement_rules_api.py
|
|
84
|
+
test/test_speech_to_text_api.py
|
|
85
|
+
test/test_speech_to_text_model.py
|
|
86
|
+
test/test_transcript_language_code.py
|
|
87
|
+
test/test_transcript_output_format.py
|
|
88
|
+
test/test_transcription_detailed.py
|
|
89
|
+
test/test_transcription_model_identifier.py
|
|
90
|
+
test/test_transcription_only_text.py
|
|
91
|
+
test/test_transcription_provider.py
|
|
92
|
+
test/test_transcription_response.py
|
|
93
|
+
test/test_transcription_segment.py
|
|
94
|
+
test/test_transcription_word.py
|
|
95
|
+
tox.ini
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7.13.0
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# OpenAPI Generator Ignore
|
|
2
|
+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
|
3
|
+
|
|
4
|
+
# Use this file to prevent files from being overwritten by the generator.
|
|
5
|
+
# The patterns follow closely to .gitignore or .dockerignore.
|
|
6
|
+
|
|
7
|
+
# As an example, the C# client generator defines ApiClient.cs.
|
|
8
|
+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
|
9
|
+
#ApiClient.cs
|
|
10
|
+
|
|
11
|
+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
|
12
|
+
#foo/*/qux
|
|
13
|
+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
|
14
|
+
|
|
15
|
+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
|
16
|
+
#foo/**/qux
|
|
17
|
+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
|
18
|
+
|
|
19
|
+
# You can also negate patterns with an exclamation (!).
|
|
20
|
+
# For example, you can ignore all files in a docs folder with the file extension .md:
|
|
21
|
+
#docs/*.md
|
|
22
|
+
# Then explicitly reverse the ignore rule for a single file:
|
|
23
|
+
#!docs/README.md
|
|
24
|
+
|
|
25
|
+
# Custom files to preserve during regeneration
|
|
26
|
+
example_transcribe.py
|
|
27
|
+
simple_example.py
|
|
28
|
+
EXAMPLE_README.md
|
|
29
|
+
REGENERATION_GUIDE.md
|
|
30
|
+
pyproject.toml
|
|
31
|
+
uv.lock
|
|
32
|
+
.venv/**
|
|
33
|
+
*.pyc
|
|
34
|
+
__pycache__/**
|
|
35
|
+
Makefile
|
|
36
|
+
regenerate.sh
|
|
37
|
+
fix_transcription_response.py
|
|
38
|
+
.gitignore
|
|
39
|
+
.openapi-generator-ignore
|
|
40
|
+
# Ignore OpenAI-Compatible Speech-to-Text Endpoints
|
|
41
|
+
speechall/api/open_ai_compatible_speech_to_text_api.py
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# ref: https://docs.travis-ci.com/user/languages/python
|
|
2
|
+
language: python
|
|
3
|
+
python:
|
|
4
|
+
- "3.7"
|
|
5
|
+
- "3.8"
|
|
6
|
+
- "3.9"
|
|
7
|
+
- "3.10"
|
|
8
|
+
- "3.11"
|
|
9
|
+
# uncomment the following if needed
|
|
10
|
+
#- "3.11-dev" # 3.11 development branch
|
|
11
|
+
#- "nightly" # nightly build
|
|
12
|
+
# command to install dependencies
|
|
13
|
+
install:
|
|
14
|
+
- "pip install -r requirements.txt"
|
|
15
|
+
- "pip install -r test-requirements.txt"
|
|
16
|
+
# command to run tests
|
|
17
|
+
script: pytest --cov=speechall
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Speechall Python SDK Example
|
|
2
|
+
|
|
3
|
+
This repository contains a Python SDK for the Speechall API, generated using OpenAPI Generator, with example scripts demonstrating how to use the transcribe endpoint.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
### 1. Install Dependencies
|
|
8
|
+
|
|
9
|
+
Make sure you have `uv` installed, then run:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
uv sync
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### 2. Set Up Authentication
|
|
16
|
+
|
|
17
|
+
Set your Speechall API token as an environment variable:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
export SPEECHALL_API_TOKEN="your-api-token-here"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 3. Run the Example
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
uv run python example_transcribe.py
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Features Demonstrated
|
|
30
|
+
|
|
31
|
+
The example script shows how to:
|
|
32
|
+
|
|
33
|
+
- **List Available Models**: Get all available speech-to-text models and their capabilities
|
|
34
|
+
- **Transcribe Local Files**: Upload and transcribe audio files from your local machine
|
|
35
|
+
- **Transcribe Remote URLs**: Transcribe audio files directly from URLs
|
|
36
|
+
- **Advanced Features**: Use speaker diarization, custom vocabulary, and smart formatting
|
|
37
|
+
|
|
38
|
+
## Available Models
|
|
39
|
+
|
|
40
|
+
The SDK supports numerous speech-to-text providers and models, including:
|
|
41
|
+
|
|
42
|
+
- **OpenAI**: `openai.whisper-1`, `openai.gpt-4o-transcribe`
|
|
43
|
+
- **Deepgram**: `deepgram.nova-2`, `deepgram.nova-3`, `deepgram.whisper-large`
|
|
44
|
+
- **AssemblyAI**: `assemblyai.best`, `assemblyai.nano`
|
|
45
|
+
- **Google**: `google.enhanced`, `google.standard`
|
|
46
|
+
- **Azure**: `azure.standard`
|
|
47
|
+
- **Groq**: `groq.whisper-large-v3`, `groq.whisper-large-v3-turbo`
|
|
48
|
+
- And many more!
|
|
49
|
+
|
|
50
|
+
## Example Usage
|
|
51
|
+
|
|
52
|
+
### Basic Transcription
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from openapi_client import ApiClient, Configuration
|
|
56
|
+
from openapi_client.api.speech_to_text_api import SpeechToTextApi
|
|
57
|
+
from openapi_client.models.transcription_model_identifier import TranscriptionModelIdentifier
|
|
58
|
+
|
|
59
|
+
# Set up client
|
|
60
|
+
configuration = Configuration()
|
|
61
|
+
configuration.access_token = "your-api-token"
|
|
62
|
+
api_client = ApiClient(configuration)
|
|
63
|
+
api_instance = SpeechToTextApi(api_client)
|
|
64
|
+
|
|
65
|
+
# Transcribe audio file
|
|
66
|
+
with open("audio.wav", "rb") as f:
|
|
67
|
+
result = api_instance.transcribe(
|
|
68
|
+
model=TranscriptionModelIdentifier.OPENAI_DOT_WHISPER_MINUS_1,
|
|
69
|
+
body=f.read(),
|
|
70
|
+
language="en"
|
|
71
|
+
)
|
|
72
|
+
print(result)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Advanced Features
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
# Use advanced features like diarization and custom vocabulary
|
|
79
|
+
result = api_instance.transcribe(
|
|
80
|
+
model=TranscriptionModelIdentifier.DEEPGRAM_DOT_NOVA_MINUS_2,
|
|
81
|
+
body=audio_data,
|
|
82
|
+
language="en",
|
|
83
|
+
output_format="verbose_json",
|
|
84
|
+
diarization=True,
|
|
85
|
+
custom_vocabulary=["technical", "terms"],
|
|
86
|
+
speakers_expected=2
|
|
87
|
+
)
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Supported Audio Formats
|
|
91
|
+
|
|
92
|
+
The API supports various audio formats including:
|
|
93
|
+
- WAV
|
|
94
|
+
- MP3
|
|
95
|
+
- FLAC
|
|
96
|
+
- OGG
|
|
97
|
+
- M4A
|
|
98
|
+
- And more (depends on the selected model/provider)
|
|
99
|
+
|
|
100
|
+
## Error Handling
|
|
101
|
+
|
|
102
|
+
The SDK includes proper error handling for common scenarios:
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
from openapi_client.exceptions import ApiException
|
|
106
|
+
|
|
107
|
+
try:
|
|
108
|
+
result = api_instance.transcribe(...)
|
|
109
|
+
except ApiException as e:
|
|
110
|
+
print(f"API Error: {e}")
|
|
111
|
+
except Exception as e:
|
|
112
|
+
print(f"Unexpected error: {e}")
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Next Steps
|
|
116
|
+
|
|
117
|
+
1. Get your API token from the Speechall dashboard
|
|
118
|
+
2. Replace the example audio file path with your actual audio file
|
|
119
|
+
3. Experiment with different models and parameters
|
|
120
|
+
4. Check the [Speechall API documentation](https://docs.speechall.com) for more details
|
|
121
|
+
|
|
122
|
+
## Support
|
|
123
|
+
|
|
124
|
+
For support and questions:
|
|
125
|
+
- Check the [Speechall documentation](https://docs.speechall.com)
|
|
126
|
+
- Contact support at team@speechall.com
|
speechall-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Speechall
|
|
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.
|
speechall-0.1.0/Makefile
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Speechall Python SDK Makefile
|
|
2
|
+
|
|
3
|
+
# Configuration
|
|
4
|
+
OPENAPI_SPEC_PATH = ../speechall-openapi/openapi.yaml
|
|
5
|
+
GENERATOR = python-pydantic-v1
|
|
6
|
+
OUTPUT_DIR = .
|
|
7
|
+
|
|
8
|
+
.PHONY: help install regenerate test example clean
|
|
9
|
+
|
|
10
|
+
# Default target
|
|
11
|
+
help:
|
|
12
|
+
@echo "๐๏ธ Speechall Python SDK Commands"
|
|
13
|
+
@echo "=================================="
|
|
14
|
+
@echo ""
|
|
15
|
+
@echo "๐ฆ Setup:"
|
|
16
|
+
@echo " make install - Install dependencies with uv"
|
|
17
|
+
@echo ""
|
|
18
|
+
@echo "๐ Code generation:"
|
|
19
|
+
@echo " make regenerate - Regenerate client from OpenAPI spec"
|
|
20
|
+
@echo " make force-regen - Force regenerate (skip validation)"
|
|
21
|
+
@echo " make fix - Apply TranscriptionResponse oneOf fix"
|
|
22
|
+
@echo ""
|
|
23
|
+
@echo "๐งช Testing:"
|
|
24
|
+
@echo " make test - Run tests"
|
|
25
|
+
@echo " make example - Run example script"
|
|
26
|
+
@echo ""
|
|
27
|
+
@echo "๐งน Cleanup:"
|
|
28
|
+
@echo " make clean - Clean generated files and cache"
|
|
29
|
+
|
|
30
|
+
# Install dependencies
|
|
31
|
+
install:
|
|
32
|
+
@echo "๐ฆ Installing dependencies..."
|
|
33
|
+
uv sync
|
|
34
|
+
|
|
35
|
+
# Regenerate client from OpenAPI spec
|
|
36
|
+
regenerate:
|
|
37
|
+
@echo "๐ Regenerating OpenAPI client..."
|
|
38
|
+
@if [ ! -f "$(OPENAPI_SPEC_PATH)" ]; then \
|
|
39
|
+
echo "โ Error: OpenAPI spec not found at $(OPENAPI_SPEC_PATH)"; \
|
|
40
|
+
echo "Please ensure the speechall-openapi repository is cloned"; \
|
|
41
|
+
exit 1; \
|
|
42
|
+
fi
|
|
43
|
+
./regenerate.sh
|
|
44
|
+
|
|
45
|
+
# Force regenerate (for development)
|
|
46
|
+
force-regen:
|
|
47
|
+
@echo "๐ Force regenerating OpenAPI client..."
|
|
48
|
+
openapi-generator generate \
|
|
49
|
+
-i $(OPENAPI_SPEC_PATH) \
|
|
50
|
+
-g $(GENERATOR) \
|
|
51
|
+
-o $(OUTPUT_DIR) \
|
|
52
|
+
--skip-validate-spec
|
|
53
|
+
@echo "โ ๏ธ Note: This may overwrite custom files!"
|
|
54
|
+
|
|
55
|
+
# Apply TranscriptionResponse oneOf fix
|
|
56
|
+
fix:
|
|
57
|
+
@echo "๐ง Applying TranscriptionResponse oneOf fix..."
|
|
58
|
+
python3 fix_transcription_response.py
|
|
59
|
+
|
|
60
|
+
# Run tests
|
|
61
|
+
test:
|
|
62
|
+
@echo "๐งช Running tests..."
|
|
63
|
+
uv run python -m pytest test/ -v
|
|
64
|
+
|
|
65
|
+
# Run example script
|
|
66
|
+
example:
|
|
67
|
+
@echo "๐ค Running example script..."
|
|
68
|
+
@if [ -z "$$SPEECHALL_API_TOKEN" ]; then \
|
|
69
|
+
echo "โ ๏ธ Warning: SPEECHALL_API_TOKEN not set"; \
|
|
70
|
+
echo "Set it with: export SPEECHALL_API_TOKEN='your-token'"; \
|
|
71
|
+
fi
|
|
72
|
+
uv run python example_transcribe.py
|
|
73
|
+
|
|
74
|
+
# Run simple example
|
|
75
|
+
simple:
|
|
76
|
+
@echo "๐ค Running simple example..."
|
|
77
|
+
@if [ -z "$$SPEECHALL_API_TOKEN" ]; then \
|
|
78
|
+
echo "โ ๏ธ Warning: SPEECHALL_API_TOKEN not set"; \
|
|
79
|
+
echo "Set it with: export SPEECHALL_API_TOKEN='your-token'"; \
|
|
80
|
+
fi
|
|
81
|
+
uv run python simple_example.py
|
|
82
|
+
|
|
83
|
+
# Clean up generated files and cache
|
|
84
|
+
clean:
|
|
85
|
+
@echo "๐งน Cleaning up..."
|
|
86
|
+
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
|
|
87
|
+
find . -name "*.pyc" -delete 2>/dev/null || true
|
|
88
|
+
rm -rf backup_*/ 2>/dev/null || true
|
|
89
|
+
@echo "โ
Cleanup complete"
|
|
90
|
+
|
|
91
|
+
# Development helpers
|
|
92
|
+
check-spec:
|
|
93
|
+
@echo "๐ Checking OpenAPI specification..."
|
|
94
|
+
@if [ -f "$(OPENAPI_SPEC_PATH)" ]; then \
|
|
95
|
+
echo "โ
OpenAPI spec found at $(OPENAPI_SPEC_PATH)"; \
|
|
96
|
+
openapi-generator validate -i $(OPENAPI_SPEC_PATH) || echo "โ ๏ธ Validation warnings found"; \
|
|
97
|
+
else \
|
|
98
|
+
echo "โ OpenAPI spec not found at $(OPENAPI_SPEC_PATH)"; \
|
|
99
|
+
fi
|
|
100
|
+
|
|
101
|
+
# List available models (requires API token)
|
|
102
|
+
list-models:
|
|
103
|
+
@echo "๐ Listing available models..."
|
|
104
|
+
@uv run python -c "import os; from openapi_client import *; from openapi_client.api.speech_to_text_api import SpeechToTextApi; config = Configuration(); config.access_token = os.getenv('SPEECHALL_API_TOKEN'); api = SpeechToTextApi(ApiClient(config)); [print(f'{m.model_id}: {m.display_name}') for m in api.list_speech_to_text_models()[:10]]" 2>/dev/null || echo "โ Failed to list models (check your API token)"
|