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.2.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.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vloex-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 e0081542373dd72daaece7aa8af329c431c05c6021fe4bf87581f07b1cadb2be
MD5 ba61b5fe2d03c02c857bd35b2041caa0
BLAKE2b-256 83cd5a0961fff9afc649537441346a2b1c2de0cf9cb3f28fde10c69275f780d8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vloex-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8422769417e27acbd93c834ef99abc6e39e0c8f796342b32638f6a22410d42ca
MD5 26455add8bb5267fadf04f29457ab939
BLAKE2b-256 57a7aec6db62248c1990b2ac5d838153e755ced04f573c4569d76fde10e46670

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