Skip to main content

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

  1. Obtain your D-ID API Key from D-ID Studio.

  2. 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.

Metadata

Release files for did-api 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for did-api 0.0.6
File Size Uploaded Provenance Actions
did-api-0.0.6.tar.gz 3.9 kB Without provenance Details for did-api-0.0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for did-api 0.0.6
File Interpreter ABI Platform Actions
did_api-0.0.6-py3-none-any.whl Python 3 none any Details for did_api-0.0.6-py3-none-any.whl

Total release size: 7.9 kB

Release files / did-api-0.0.6.tar.gz

Download URL did-api-0.0.6.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d5c40be1b9485a5eb759ecdf02c00ebf28445c010e46fbac57b98eb31089f126
BLAKE2b-256 checksum
How to use checksums
ee695d03ba436302a4b5f54a40743d665e6de642e6aac87b1b04b18b5f4d0239
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release files / did_api-0.0.6-py3-none-any.whl

Download URL did_api-0.0.6-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b17f71ce2d075e519393a988d74f0a9ff9230d0aa2b0a5c5307ed2a60a0da3af
BLAKE2b-256 checksum
How to use checksums
be758d408bd842e51875a738ddb541d96b8184b8b9cabae1b8da292a5c532fd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Security for did-api 0.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page