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.1.tar.gz (3.9 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.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vloex-0.1.1.tar.gz
  • Upload date:
  • Size: 3.9 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.1.tar.gz
Algorithm Hash digest
SHA256 9aa5b77a7ef5fa35168572567c4de68a3651a8b9898f9d8670ae45d8b547fda3
MD5 7f9ee7a51575edfa788ac3f7a1ee83b9
BLAKE2b-256 db2b868fdd28ee14ed1a56c8eabbfe03301893c6fb48fd0d785f0039027f8115

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vloex-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0afd44bafa83779ee9f3ca2f052cf0773b16b2cf0633ad4d1bf62f050a1ae562
MD5 a7063b3aff13ea46281588eef150ebcd
BLAKE2b-256 bc475383853a20380f943f9824bf105c8b1e6704773e42eda155557da85bfd9b

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