Metadata-Version: 2.4
Name: speechall
Version: 0.2.0
Summary: Speechall API Python SDK
Author-email: Speechall <info@actondon.com>
License-Expression: MIT
License-File: LICENSE
Keywords: API,ASR,Speech-to-Text,Speechall,Transcription
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: OS Independent
Classifier: Operating System :: POSIX
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.8
Requires-Dist: aenum>=3.1.11
Requires-Dist: pydantic<2,>=1.10.5
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: urllib3>=1.25.3
Provides-Extra: dev
Requires-Dist: flake8>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.2.1; extra == 'dev'
Requires-Dist: tox>=3.9.0; extra == 'dev'
Description-Content-Type: text/markdown

# 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](https://openapi-generator.tech) 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](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:

```sh
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:
```python
import speechall
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import speechall
```

### Tests

Execute `pytest` to run the tests.

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python

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**](docs/ReplacementRulesApi.md#create_replacement_ruleset) | **POST** /replacement-rulesets | Create a reusable set of text replacement rules.
*SpeechToTextApi* | [**list_speech_to_text_models**](docs/SpeechToTextApi.md#list_speech_to_text_models) | **GET** /speech-to-text-models | Retrieve a list of all available speech-to-text models.
*SpeechToTextApi* | [**transcribe**](docs/SpeechToTextApi.md#transcribe) | **POST** /transcribe | Upload an audio file directly and receive a transcription.
*SpeechToTextApi* | [**transcribe_remote**](docs/SpeechToTextApi.md#transcribe_remote) | **POST** /transcribe-remote | Transcribe an audio file located at a remote URL.


## Documentation For Models

 - [BaseTranscriptionConfiguration](docs/BaseTranscriptionConfiguration.md)
 - [CreateReplacementRuleset201Response](docs/CreateReplacementRuleset201Response.md)
 - [CreateReplacementRulesetRequest](docs/CreateReplacementRulesetRequest.md)
 - [ErrorResponse](docs/ErrorResponse.md)
 - [ExactRule](docs/ExactRule.md)
 - [OpenAICreateTranslationRequestModel](docs/OpenAICreateTranslationRequestModel.md)
 - [OpenaiCompatibleCreateTranscription200Response](docs/OpenaiCompatibleCreateTranscription200Response.md)
 - [OpenaiCompatibleCreateTranslation200Response](docs/OpenaiCompatibleCreateTranslation200Response.md)
 - [RegexGroupRule](docs/RegexGroupRule.md)
 - [RegexRule](docs/RegexRule.md)
 - [RemoteTranscriptionConfiguration](docs/RemoteTranscriptionConfiguration.md)
 - [ReplacementRule](docs/ReplacementRule.md)
 - [SpeechToTextModel](docs/SpeechToTextModel.md)
 - [TranscriptLanguageCode](docs/TranscriptLanguageCode.md)
 - [TranscriptOutputFormat](docs/TranscriptOutputFormat.md)
 - [TranscriptionDetailed](docs/TranscriptionDetailed.md)
 - [TranscriptionModelIdentifier](docs/TranscriptionModelIdentifier.md)
 - [TranscriptionOnlyText](docs/TranscriptionOnlyText.md)
 - [TranscriptionProvider](docs/TranscriptionProvider.md)
 - [TranscriptionResponse](docs/TranscriptionResponse.md)
 - [TranscriptionSegment](docs/TranscriptionSegment.md)
 - [TranscriptionWord](docs/TranscriptionWord.md)


<a id="documentation-for-authorization"></a>
## Documentation For Authorization


Authentication schemes defined for the API:
<a id="bearerAuth"></a>
### bearerAuth

- **Type**: Bearer authentication (API Key)
