D
DreamLake

Examples

Bulk Upload

Upload a folder of videos using Prefix context.

import dreamlake as dl
from pathlib import Path
 
# Local folder containing video files
data_dir = Path("./recordings/2026-04-24/")
 
# Prefix scopes all uploads to the sameproject and path prefix.
# File type is auto-detected from extension (.mp4 → video, .wav → audio, etc.)
with dl.Prefix(space="robotics@alice", prefix="/2026/04/session-001"):
    for video_file in sorted(data_dir.glob("*.mp4")):
        # Each file is uploaded via chunked multipart with progress bar.
        # Path is relative to the prefix: /2026/04/session-001/camera/{name}
        dl.upload(
            str(video_file),
            path=f"camera/{video_file.stem}",
        )
        print(f"Uploaded {video_file.name}")