vuer.workspace
Workspace backends for Vuer static file serving.
This package provides different workspace implementations for serving static files from various storage backends.
Available workspaces:
Workspace- Local filesystem (default)Blob- In-memory data with explicit content-type
Image encoders (for serving in-memory images)::
from vuer.workspace import jpg, png, b64jpg, b64png
jpg(image, quality=90)- Encode as JPEG bytespng(image)- Encode as PNG bytes (supports alpha)b64jpg(image, quality=90)- Encode as base64 JPEG data URIb64png(image)- Encode as base64 PNG data URI
Example::
from vuer import Vuer from vuer.workspace import jpg, png
vuer = Vuer() vuer.workspace.link(lambda: jpg(camera.frame), "/live/frame.jpg") vuer.workspace.link(lambda: png(depth_map), "/depth.png")
Custom MIME types::
from vuer.workspace import MIME_TYPES
MIME_TYPES[".npy"] = "application/x-npy" MIME_TYPES.guess("data.npy") # "application/x-npy"
Future workspaces:
DashWorkspace- ML-Dash experimentsMcapWorkspace- MCAP recordingsS3Workspace- S3 buckets
Public imports
These symbols are available from this module. Their definitions are documented in the linked modules.
Blob—vuer.workspace.workspace.BlobMimeTypes—vuer.workspace.workspace.MimeTypesWorkspace—vuer.workspace.workspace.Workspaceguess_content_type—vuer.workspace.workspace.guess_content_typesanitize_path—vuer.workspace.workspace.sanitize_pathworkspace_from_config—vuer.workspace.workspace.workspace_from_configjpg—vuer.workspace.encoders.jpgpng—vuer.workspace.encoders.pngb64jpg—vuer.workspace.encoders.b64jpgb64png—vuer.workspace.encoders.b64pngdecode_b64png—vuer.workspace.encoders.decode_b64png