Speechall API Python SDK
Project description
speechall
The Speechall REST API provides powerful and flexible speech-to-text capabilities. It allows you to transcribe audio files using various underlying STT providers and models, optionally apply custom text replacement rules, and access results in multiple formats. The API includes standard endpoints for transcription and endpoints compatible with the OpenAI API structure.
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 0.1.0
- Package version: 0.2.0
- Generator version: 7.13.0
- Build package: org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen For more information, please visit https://speechall.com/contact
Requirements.
Python 3.7+
Installation & Usage
pip install
If the python package is hosted on a repository, you can install directly using:
pip install speechall
(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)
Then import the package:
import speechall
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install to install the package for all users)
Then import the package:
import speechall
Tests
Execute pytest to run the tests.
Getting Started
Please follow the installation procedure and then run the following:
import os
import speechall
from speechall.api.speech_to_text_api import SpeechToTextApi
from speechall.models.transcription_model_identifier import TranscriptionModelIdentifier
from speechall.models.transcript_language_code import TranscriptLanguageCode
from speechall.models.transcript_output_format import TranscriptOutputFormat
from speechall.rest import ApiException
# Defining the host is optional and defaults to https://api.speechall.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = speechall.Configuration(
host = "https://api.speechall.com/v1"
)
# Configure Bearer authorization (API Key): bearerAuth
configuration = speechall.Configuration(
access_token = os.environ["SPEECHALL_API_KEY"]
)
# Enter a context with an instance of the API client
with speechall.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = speechall.SpeechToTextApi(api_client)
# Path to your audio file
audio_file_path = "path/to/your/audio/file.wav"
try:
# Read the audio file
with open(audio_file_path, 'rb') as audio_file:
audio_data = audio_file.read()
# Transcribe the audio file
result = api_instance.transcribe(
model=TranscriptionModelIdentifier("openai.whisper-1"),
body=audio_data,
language=TranscriptLanguageCode("en"),
output_format=TranscriptOutputFormat.JSON,
punctuation=True
)
# Print the transcribed text
print("Transcription result:")
print(result.text)
except ApiException as e:
print("Exception when calling SpeechToTextApi->transcribe: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to https://api.speechall.com/v1
| Class | Method | HTTP request | Description |
|---|---|---|---|
| ReplacementRulesApi | create_replacement_ruleset | POST /replacement-rulesets | Create a reusable set of text replacement rules. |
| SpeechToTextApi | list_speech_to_text_models | GET /speech-to-text-models | Retrieve a list of all available speech-to-text models. |
| SpeechToTextApi | transcribe | POST /transcribe | Upload an audio file directly and receive a transcription. |
| SpeechToTextApi | transcribe_remote | POST /transcribe-remote | Transcribe an audio file located at a remote URL. |
Documentation For Models
- BaseTranscriptionConfiguration
- CreateReplacementRuleset201Response
- CreateReplacementRulesetRequest
- ErrorResponse
- ExactRule
- OpenAICreateTranslationRequestModel
- OpenaiCompatibleCreateTranscription200Response
- OpenaiCompatibleCreateTranslation200Response
- RegexGroupRule
- RegexRule
- RemoteTranscriptionConfiguration
- ReplacementRule
- SpeechToTextModel
- TranscriptLanguageCode
- TranscriptOutputFormat
- TranscriptionDetailed
- TranscriptionModelIdentifier
- TranscriptionOnlyText
- TranscriptionProvider
- TranscriptionResponse
- TranscriptionSegment
- TranscriptionWord
Documentation For Authorization
Authentication schemes defined for the API:
bearerAuth
- Type: Bearer authentication (API Key)
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 speechall-0.2.0.tar.gz.
File metadata
- Download URL: speechall-0.2.0.tar.gz
- Upload date:
- Size: 92.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
effa8ccc8dc7f9c3f58ff4f8e44f76892e607316f209a07b911d2b8c6a521c8d
|
|
| MD5 |
3e74eae356a3c97cd0d56e9aff3d32a5
|
|
| BLAKE2b-256 |
b8fe0620a69a5a4ec98cf5e289728e93f797f9b669eb329d6903f46271745f52
|
File details
Details for the file speechall-0.2.0-py3-none-any.whl.
File metadata
- Download URL: speechall-0.2.0-py3-none-any.whl
- Upload date:
- Size: 69.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a242262332ef5d06fc7f98269fd49bbd15ac78732e9281ebf963256b7c6eec1c
|
|
| MD5 |
c8468f546b78ad0482d1d3be30c59a13
|
|
| BLAKE2b-256 |
233c1a05f6bdc62a077e12fa13918867f6adcc97eca2a33e58f381dd12d2b190
|