---
title: "vuer.workspace"
section: "Python API"
order: 34
description: "Python API reference for vuer.workspace"
---

# 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 bytes
- ``png(image)`` - Encode as PNG bytes (supports alpha)
- ``b64jpg(image, quality=90)`` - Encode as base64 JPEG data URI
- ``b64png(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 experiments
- ``McapWorkspace`` - MCAP recordings
- ``S3Workspace`` - S3 buckets

## Public imports

These symbols are available from this module. Their definitions are documented in the linked modules.

- [`Blob`](/python-api/workspace/workspace#blob) — `vuer.workspace.workspace.Blob`
- [`MimeTypes`](/python-api/workspace/workspace#mimetypes) — `vuer.workspace.workspace.MimeTypes`
- [`Workspace`](/python-api/workspace/workspace#workspace) — `vuer.workspace.workspace.Workspace`
- [`guess_content_type`](/python-api/workspace/workspace#guess_content_type) — `vuer.workspace.workspace.guess_content_type`
- [`sanitize_path`](/python-api/workspace/workspace#sanitize_path) — `vuer.workspace.workspace.sanitize_path`
- [`workspace_from_config`](/python-api/workspace/workspace#workspace_from_config) — `vuer.workspace.workspace.workspace_from_config`
- [`jpg`](/python-api/workspace/encoders#jpg) — `vuer.workspace.encoders.jpg`
- [`png`](/python-api/workspace/encoders#png) — `vuer.workspace.encoders.png`
- [`b64jpg`](/python-api/workspace/encoders#b64jpg) — `vuer.workspace.encoders.b64jpg`
- [`b64png`](/python-api/workspace/encoders#b64png) — `vuer.workspace.encoders.b64png`
- [`decode_b64png`](/python-api/workspace/encoders#decode_b64png) — `vuer.workspace.encoders.decode_b64png`
