Skip to main content

VLOEX SDK - Video generation as a computing primitive

Project description

VLOEX Python SDK

Video generation as a computing primitive.

Installation

pip install vloex

Usage

from vloex import Vloex

vloex = Vloex('vs_live_...')

# Generate a video
video = vloex.videos.create(
    script='Version 2.0 is now live with dark mode and AI chat!'
)

print(video['id'])      # → "job_abc123"
print(video['status'])  # → "processing"

# Check status
updated = vloex.videos.retrieve(video['id'])
print(updated['status'])  # → "completed"
print(updated['url'])     # → "https://..."

API

vloex.videos.create(script, **options)

Create a video from text.

Arguments:

  • script (str, required) - The text script for your video
  • **options (optional):
    • avatar - Avatar to use (default: 'lily')
    • voice - Voice tone (default: 'excited')
    • background - Background setting (default: 'modern_office')
    • webhook_url - URL to call when complete

Returns: dict with id and status

vloex.videos.retrieve(id)

Get video status and URL.

Arguments:

  • id (str, required) - Video job ID

Returns: dict with current status

Examples

Basic video generation

from vloex import Vloex

vloex = Vloex('vs_live_...')

video = vloex.videos.create(
    script='We just shipped a major update!'
)

With options

video = vloex.videos.create(
    script='Check out our new features',
    avatar='lily',
    voice='professional',
    background='modern_office'
)

Wait for completion

import time
from vloex import Vloex

vloex = Vloex('vs_live_...')

video = vloex.videos.create(script='Release notes for v2.0')

# Poll until complete
while True:
    status = vloex.videos.retrieve(video['id'])

    if status['status'] == 'completed':
        print(f"Video ready: {status['url']}")
        break

    if status['status'] == 'failed':
        print(f"Failed: {status['error']}")
        break

    time.sleep(5)  # Wait 5s

Using webhooks

video = vloex.videos.create(
    script='Product update',
    webhook_url='https://yourapp.com/webhooks/vloex'
)

# VLOEX will POST to your webhook when done

Error Handling

from vloex import Vloex, VloexError

vloex = Vloex('vs_live_...')

try:
    video = vloex.videos.create(script='Hello world')
except VloexError as e:
    if e.status_code == 401:
        print('Invalid API key')
    elif e.status_code == 429:
        print('Rate limit exceeded')
    else:
        print(f'Error: {e.message}')

Type Hints

Full type hint support:

from vloex import Vloex
from typing import Dict

vloex: Vloex = Vloex('vs_live_...')

video: Dict[str, str] = vloex.videos.create(
    script='New release',
    avatar='lily'
)

Documentation

Full API documentation: https://docs.vloex.com

Support

License

MIT

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

vloex-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

vloex-0.1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vloex-0.1.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.9

File hashes

Hashes for vloex-0.1.0.tar.gz
Algorithm Hash digest
SHA256 613042a0e980f248ecaa50a95a347fb7f63a4f0c3a0761c97b43190ac7ad3269
MD5 17f3fadf1308637dab1c1db43c2868e5
BLAKE2b-256 51a1396527ab5f2e90b952fc8eb0c980b2c6b22d3cd35afd5f408c51e07ad748

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vloex-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.9

File hashes

Hashes for vloex-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 595fd924c133047e57fd88cc3ac08f501aa82dacf32c6114cc58d65bc06949a0
MD5 b54289c4db0cc890492e8e87f756dd09
BLAKE2b-256 5a46902b5086a226a435bbd7dd192dd386659ecd99fd04c43468c2745a9c246b

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