deepdub


Namedeepdub JSON
Version 0.1.15 PyPI version JSON
download
home_pageNone
SummaryA Python client for interacting with the Deepdub API
upload_time2025-09-05 10:24:06
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT
keywords deepdub text-to-speech tts voice-cloning
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # DeepDub

A Python client for interacting with the DeepDub API, which provides text-to-speech capabilities with voice cloning features.

## Installation

```bash
pip install deepdub
```

## Features

- Interact with DeepDub's text-to-speech (TTS) API
- Add and manage voice profiles
- Generate speech from text with specified voices
- Command-line interface for easy usage

## Requirements

- Python 3.11+
- API key from DeepDub

## Usage

### Python API Reference

#### Initialization

```python
from deepdub import DeepdubClient

# Initialize with API key directly
client = DeepdubClient(api_key="your-api-key")

# Or use environment variable
# export DEEPDUB_API_KEY=your-api-key
client = DeepdubClient()
```

#### List Voices

```python
# Get all available voices
voices = client.list_voices()
```

Returns a list of voice dictionaries.

#### Add Voice

```python
# Add a new voice from audio file
response = client.add_voice(
    data=Path("path/to/audio.mp3"),  # Path object, bytes, or base64 string
    name="Voice Name",
    gender="male",  # "male" or "female"
    locale="en-US",
    publish=False,  # Default: False
    speaking_style="Neutral",  # Default: "Neutral"
    age=0  # Default: 0
)
```

Returns the server response with voice information.

#### Text-to-Speech

```python
# Generate speech from text
audio_data = client.tts(
    text="Text to be converted to speech",
    voice_prompt_id="your-voice-id",
    model="dd-etts-2.5",  # Default: "dd-etts-2.5"
    locale="en-US"  # Default: "en-US"
)

# Save the audio data
with open("output.mp3", "wb") as f:
    f.write(audio_data)
```

Returns binary audio data.

#### Retroactive Text-to-Speech

```python
# Get URL for generated audio
response = client.tts_retro(
    text="Text to be converted to speech",
    voice_prompt_id="your-voice-id",
    model="dd-etts-2.5",  # Default: "dd-etts-2.5"
    locale="en-US"  # Default: "en-US"
)

# Access the URL
audio_url = response["url"]
```

Returns a dictionary containing the URL to the generated audio.

### Command Line Interface

```bash
# List available voices
deepdub list-voices

# Add a new voice
deepdub add-voice --file path/to/audio.mp3 --name "Voice Name" --gender male --locale en-US

# Generate text-to-speech
deepdub tts --text "Hello, world!" --voice-prompt-id your-voice-id
```

### Python API

```python
from deepdub import DeepdubClient

# Initialize with your API key (or set DEEPDUB_API_KEY environment variable)
client = DeepdubClient(api_key="your-api-key")

# List available voices
voices = client.list_voices()
print(voices)

# Generate speech from text
response = client.tts(
    text="Hello, this is a test",
    voice_prompt_id="your-voice-id",
    locale="en-US"
)

# Save the audio output
with open("output.mp3", "wb") as f:
    f.write(response)
```

## Authentication

Set your API key either:
- As an environment variable: `DEEPDUB_API_KEY=your-key`
- When initializing the client: `DeepdubClient(api_key="your-key")`
- Using the `--api-key` flag with CLI commands

## License

