Metadata-Version: 2.4
Name: soniox-pro-sdk
Version: 1.0.0
Summary: Professional Python SDK for Soniox Speech-to-Text API - Blazing fast, production-ready, and fully-featured
Project-URL: Homepage, https://github.com/behnamebrahimi/soniox-python-sdk
Project-URL: Documentation, https://soniox-python-sdk.readthedocs.io
Project-URL: Repository, https://github.com/behnamebrahimi/soniox-python-sdk
Project-URL: Bug Tracker, https://github.com/behnamebrahimi/soniox-python-sdk/issues
Author-email: Behnam Ebrahimi <behnam@example.com>
License: MIT
License-File: LICENSE
Keywords: async,real-time,soniox,speech-to-text,stt,transcription,translation,websocket
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: typing-extensions>=4.10.0; python_version < '3.13'
Requires-Dist: websockets>=13.0
Provides-Extra: all
Requires-Dist: aiohttp>=3.10.0; extra == 'all'
Requires-Dist: bandit[toml]>=1.7.0; extra == 'all'
Requires-Dist: black>=24.0.0; extra == 'all'
Requires-Dist: cython>=3.0.0; extra == 'all'
Requires-Dist: detect-secrets>=1.4.0; extra == 'all'
Requires-Dist: isort>=5.13.0; extra == 'all'
Requires-Dist: mkdocs-material>=9.5.0; extra == 'all'
Requires-Dist: mkdocs>=1.5.0; extra == 'all'
Requires-Dist: mkdocstrings[python]>=0.24.0; extra == 'all'
Requires-Dist: mypy>=1.8.0; extra == 'all'
Requires-Dist: numpy>=1.26.0; extra == 'all'
Requires-Dist: pre-commit>=3.6.0; extra == 'all'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'all'
Requires-Dist: pytest-cov>=4.1.0; extra == 'all'
Requires-Dist: pytest-mock>=3.12.0; extra == 'all'
Requires-Dist: pytest>=8.0.0; extra == 'all'
Requires-Dist: ruff>=0.2.0; extra == 'all'
Provides-Extra: async
Requires-Dist: aiohttp>=3.10.0; extra == 'async'
Provides-Extra: dev
Requires-Dist: bandit[toml]>=1.7.0; extra == 'dev'
Requires-Dist: black>=24.0.0; extra == 'dev'
Requires-Dist: detect-secrets>=1.4.0; extra == 'dev'
Requires-Dist: isort>=5.13.0; extra == 'dev'
Requires-Dist: mypy>=1.8.0; extra == 'dev'
Requires-Dist: pre-commit>=3.6.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
Requires-Dist: pytest-mock>=3.12.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.2.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.5.0; extra == 'docs'
Requires-Dist: mkdocs>=1.5.0; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.24.0; extra == 'docs'
Provides-Extra: performance
Requires-Dist: cython>=3.0.0; extra == 'performance'
Requires-Dist: numpy>=1.26.0; extra == 'performance'
Description-Content-Type: text/markdown

# Soniox Pro SDK

[![PyPI version](https://badge.fury.io/py/soniox-pro-sdk.svg)](https://badge.fury.io/py/soniox-pro-sdk)
[![Python Support](https://img.shields.io/pypi/pyversions/soniox-pro-sdk.svg)](https://pypi.org/project/soniox-pro-sdk/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

**The most powerful, flexible, and blazing-fast Python SDK for the Soniox Speech-to-Text API.**

Production-ready, fully-typed, and optimised for performance.

## Features

### Complete API Coverage
- REST API (Files, Transcriptions, Models, Authentication)
- WebSocket API (Real-time transcription and translation)
- Synchronous and asynchronous interfaces
- Full type safety with Pydantic models

### Performance Optimised
- Blazing fast with optional C extensions
- Connection pooling for HTTP and WebSocket
- Async I/O throughout
- Memory-efficient streaming

### Advanced Capabilities
- 60+ languages supported
- Real-time translation (one-way and two-way)
- Speaker diarization (up to 15 speakers)
- Language identification
- Endpoint detection
- Custom context and vocabulary
- Word-level timestamps
- Confidence scores

### Developer Experience
- Comprehensive documentation
- Full IDE autocomplete support
- 90%+ test coverage
- Type-checked with mypy
- Clean, Pythonic API

## Installation

### Basic Installation
```bash
# Using uv (recommended)
uv add soniox-pro-sdk

# Using pip
pip install soniox-pro-sdk
```

### Optional Dependencies
```bash
# Async support
pip install soniox-pro-sdk[async]

# Performance optimisations (C extensions)
pip install soniox-pro-sdk[performance]

# Development tools
pip install soniox-pro-sdk[dev]

# Everything
pip install soniox-pro-sdk[all]
```

## Quick Start

### Async Transcription
```python
from soniox import SonioxClient

# Initialise client
client = SonioxClient(api_key="your-api-key")

# Transcribe from URL
transcription = client.transcriptions.create(
    audio_url="https://example.com/audio.mp3",
    model="stt-async-v3",
    enable_speaker_diarization=True,
)

# Wait for completion
result = client.transcriptions.wait_for_completion(transcription.id)
print(result.transcript.text)
```

### Real-time Transcription
```python
from soniox import SonioxRealtimeClient

# Initialise real-time client
client = SonioxRealtimeClient(
    api_key="your-api-key",
    model="stt-rt-v3",
)

# Stream audio
with client.stream() as stream:
    with open("audio.mp3", "rb") as f:
        while chunk := f.read(4096):
            stream.send_audio(chunk)

    # Receive tokens
    for response in stream:
        for token in response.tokens:
            if token.is_final:
                print(token.text, end="")
```

### Async/Await Support
```python
import asyncio
from soniox import AsyncSonioxClient

async def transcribe():
    async with AsyncSonioxClient(api_key="your-api-key") as client:
        file = await client.files.upload("audio.mp3")
        transcription = await client.transcriptions.create(file_id=file.id)
        result = await client.transcriptions.wait_for_completion(transcription.id)
        return result.transcript.text

text = asyncio.run(transcribe())
```

## Documentation

Full documentation available at: <https://github.com/behnamebrahimi/soniox-pro-sdk>

## Testing

```bash
# Run tests
uv run pytest

# With coverage
uv run pytest --cov=soniox

# Type check
uv run mypy src/soniox

# Lint
uv run ruff check src/soniox
```

## License

MIT License - see [LICENSE](LICENSE) for details.

## Links

- Documentation: <https://github.com/behnamebrahimi/soniox-pro-sdk>
- Source Code: <https://github.com/behnamebrahimi/soniox-pro-sdk>
- Soniox API: <https://soniox.com/docs>

---

**Built for the developer community**
