Skip to content

Speechall/speechall-python-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Documentation For Authorization

Authentication schemes defined for the API:

bearerAuth

  • Type: Bearer authentication (API Key)

About

Python SDK for the Speechall API - The unified speech-to-text service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •