murf


Namemurf JSON
Version 2.0.1 PyPI version JSON
download
home_pageNone
SummaryNone
upload_time2025-07-24 06:43:12
maintainerNone
docs_urlNone
authorNone
requires_python<4.0,>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Murf Python SDK

![Murf AI Logo](https://murf.ai/public-assets/home/Murf_Logo.png)

[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fmurf-ai%2Fmurf-python-sdk)
[![pypi](https://img.shields.io/pypi/v/murf)](https://pypi.python.org/pypi/murf)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/gist/devgeetech-murf/bbe2c7eb01433f4a151f0fd2be23b1c8/murf-python-sdk.ipynb)

## Table of Contents

- [Overview](#overview)
- [Installation](#installation)
- [Getting Started](#getting-started)
- [Features](#features)
- [Asynchronous Usage](#async-client)
- [Exception Handling](#exception-handling)
- [Advanced Configuration](#advanced)
- [Contributing](#contributing)
- [License](#license)

---

## Overview

The Murf Python SDK offers seamless integration with the [Murf AI](https://murf.ai/) [text-to-speech software](https://murf.ai/text-to-speech), enabling developers and creators to convert text into lifelike speech effortlessly. With over 130 natural-sounding voices across 21 languages and 20+ speaking styles, Murf provides unparalleled speech customization for a wide range of applications. The SDK is designed for both synchronous and asynchronous workflows, featuring robust error handling, advanced configuration options, and support for real-time applications.

---

## Installation

Check out the [HTTP API documentation](https://murf.ai/api/docs/introduction/quickstart).

Install the SDK using pip:

```bash
pip install murf
```

---

## Getting Started

Here's a quick example to get you started with the Murf SDK:

```python
from murf import Murf

client = Murf(
    api_key="YOUR_API_KEY",
)
client.text_to_speech.generate(
    format="MP3",
    sample_rate=44100.0,
    text="Hello, world!",
    voice_id="en-US-natalie",
)
```

For more detailed information, refer to the [official documentation](https://murf.ai/api/docs/introduction/quickstart).

---

## Features

- **Text-to-Speech Conversion:** Transform text into natural-sounding speech.
- **Multilingual Support:** Access voices in over 21 languages, including English, French, German, Spanish, Italian, Hindi, Portuguese, Dutch, Korean, Chinese (Mandarin), Bengali, Tamil, Polish, Japanese, Turkish, Indonesian, Croatian, Greek, Romanian, Slovak, and Bulgarian.

![Murf AI Languages](https://murf.ai/public-assets/home/Murf_Languages_21.jpg)

- **Multiple Voice Styles:** Choose from 20+ speaking styles to suit your application's needs.
- **Advanced Voice Customization:** Adjust parameters like pitch, speed, pauses, and pronunciation for optimal output. Fine-grained controls let you tailor the voice output to match your specific requirements.
- **Multiple Audio Formats:** Generate audio in various formats (e.g., MP3, WAV) with configurable sample rates for optimal quality.
- **Real-Time Processing:** Benefit from asynchronous API calls that support non-blocking, real-time audio generation and streaming scenarios.


---

## Async Client

The SDK also exports an `async` client so that you can make non-blocking calls to our API.

```python
import asyncio

from murf import AsyncMurf

client = AsyncMurf(
    api_key="YOUR_API_KEY",
)


async def main() -> None:
    await client.text_to_speech.generate(
        format="MP3",
        sample_rate=44100.0,
        text="Hello, world!",
        voice_id="en-US-natalie",
    )


asyncio.run(main())
```

---

## Exception Handling

When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
will be thrown.

```python
from murf.core.api_error import ApiError

try:
    client.text_to_speech.generate(...)
except ApiError as e:
    print(e.status_code)
    print(e.body)
```

---

## Advanced

### Retries

The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
as the request is deemed retriable and the number of retry attempts has not grown larger than the configured
retry limit (default: 2).

A request is deemed retriable when any of the following HTTP status codes is returned:

- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)

Use the `max_retries` request option to configure this behavior.

```python
client.text_to_speech.generate(..., request_options={
    "max_retries": 1
})
```

### Timeouts

The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.

```python

from murf import Murf

client = Murf(
    ...,
    timeout=20.0,
)


# Override timeout for a specific method
client.text_to_speech.generate(..., request_options={
    "timeout_in_seconds": 1
})
```

### Custom Client

You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
and transports.
```python
import httpx
from murf import Murf

client = Murf(
    ...,
    httpx_client=httpx.Client(
        proxies="http://my.test.proxy.example.com",
        transport=httpx.HTTPTransport(local_address="0.0.0.0"),
    ),
)
```

---

## Contributing

We welcome contributions to enhance the Murf Python SDK. Please note that this library is generated programmatically, so direct modifications may be overwritten. We suggest opening an issue first to discuss your ideas or improvements. Contributions to the documentation are especially appreciated! For any support queries email to support@murf.ai 

---

## License

Murf Python SDK is released under the [MIT License](LICENSE).

---

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "murf",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/20/cd/2b8a896cfd25a6a149fa48e349aba01f8dfb23738f48b56bd351c3db436b/murf-2.0.1.tar.gz",
    "platform": null,
    "description": "# Murf Python SDK\n\n![Murf AI Logo](https://murf.ai/public-assets/home/Murf_Logo.png)\n\n[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fmurf-ai%2Fmurf-python-sdk)\n[![pypi](https://img.shields.io/pypi/v/murf)](https://pypi.python.org/pypi/murf)\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/gist/devgeetech-murf/bbe2c7eb01433f4a151f0fd2be23b1c8/murf-python-sdk.ipynb)\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Installation](#installation)\n- [Getting Started](#getting-started)\n- [Features](#features)\n- [Asynchronous Usage](#async-client)\n- [Exception Handling](#exception-handling)\n- [Advanced Configuration](#advanced)\n- [Contributing](#contributing)\n- [License](#license)\n\n---\n\n## Overview\n\nThe Murf Python SDK offers seamless integration with the [Murf AI](https://murf.ai/) [text-to-speech software](https://murf.ai/text-to-speech), enabling developers and creators to convert text into lifelike speech effortlessly. With over 130 natural-sounding voices across 21 languages and 20+ speaking styles, Murf provides unparalleled speech customization for a wide range of applications. The SDK is designed for both synchronous and asynchronous workflows, featuring robust error handling, advanced configuration options, and support for real-time applications.\n\n---\n\n## Installation\n\nCheck out the [HTTP API documentation](https://murf.ai/api/docs/introduction/quickstart).\n\nInstall the SDK using pip:\n\n```bash\npip install murf\n```\n\n---\n\n## Getting Started\n\nHere's a quick example to get you started with the Murf SDK:\n\n```python\nfrom murf import Murf\n\nclient = Murf(\n    api_key=\"YOUR_API_KEY\",\n)\nclient.text_to_speech.generate(\n    format=\"MP3\",\n    sample_rate=44100.0,\n    text=\"Hello, world!\",\n    voice_id=\"en-US-natalie\",\n)\n```\n\nFor more detailed information, refer to the [official documentation](https://murf.ai/api/docs/introduction/quickstart).\n\n---\n\n## Features\n\n- **Text-to-Speech Conversion:** Transform text into natural-sounding speech.\n- **Multilingual Support:** Access voices in over 21 languages, including English, French, German, Spanish, Italian, Hindi, Portuguese, Dutch, Korean, Chinese (Mandarin), Bengali, Tamil, Polish, Japanese, Turkish, Indonesian, Croatian, Greek, Romanian, Slovak, and Bulgarian.\n\n![Murf AI Languages](https://murf.ai/public-assets/home/Murf_Languages_21.jpg)\n\n- **Multiple Voice Styles:** Choose from 20+ speaking styles to suit your application's needs.\n- **Advanced Voice Customization:** Adjust parameters like pitch, speed, pauses, and pronunciation for optimal output. Fine-grained controls let you tailor the voice output to match your specific requirements.\n- **Multiple Audio Formats:** Generate audio in various formats (e.g., MP3, WAV) with configurable sample rates for optimal quality.\n- **Real-Time Processing:** Benefit from asynchronous API calls that support non-blocking, real-time audio generation and streaming scenarios.\n\n\n---\n\n## Async Client\n\nThe SDK also exports an `async` client so that you can make non-blocking calls to our API.\n\n```python\nimport asyncio\n\nfrom murf import AsyncMurf\n\nclient = AsyncMurf(\n    api_key=\"YOUR_API_KEY\",\n)\n\n\nasync def main() -> None:\n    await client.text_to_speech.generate(\n        format=\"MP3\",\n        sample_rate=44100.0,\n        text=\"Hello, world!\",\n        voice_id=\"en-US-natalie\",\n    )\n\n\nasyncio.run(main())\n```\n\n---\n\n## Exception Handling\n\nWhen the API returns a non-success status code (4xx or 5xx response), a subclass of the following error\nwill be thrown.\n\n```python\nfrom murf.core.api_error import ApiError\n\ntry:\n    client.text_to_speech.generate(...)\nexcept ApiError as e:\n    print(e.status_code)\n    print(e.body)\n```\n\n---\n\n## Advanced\n\n### Retries\n\nThe SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long\nas the request is deemed retriable and the number of retry attempts has not grown larger than the configured\nretry limit (default: 2).\n\nA request is deemed retriable when any of the following HTTP status codes is returned:\n\n- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)\n- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)\n- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)\n\nUse the `max_retries` request option to configure this behavior.\n\n```python\nclient.text_to_speech.generate(..., request_options={\n    \"max_retries\": 1\n})\n```\n\n### Timeouts\n\nThe SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.\n\n```python\n\nfrom murf import Murf\n\nclient = Murf(\n    ...,\n    timeout=20.0,\n)\n\n\n# Override timeout for a specific method\nclient.text_to_speech.generate(..., request_options={\n    \"timeout_in_seconds\": 1\n})\n```\n\n### Custom Client\n\nYou can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies\nand transports.\n```python\nimport httpx\nfrom murf import Murf\n\nclient = Murf(\n    ...,\n    httpx_client=httpx.Client(\n        proxies=\"http://my.test.proxy.example.com\",\n        transport=httpx.HTTPTransport(local_address=\"0.0.0.0\"),\n    ),\n)\n```\n\n---\n\n## Contributing\n\nWe welcome contributions to enhance the Murf Python SDK. Please note that this library is generated programmatically, so direct modifications may be overwritten. We suggest opening an issue first to discuss your ideas or improvements. Contributions to the documentation are especially appreciated! For any support queries email to support@murf.ai \n\n---\n\n## License\n\nMurf Python SDK is released under the [MIT License](LICENSE).\n\n---\n",
    "bugtrack_url": null,
    "license": null,
    "summary": null,
    "version": "2.0.1",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "882c7dbe3bf21c6616bf477d3fe0cd06cad081ce49a1054540e017bd270eee85",
                "md5": "2cb1b6bf8c6b2fe7e196574f459b1049",
                "sha256": "d22c41afa6c74a0d3ea78b6822da0c4df88aa3c7c42524e02eddb1e97dea8fe1"
            },
            "downloads": -1,
            "filename": "murf-2.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2cb1b6bf8c6b2fe7e196574f459b1049",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 77274,
            "upload_time": "2025-07-24T06:43:11",
            "upload_time_iso_8601": "2025-07-24T06:43:11.566130Z",
            "url": "https://files.pythonhosted.org/packages/88/2c/7dbe3bf21c6616bf477d3fe0cd06cad081ce49a1054540e017bd270eee85/murf-2.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "20cd2b8a896cfd25a6a149fa48e349aba01f8dfb23738f48b56bd351c3db436b",
                "md5": "98c58f5ba3a615fabb6a0fdb05c10a87",
                "sha256": "0bd12042afe132ff3034dd2bed50dc7de825083276793dfc044f6300b968513d"
            },
            "downloads": -1,
            "filename": "murf-2.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "98c58f5ba3a615fabb6a0fdb05c10a87",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 40643,
            "upload_time": "2025-07-24T06:43:12",
            "upload_time_iso_8601": "2025-07-24T06:43:12.740271Z",
            "url": "https://files.pythonhosted.org/packages/20/cd/2b8a896cfd25a6a149fa48e349aba01f8dfb23738f48b56bd351c3db436b/murf-2.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-24 06:43:12",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "murf"
}
        
Elapsed time: 2.02853s