Skip to main content

A Python client for the Video Jungle API

Project description

Video Jungle API Client

This is a Python client for the Video Jungle API.

Video Jungle is a generative video creator. It allows you to generate custom videos via dynamic variables.

Let's say you want to generate daily astrology readings according to your user's astrological sign, lucky number, and lucky color.

Video Jungle allows you to pass in a value for each, and generate a unique video for that specific user.

See below for an example of how to build a generative video workflow using the API.

Installation

You can install the Video Jungle API client using pip:

pip install videojungle

Usage

Here's a simple example of how to use the Video Jungle API client for the Horoscope example:

from videojungle import ApiClient
import os

# Assumes you've set your API key as an environment variable
VJ_API_KEY = os.environ['VJ_API_KEY']

# Initialize API client
vj = ApiClient(token=VJ_API_KEY)

# Define your video generation task, along with variables to pass on generation
prompt = vj.prompts.generate(task="a horoscope reader who wants to leave the person excited about their future",
                            parameters=["zodiac sign", "lucky number", "date"])

# Alternatively, create your own prompt:
# prompt = vj.prompts.create(prompt="generate a horoscope for ${ZODIAC SIGN}, with lucky number ${LUCKY NUMBER} on ${DATE}",
#                            parameters=["ZODIAC SIGN", "LUCKY NUMBER", "DATE"], name="Horoscope Reader", task="a horoscope generator",
#                            persona="A psychic squid who sees into the future")

# Print out the generated prompt
print(prompt.value)

# Optionally, list out  generation methods available in your account
scripts = vj.scripts.list_options()
for script in scripts:
    print(f"{script.key}: {script.description}")

# Create a project to hold generated files, using our prompt we've generated
# and prompt-to-video as the asset genneration method
project = vj.projects.create(name="First Project", description="My first project", 
                             prompt_id=prompt.id, generation_method="prompt-to-video")

script_id = project.scripts[0].id
# Print out parameters required for generation
print(project.prompts[0]['parameters'])

# Generate a video from our created prompt with dynamic variables
video = vj.projects.generate(script_id=script_id, 
                             project_id=project.id,
                             parameters={"zodiac sign": "Aries",
                                         "lucky number": "7", # parameters are always strings
                                         "date": "2025-05-25"})
print(video)

# Get the video file ID from the generated video
asset_id = video["asset_id"]

# Save the video file to disk, automatically waits for generation
print(f"Generating video with asset id: {asset_id}")
video_file = vj.assets.download(asset_id, "generated_horoscope.mp4")
print(f"Video generated and saved to: {video_file}")

This example lives in the examples/ folder.

License

This project is licensed under the MIT License.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

videojungle-0.1.78.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

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

videojungle-0.1.78-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file videojungle-0.1.78.tar.gz.

File metadata

  • Download URL: videojungle-0.1.78.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.3

File hashes

Hashes for videojungle-0.1.78.tar.gz
Algorithm Hash digest
SHA256 6176b103b1c4be6e33bc32dc2f5e333cc117168fa9e81f0ebb39938d74dc5b29
MD5 28f218dab6510c0f1f3ff59fc161f9ee
BLAKE2b-256 da5b4a5221e0b16c457c38a82b8979ec89088866a5c86a889655860aa92e1e84

See more details on using hashes here.

File details

Details for the file videojungle-0.1.78-py3-none-any.whl.

File metadata

File hashes

Hashes for videojungle-0.1.78-py3-none-any.whl
Algorithm Hash digest
SHA256 7d15e88bda28dfee0d6de152d082c148fd928efaf75f4656284558eafb1e00b0
MD5 b8aa787291b9d22db91b57c1cbbfe9fa
BLAKE2b-256 3443be3aa803ae9ae54dcfb80353a7d4f81ff2404bfe73499e652115b0cd2a28

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