Metadata-Version: 2.4
Name: cronygen
Version: 0.1.0
Summary: Official Python SDK for CronyGen Text-to-Speech API
Project-URL: Homepage, https://zingotron.com
Project-URL: Documentation, https://zingotron.com/docs/sdks/python
Project-URL: Repository, https://github.com/cronygen/cronygen-python
Author-email: CronyGen <support@zingotron.com>
License-Expression: MIT
Keywords: ai,audio,speech-synthesis,text-to-speech,tts,voice
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
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 :: Multimedia :: Sound/Audio :: Speech
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Requires-Dist: httpx>=0.24.0
Provides-Extra: dev
Requires-Dist: black>=23.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
Requires-Dist: pytest-httpx>=0.21; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1; extra == 'dev'
Description-Content-Type: text/markdown

# CronyGen Python SDK

Official Python SDK for the CronyGen Text-to-Speech API.

## Installation

```bash
pip install cronygen
```

## Quick Start

```python
from cronygen import CronyGen

# Initialize client
client = CronyGen(api_key="crony_sk_your_api_key")

# Generate TTS with a default voice
generation = client.tts.generate(
    text="Hello world! This is a test of CronyGen text-to-speech.",
    voice="en-us-aria"
)

# Download the audio
client.tts.download(generation, "output.wav")
print(f"Audio saved! Duration: {generation.output_duration_seconds}s")
```

## Features

- **Sync & Async clients** - Use `CronyGen` or `AsyncCronyGen`
- **Default voices** - 20+ pre-configured voices across accents
- **Automatic polling** - Wait for generation completion
- **Type hints** - Full type annotations for IDE support

## Voices

```python
# List default voices
voices = client.voices.list_defaults(gender="female", accent="american")
for voice in voices:
    print(f"{voice.name}: {voice.slug}")

# List your cloned voices (created via dashboard)
my_voices = client.voices.list()
for voice in my_voices.data:
    print(f"{voice.name}: {voice.id} ({voice.status})")

# Use a cloned voice for TTS
generation = client.tts.generate(
    text="This is my cloned voice!",
    voice=my_voices.data[0].id,
    voice_type="cloned"
)
```

## Async Usage

```python
import asyncio
from cronygen import AsyncCronyGen

async def main():
    async with AsyncCronyGen(api_key="crony_sk_your_api_key") as client:
        generation = await client.tts.generate(
            text="Hello async world!",
            voice="en-uk-ronald"
        )
        print(f"Audio URL: {generation.output_audio_url}")

asyncio.run(main())
```

## Error Handling

```python
from cronygen import CronyGen, InsufficientCreditsError, RateLimitError

client = CronyGen(api_key="crony_sk_your_api_key")

try:
    generation = client.tts.generate(text="Hello world!")
except InsufficientCreditsError as e:
    print(f"Not enough credits: {e.available} available, {e.required} required")
except RateLimitError as e:
    print(f"Rate limited. Retry after {e.retry_after} seconds")
```

## Documentation

Full documentation at [zingotron.com/docs/sdks/python](https://zingotron.com/docs/sdks/python)