[License information]

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "deepdub",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "deepdub, text-to-speech, tts, voice-cloning",
    "author": null,
    "author_email": "Deepdub <info@deepdub.ai>",
    "download_url": "https://files.pythonhosted.org/packages/d8/32/e18bd8e108af3011a2557ccf1f525826260450d168bb0604e6eae428d864/deepdub-0.1.15.tar.gz",
    "platform": null,
    "description": "# DeepDub\n\nA Python client for interacting with the DeepDub API, which provides text-to-speech capabilities with voice cloning features.\n\n## Installation\n\n```bash\npip install deepdub\n```\n\n## Features\n\n- Interact with DeepDub's text-to-speech (TTS) API\n- Add and manage voice profiles\n- Generate speech from text with specified voices\n- Command-line interface for easy usage\n\n## Requirements\n\n- Python 3.11+\n- API key from DeepDub\n\n## Usage\n\n### Python API Reference\n\n#### Initialization\n\n```python\nfrom deepdub import DeepdubClient\n\n# Initialize with API key directly\nclient = DeepdubClient(api_key=\"your-api-key\")\n\n# Or use environment variable\n# export DEEPDUB_API_KEY=your-api-key\nclient = DeepdubClient()\n```\n\n#### List Voices\n\n```python\n# Get all available voices\nvoices = client.list_voices()\n```\n\nReturns a list of voice dictionaries.\n\n#### Add Voice\n\n```python\n# Add a new voice from audio file\nresponse = client.add_voice(\n    data=Path(\"path/to/audio.mp3\"),  # Path object, bytes, or base64 string\n    name=\"Voice Name\",\n    gender=\"male\",  # \"male\" or \"female\"\n    locale=\"en-US\",\n    publish=False,  # Default: False\n    speaking_style=\"Neutral\",  # Default: \"Neutral\"\n    age=0  # Default: 0\n)\n```\n\nReturns the server response with voice information.\n\n#### Text-to-Speech\n\n```python\n# Generate speech from text\naudio_data = client.tts(\n    text=\"Text to be converted to speech\",\n    voice_prompt_id=\"your-voice-id\",\n    model=\"dd-etts-2.5\",  # Default: \"dd-etts-2.5\"\n    locale=\"en-US\"  # Default: \"en-US\"\n)\n\n# Save the audio data\nwith open(\"output.mp3\", \"wb\") as f:\n    f.write(audio_data)\n```\n\nReturns binary audio data.\n\n#### Retroactive Text-to-Speech\n\n```python\n# Get URL for generated audio\nresponse = client.tts_retro(\n    text=\"Text to be converted to speech\",\n    voice_prompt_id=\"your-voice-id\",\n    model=\"dd-etts-2.5\",  # Default: \"dd-etts-2.5\"\n    locale=\"en-US\"  # Default: \"en-US\"\n)\n\n# Access the URL\naudio_url = response[\"url\"]\n```\n\nReturns a dictionary containing the URL to the generated audio.\n\n### Command Line Interface\n\n```bash\n# List available voices\ndeepdub list-voices\n\n# Add a new voice\ndeepdub add-voice --file path/to/audio.mp3 --name \"Voice Name\" --gender male --locale en-US\n\n# Generate text-to-speech\ndeepdub tts --text \"Hello, world!\" --voice-prompt-id your-voice-id\n```\n\n### Python API\n\n```python\nfrom deepdub import DeepdubClient\n\n# Initialize with your API key (or set DEEPDUB_API_KEY environment variable)\nclient = DeepdubClient(api_key=\"your-api-key\")\n\n# List available voices\nvoices = client.list_voices()\nprint(voices)\n\n# Generate speech from text\nresponse = client.tts(\n    text=\"Hello, this is a test\",\n    voice_prompt_id=\"your-voice-id\",\n    locale=\"en-US\"\n)\n\n# Save the audio output\nwith open(\"output.mp3\", \"wb\") as f:\n    f.write(response)\n```\n\n## Authentication\n\nSet your API key either:\n- As an environment variable: `DEEPDUB_API_KEY=your-key`\n- When initializing the client: `DeepdubClient(api_key=\"your-key\")`\n- Using the `--api-key` flag with CLI commands\n\n## License\n\n[License information]\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python client for interacting with the Deepdub API",
    "version": "0.1.15",
    "project_urls": {
        "Bug Tracker": "https://github.com/deepdub-ai/deepdub/issues",
        "Homepage": "https://github.com/deepdub-ai/deepdub"
    },
    "split_keywords": [
        "deepdub",
        " text-to-speech",
        " tts",
        " voice-cloning"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9fe37728b3a3e055bda23929935fe6fea2b3fe963c0e0ff40fd311882664a500",
                "md5": "3a647b998d3bbd3b3fd47560eb0e9210",
                "sha256": "a12eb7a21ab51902973f7f47cb09ea5303707f0c281f8ce18ca0c740dc344ce0"
            },
            "downloads": -1,
            "filename": "deepdub-0.1.15-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3a647b998d3bbd3b3fd47560eb0e9210",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 8370,
            "upload_time": "2025-09-05T10:24:05",
            "upload_time_iso_8601": "2025-09-05T10:24:05.408373Z",
            "url": "https://files.pythonhosted.org/packages/9f/e3/7728b3a3e055bda23929935fe6fea2b3fe963c0e0ff40fd311882664a500/deepdub-0.1.15-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d832e18bd8e108af3011a2557ccf1f525826260450d168bb0604e6eae428d864",
                "md5": "52dd0629ade48bc3f1addf872f77d751",
                "sha256": "fb7160b7d4c55da22e0e8df44f6623b80215f0fa04f131332815f8f19e82bbb4"
            },
            "downloads": -1,
            "filename": "deepdub-0.1.15.tar.gz",
            "has_sig": false,
            "md5_digest": "52dd0629ade48bc3f1addf872f77d751",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 8958,
            "upload_time": "2025-09-05T10:24:06",
            "upload_time_iso_8601": "2025-09-05T10:24:06.610020Z",
            "url": "https://files.pythonhosted.org/packages/d8/32/e18bd8e108af3011a2557ccf1f525826260450d168bb0604e6eae428d864/deepdub-0.1.15.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-05 10:24:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "deepdub-ai",
    "github_project": "deepdub",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "deepdub"
}
        
Elapsed time: 9.83119s