cjm-transcription-plugin-whisper
Install
pip install cjm_transcription_plugin_whisper
Project Structure
nbs/
├── meta.ipynb # Metadata introspection for the Whisper plugin used by cjm-ctl to generate the registration manifest.
└── plugin.ipynb # Plugin implementation for OpenAI Whisper transcription
Total: 2 notebooks across 1 directory
Module Dependencies
graph LR
meta[meta<br/>Metadata]
plugin[plugin<br/>Whisper Plugin]
plugin --> meta
1 cross-module dependencies detected
CLI Reference
No CLI commands found in this project.
Module Overview
Detailed documentation for each module in the project:
Metadata (meta.ipynb)
Metadata introspection for the Whisper plugin used by cjm-ctl to generate the registration manifest.
Import
from cjm_transcription_plugin_whisper.meta import (
get_plugin_metadata
)
Functions
def get_plugin_metadata() -> Dict[str, Any]: # Plugin metadata for manifest generation
"""Return metadata required to register this plugin with the PluginManager."""
# Fallback base path (current behavior for backward compatibility)
base_path = os.path.dirname(os.path.dirname(sys.executable))
# Use CJM config if available, else fallback to env-relative paths
cjm_data_dir = os.environ.get("CJM_DATA_DIR")
cjm_models_dir = os.environ.get("CJM_MODELS_DIR")
# Plugin data directory
plugin_name = "cjm-transcription-plugin-whisper"
if cjm_data_dir
"Return metadata required to register this plugin with the PluginManager."
Whisper Plugin (plugin.ipynb)
Plugin implementation for OpenAI Whisper transcription
Import
from cjm_transcription_plugin_whisper.plugin import (
WhisperPluginConfig,
WhisperLocalPlugin
)
Classes
@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(...)
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."""
return "whisper_local"
@property
def version(self) -> str: # Plugin version string
"Get the plugin name identifier."
def version(self) -> str: # Plugin version string
"""Get the plugin version string."""
return "1.0.0"
@property
def supported_formats(self) -> List[str]: # List of supported audio file formats
"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."""
return ["wav", "mp3", "flac", "m4a", "ogg", "webm", "mp4", "avi", "mov"]
def get_current_config(self) -> Dict[str, Any]: # Current configuration as dictionary
"Get the list of supported audio file formats."
def get_current_config(self) -> Dict[str, Any]: # Current configuration as dictionary
"""Return current configuration state."""
if not self.config
"Return current configuration state."
def get_config_schema(self) -> Dict[str, Any]: # JSON Schema for configuration
"""Return JSON Schema for UI generation."""
return dataclass_to_jsonschema(WhisperPluginConfig)
@staticmethod
def get_config_dataclass() -> WhisperPluginConfig: # Configuration dataclass
"Return JSON Schema for UI generation."
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 or re-configure the plugin (idempotent)."
def execute(
self,
audio: Union[str, Path], # Path to the audio file to transcribe
**kwargs # Additional arguments to override config
) -> TranscriptionResult: # Transcription result with text and metadata
"Transcribe audio using Whisper.
`audio` is a path to a decodable audio file; the caller guarantees it is
model-ready (format / sample-rate / channels handled upstream)."
def is_available(self) -> bool: # True if Whisper and its dependencies are available
"""Check if Whisper is available."""
return WHISPER_AVAILABLE
def cleanup(self) -> None
"Check if Whisper is available."
def cleanup(self) -> None:
"""Clean up resources."""
if self.model is not None
"Clean up resources."
Metadata
Release files for cjm-transcription-plugin-whisper 0.0.40
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| cjm_transcription_plugin_whisper-0.0.40.tar.gz | 16.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cjm_transcription_plugin_whisper-0.0.40-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.0 kB
Release files / cjm_transcription_plugin_whisper-0.0.40.tar.gz
| Download URL | cjm_transcription_plugin_whisper-0.0.40.tar.gz |
|---|---|
| Size | 16.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a9be2fad22ff37c23251e0450bacae4f6f299bb303531c3146ed30499821dee
|
|
BLAKE2b-256 checksum How to use checksums |
aa35927f5df7aa0bbb520ef942551323fa132ed3cc3f446f62546d3a4c179942
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Release files / cjm_transcription_plugin_whisper-0.0.40-py3-none-any.whl
| Download URL | cjm_transcription_plugin_whisper-0.0.40-py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a4b5d419cba35189f056c07e8aa13c1e5f26f833fa99d2ba9b776a584534f0e1
|
|
BLAKE2b-256 checksum How to use checksums |
9751bb62cdb7aabfde661fa547a41588399fc48e8348e7a565cd68c5d69312d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Security for cjm-transcription-plugin-whisper 0.0.40
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.