Name | audiomatic JSON |
Version |
0.1.3
JSON |
| download |
home_page | None |
Summary | The official Python client for the Audiomatic API |
upload_time | 2024-11-12 22:03:54 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT License Copyright (c) 2024 Audiomatic Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
audiomatic
translation
video
api
client
|
VCS |
|
bugtrack_url |
|
requirements |
filetype
imageio-ffmpeg
requests
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# audiomatic-python
The official Python library for the Audiomatic API
## Installation
```bash
pip install -U audiomatic
```
## Quick Start
```python
from audiomatic import Audiomatic
# Initialize the client
client = Audiomatic(api_key="your_api_key")
# Translate a local video file
project_id = client.translate(
source="path/to/video.mp4",
target_lang="es",
project_name="Spanish Translation"
)
# Check translation status
status, result_url = client.get_status(project_id)
```
## Usage Examples
### Translating a YouTube Video
```python
# Translate a YouTube video to French
project_id = client.translate(
source="https://youtube.com/watch?v=example",
target_lang="fr",
project_name="French Translation"
)
```
### Advanced Options
```python
# Translate with custom options
project_id = client.translate(
source="path/to/video.mp4",
target_lang="de",
project_name="German Translation",
opt_params={
"accent_level": 0.75,
"num_speakers": 2,
"remove_background_audio": True,
"start_time": 30000, # Start at 30 seconds
"end_time": 120000, # End at 2 minutes
"captions_path": "path/to/captions.vtt"
}
)
```
## API Reference
### Client Initialization
#### `Audiomatic(api_key: str)`
Initialize the Audiomatic client.
**Parameters:**
- `api_key` (str): Your Audiomatic API key
### Methods
#### `translate(source: str, target_lang: str, project_name: Optional[str] = None, opt_params: Optional[Dict] = None) -> str`
Translate a video file or YouTube URL.
**Parameters:**
- `source` (str): Path to local video file or YouTube URL
- `target_lang` (str): Target language code (e.g., "es", "fr", "de")
- `project_name` (str, optional): Custom project name (defaults to filename)
- `opt_params` (Dict, optional): Additional parameters:
- `accent_level` (float): Voice accent level (0, 0.25, 0.5, 0.75, or 1)
- `num_speakers` (int): Number of speakers in video (defaults to auto-detect)
- `remove_background_audio` (bool): Whether to remove background audio
- `start_time` (int): Start time of video clip in milliseconds
- `end_time` (int): End time of video clip in milliseconds
- `captions_path` (str): Path to custom captions file
**Returns:** Project ID string
#### `get_status(project_id: str) -> Tuple[str, Optional[str]]`
Check the status of a translation project.
**Parameters:**
- `project_id` (str): Project ID returned from translate()
**Returns:** Tuple of (status, result_url)
## Limitations
- Maximum file size: 500MB
- Maximum video duration: 15 minutes
- Supported languages: ['en', 'fr', 'es', 'de', 'pt', 'zh', 'ja', 'hi', 'it', 'ko', 'nl', 'pl', 'ru', 'sv', 'tr']
- Supported accent levels:[0, 0.25, 0.5, 0.75, 1]
## Error Handling
The client includes a custom `AudiomaticError` exception class that provides detailed error information:
```python
try:
project_id = client.translate(...)
except AudiomaticError as e:
print(f"Error: {e}")
print(f"Status Code: {e.status_code}")
print(f"Error Code: {e.error_code}")
```
Raw data
{
"_id": null,
"home_page": null,
"name": "audiomatic",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "audiomatic, translation, video, api, client",
"author": null,
"author_email": "Audiomatic <support@audiomatic.app>",
"download_url": "https://files.pythonhosted.org/packages/19/a5/01bc4a386034bfbf292f4e173baff648a954ce55ff198628279887daa5d9/audiomatic-0.1.3.tar.gz",
"platform": null,
"description": "# audiomatic-python\n\nThe official Python library for the Audiomatic API\n\n## Installation\n\n```bash\npip install -U audiomatic\n```\n\n## Quick Start\n\n```python\nfrom audiomatic import Audiomatic\n\n# Initialize the client\nclient = Audiomatic(api_key=\"your_api_key\")\n\n# Translate a local video file\nproject_id = client.translate(\n source=\"path/to/video.mp4\",\n target_lang=\"es\",\n project_name=\"Spanish Translation\"\n)\n\n# Check translation status\nstatus, result_url = client.get_status(project_id)\n```\n\n## Usage Examples\n\n### Translating a YouTube Video\n\n```python\n# Translate a YouTube video to French\nproject_id = client.translate(\n source=\"https://youtube.com/watch?v=example\",\n target_lang=\"fr\",\n project_name=\"French Translation\"\n)\n```\n\n### Advanced Options\n\n```python\n# Translate with custom options\nproject_id = client.translate(\n source=\"path/to/video.mp4\",\n target_lang=\"de\",\n project_name=\"German Translation\",\n opt_params={\n \"accent_level\": 0.75,\n \"num_speakers\": 2,\n \"remove_background_audio\": True,\n \"start_time\": 30000, # Start at 30 seconds\n \"end_time\": 120000, # End at 2 minutes\n \"captions_path\": \"path/to/captions.vtt\"\n }\n)\n```\n\n## API Reference\n\n### Client Initialization\n\n#### `Audiomatic(api_key: str)`\n\nInitialize the Audiomatic client.\n\n**Parameters:**\n- `api_key` (str): Your Audiomatic API key\n\n### Methods\n\n#### `translate(source: str, target_lang: str, project_name: Optional[str] = None, opt_params: Optional[Dict] = None) -> str`\n\nTranslate a video file or YouTube URL.\n\n**Parameters:**\n- `source` (str): Path to local video file or YouTube URL\n- `target_lang` (str): Target language code (e.g., \"es\", \"fr\", \"de\")\n- `project_name` (str, optional): Custom project name (defaults to filename)\n- `opt_params` (Dict, optional): Additional parameters:\n - `accent_level` (float): Voice accent level (0, 0.25, 0.5, 0.75, or 1)\n - `num_speakers` (int): Number of speakers in video (defaults to auto-detect)\n - `remove_background_audio` (bool): Whether to remove background audio\n - `start_time` (int): Start time of video clip in milliseconds\n - `end_time` (int): End time of video clip in milliseconds\n - `captions_path` (str): Path to custom captions file\n\n**Returns:** Project ID string\n\n#### `get_status(project_id: str) -> Tuple[str, Optional[str]]`\n\nCheck the status of a translation project.\n\n**Parameters:**\n- `project_id` (str): Project ID returned from translate()\n\n**Returns:** Tuple of (status, result_url)\n\n## Limitations\n\n- Maximum file size: 500MB\n- Maximum video duration: 15 minutes\n- Supported languages: ['en', 'fr', 'es', 'de', 'pt', 'zh', 'ja', 'hi', 'it', 'ko', 'nl', 'pl', 'ru', 'sv', 'tr']\n- Supported accent levels:[0, 0.25, 0.5, 0.75, 1]\n\n## Error Handling\n\nThe client includes a custom `AudiomaticError` exception class that provides detailed error information:\n\n```python\ntry:\n project_id = client.translate(...)\nexcept AudiomaticError as e:\n print(f\"Error: {e}\")\n print(f\"Status Code: {e.status_code}\")\n print(f\"Error Code: {e.error_code}\")\n```\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Audiomatic Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "The official Python client for the Audiomatic API",
"version": "0.1.3",
"project_urls": {
"Homepage": "https://github.com/AudiomaticInc/audiomatic-python"
},
"split_keywords": [
"audiomatic",
" translation",
" video",
" api",
" client"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "0e055bd7c385c81be0f608d55aaf8cec690e176ac74d95a1292ba5a77b70a8d4",
"md5": "212a4b6cf716b0ba5ecb8d6182416e4d",
"sha256": "c9b7dfab4c4758ad113078c9de1e65394146066d9e2c0b64c5133d3d673e8e57"
},
"downloads": -1,
"filename": "audiomatic-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "212a4b6cf716b0ba5ecb8d6182416e4d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 7824,
"upload_time": "2024-11-12T22:03:51",
"upload_time_iso_8601": "2024-11-12T22:03:51.714717Z",
"url": "https://files.pythonhosted.org/packages/0e/05/5bd7c385c81be0f608d55aaf8cec690e176ac74d95a1292ba5a77b70a8d4/audiomatic-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "19a501bc4a386034bfbf292f4e173baff648a954ce55ff198628279887daa5d9",
"md5": "65cd18318769b397d1d075b2df54a881",
"sha256": "2a788c5d8e1dc3ae0324316853010ebd2fa09e6363764ad4c4ea35cf1f4dd5fa"
},
"downloads": -1,
"filename": "audiomatic-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "65cd18318769b397d1d075b2df54a881",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 8356,
"upload_time": "2024-11-12T22:03:54",
"upload_time_iso_8601": "2024-11-12T22:03:54.580945Z",
"url": "https://files.pythonhosted.org/packages/19/a5/01bc4a386034bfbf292f4e173baff648a954ce55ff198628279887daa5d9/audiomatic-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-12 22:03:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "AudiomaticInc",
"github_project": "audiomatic-python",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "filetype",
"specs": [
[
">=",
"1.2.0"
]
]
},
{
"name": "imageio-ffmpeg",
"specs": [
[
">=",
"0.5.1"
]
]
},
{
"name": "requests",
"specs": [
[
">=",
"2.32.3"
]
]
}
],
"lcname": "audiomatic"
}