Metadata-Version: 2.4
Name: cjm-transcription-plugin-whisper
Version: 0.0.7
Summary: OpenAI Whisper plugin for the cjm-transcription-plugin-system library - provides local speech-to-text transcription with configurable model selection and parameter control.
Home-page: https://github.com/cj-mills/cjm-transcription-plugin-whisper
Author: Christian J. Mills
Author-email: 9126128+cj-mills@users.noreply.github.com
License: Apache Software License 2.0
Keywords: nbdev jupyter notebook python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastcore
Requires-Dist: pandas
Requires-Dist: cjm_transcription_plugin_system
Requires-Dist: openai-whisper
Requires-Dist: torch
Requires-Dist: numpy
Requires-Dist: soundfile
Requires-Dist: cjm_ffmpeg_utils
Provides-Extra: dev
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# cjm-transcription-plugin-whisper


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Install

``` bash
pip install cjm_transcription_plugin_whisper
```

## Project Structure

    nbs/
    └── plugin.ipynb # Plugin implementation for OpenAI Whisper transcription

Total: 1 notebook across 1 directory

## Module Dependencies

``` mermaid
graph LR
    plugin[plugin<br/>Whisper Plugin]
```

No cross-module dependencies detected.

## CLI Reference

No CLI commands found in this project.

## Module Overview

Detailed documentation for each module in the project:

### Whisper Plugin (`plugin.ipynb`)

> Plugin implementation for OpenAI Whisper transcription

#### Import

``` python
from cjm_transcription_plugin_whisper.plugin import (
    WhisperPluginConfig,
    WhisperLocalPlugin
)
```

#### Classes

``` python
@dataclass
class WhisperPluginConfig:
    "Configuration for Whisper transcription plugin."
    
    model: str = field(...)
    device: str = field(...)
    language: Optional[str] = field(...)
    task: str = field(...)
    temperature: float = field(...)
    temperature_increment_on_fallback: Optional[float] = field(...)
    beam_size: int = field(...)
    best_of: int = field(...)
    patience: float = field(...)
    length_penalty: Optional[float] = field(...)
    suppress_tokens: str = field(...)
    initial_prompt: Optional[str] = field(...)
    condition_on_previous_text: bool = field(...)
    fp16: bool = field(...)
    compression_ratio_threshold: float = field(...)
    logprob_threshold: float = field(...)
    no_speech_threshold: float = field(...)
    word_timestamps: bool = field(...)
    prepend_punctuations: str = field(...)
    append_punctuations: str = field(...)
    threads: int = field(...)
    model_dir: Optional[str] = field(...)
    compile_model: bool = field(...)
```

``` python
class WhisperLocalPlugin:
    def __init__(self):
        """Initialize the Whisper plugin with default configuration."""
        self.logger = logging.getLogger(f"{__name__}.{type(self).__name__}")
        self.config: WhisperPluginConfig = None
    "OpenAI Whisper transcription plugin."
    
    def __init__(self):
            """Initialize the Whisper plugin with default configuration."""
            self.logger = logging.getLogger(f"{__name__}.{type(self).__name__}")
            self.config: WhisperPluginConfig = None
        "Initialize the Whisper plugin with default configuration."
    
    def name(
            self
        ) -> str:  # Plugin name identifier
        "Get the plugin name identifier."
    
    def version(
            self
        ) -> str:  # Plugin version string
        "Get the plugin version string."
    
    def supported_formats(
            self
        ) -> List[str]:  # List of supported audio file formats
        "Get the list of supported audio file formats."
    
    def get_current_config(
            self
        ) -> WhisperPluginConfig:  # Current configuration dataclass
        "Return current configuration."
    
    def get_config_dataclass() -> WhisperPluginConfig: # Configuration dataclass
            """Return dataclass describing the plugin's configuration options."""
            return WhisperPluginConfig
        
        def initialize(
            self,
            config: Optional[Any] = None  # Configuration dataclass, dict, or None
        ) -> None
        "Return dataclass describing the plugin's configuration options."
    
    def initialize(
            self,
            config: Optional[Any] = None  # Configuration dataclass, dict, or None
        ) -> None
        "Initialize the plugin with configuration."
    
    def execute(
            self,
            audio: Union[AudioData, str, Path],  # Audio data or path to audio file to transcribe
            **kwargs  # Additional arguments to override config
        ) -> TranscriptionResult:  # Transcription result with text and metadata
        "Transcribe audio using Whisper."
    
    def is_available(
            self
        ) -> bool:  # True if Whisper and its dependencies are available
        "Check if Whisper is available."
    
    def cleanup(
            self
        ) -> None
        "Clean up resources."
```
