Skip to main content

WideCast.ai Python SDK — generate videos from scripts, ideas, audio, or existing videos.

Project description

widecast (Python)

Official Python SDK for WideCast.ai — generate videos from a script, idea, audio, or existing video via a clean REST API.

pip install widecast

60-second example

from widecast import Widecast

client = Widecast(api_key="wc_live_REPLACE_ME")

video = client.create_video(
    script={
        "language": "vi",
        "aspectRatio": "9_16",
        "segments": [
            {"id": 1, "type": "HOOK",
             "text": "Bạn nên cho con lấy bằng lái xe ngay khi 16 tuổi."},
        ],
    },
).wait()                     # blocks until completed/failed

print(video["status"], video["video_url"])

Setup

from widecast import Widecast

# API key from env (WIDECAST_API_KEY) or explicit
client = Widecast(
    api_key="wc_live_...",
    base_url="https://widecast.ai/app/dashboard2",   # default for v0.1.0 pilot
    timeout=60.0,
    max_retries=3,
)

Methods

client.create_video(script, *, wait_for_render=False, callback_url=None,
                    metadata=None, idempotency_key=None) -> Video
client.get_video(video_id) -> Video

video.wait(timeout=600.0, poll_interval=3.0) -> Video
video.id            # str
video.status        # 'processing' | 'rendering' | 'completed' | 'failed'
video.video_url     # str | None
video.is_terminal   # bool
video["any_field"]  # dict access for everything else

Error handling

from widecast import (
    WidecastError, InvalidRequestError, NotFoundError,
    RateLimitError, APIError,
)

try:
    video = client.create_video(script=my_script)
except InvalidRequestError as e:
    print(f"Bad input: {e} (param={e.param}, request_id={e.request_id})")
except RateLimitError as e:
    print("Slow down, retry after a moment.")
except APIError as e:
    print(f"Server-side issue: {e.code} — share request_id={e.request_id} in support tickets.")

Every error carries e.code, e.message, e.request_id, e.doc_url, e.status.

License

Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

widecast-0.1.0.tar.gz (29.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

widecast-0.1.0-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file widecast-0.1.0.tar.gz.

File metadata

  • Download URL: widecast-0.1.0.tar.gz
  • Upload date:
  • Size: 29.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for widecast-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e179a4536f8373e8049222138a21e40fc839f0551c24f38b6b9419cb01becb03
MD5 a2d5da472db6e707199985234bcd09e1
BLAKE2b-256 61bd2f1399b01d800d7536fdc94ce81df78f5cbe9d408bc9224dabd79d5cb786

See more details on using hashes here.

File details

Details for the file widecast-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: widecast-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for widecast-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 166a5a772a47d3c7bbda60ee33b5714976821377274db4a5e77a7fbea8c60dc7
MD5 5fb3dff986942f5c127f74fd276eacb0
BLAKE2b-256 f2c46061eb9aba0fefb0afa5188536a495faa08d492510297e8e4f1b2005ef63

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page