D-ID API Python Library
Project description
D-ID Python API Wrapper
This Python library allows you to interact with the D-ID API easily. You can use it to create text-to-video clips and retrieve clip information, among other things.
Installation
You can install the did-api module using pip:
pip install did-api
Getting Started
-
Obtain your D-ID API Key from D-ID Studio.
-
Import the library and initialize it with your API Key:
from D_ID import Clips
api_key = "your_api_key_here"
d_id = Clips(api_key)
Creating a Text-to-Video Clip
To create a text-to-video clip, use the create_text_to_video_clip method:
text = "Your text here"
result = d_id.create_text_to_video_clip(text)
This function takes the following optional parameters:
presenter_id(default: 'amy-jcwCkr1grs')driver_id(default: 'uM00QMwJ9x')voice_provider_name(default: 'microsoft')voice_id(default: 'en-US-JennyNeural')WEBHOOK_URL(default: None)background_color(default: '#ffffff')extra_data(default: {})
The result variable will contain the API response, including information about the created clip.
Retrieving Clip Information
You can retrieve clip information using the get_clip_by_id method:
clip_id = "your_clip_id_here"
clip_info = d_id.get_clip_by_id(clip_id)
The clip_info variable will contain the API response, providing details about the specified clip.
Examples
Here are some examples of how to use this library:
# Create a text-to-video clip
text = "Hello, D-ID!"
result = d_id.create_text_to_video_clip(text)
"result => {'id': 'clip_id', 'created_at': '2023-09-06T21:45:50.298Z', 'object': 'clip', 'status': 'created'}"
# Get information about a specific clip
clip_id = "your_clip_id_here"
clip_info = d_id.get_clip_by_id(clip_id)
License
This library is provided under the MIT License.
For more information about the D-ID API, please refer to the official documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file did-api-0.0.6.tar.gz.
File metadata
- Download URL: did-api-0.0.6.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5c40be1b9485a5eb759ecdf02c00ebf28445c010e46fbac57b98eb31089f126
|
|
| MD5 |
9fbb930025afc219b72108f188d79715
|
|
| BLAKE2b-256 |
ee695d03ba436302a4b5f54a40743d665e6de642e6aac87b1b04b18b5f4d0239
|
File details
Details for the file did_api-0.0.6-py3-none-any.whl.
File metadata
- Download URL: did_api-0.0.6-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b17f71ce2d075e519393a988d74f0a9ff9230d0aa2b0a5c5307ed2a60a0da3af
|
|
| MD5 |
c645e803f0d8877f1fa43a043f6d439c
|
|
| BLAKE2b-256 |
be758d408bd842e51875a738ddb541d96b8184b8b9cabae1b8da292a5c532fd7
|