Skip to main content

Lightweight image gallery server - no database, no files left behind

Project description

Lenslet

A lightweight image gallery server for fast visual triage. Point it at a directory or a Parquet table and browse instantly in your browser. Lenslet keeps the source images read-only and stores workspace state separately.

Introduction

image image

Lenslet is a self-contained image gallery server designed for simplicity and speed. It indexes directories on-the-fly, generates thumbnails on demand, and serves everything through a clean web interface. Perfect for quickly browsing local image collections or large Parquet-backed datasets without modifying the source images.

Features

  • Workspace-aware: Persists UI state (Smart Folders/views) and optional thumbnail cache under .lenslet/ (or <parquet>.lenslet.json)
  • Read-only sources: Never writes into your image directories or S3 buckets
  • Local + S3 + HTTP: Mix local files, s3:// URIs, and URLs with smart source parsing
  • Metrics & filtering: Sort/filter by numeric metrics from Parquet (histograms + range brushing)
  • Labels & export: Tag, rate, and annotate items, then export metadata as JSON or CSV
  • Single command: Just point to a directory or Parquet file and go

Installation

pip install lenslet

Usage

Command Line Interface

lenslet /path/to/images

Then open the URL printed in the terminal (default http://127.0.0.1:7070, or the next available port).

Options:

lenslet <directory|table.parquet> [options]

Options:
  -p, --port PORT              Port to listen on (default: 7070; auto-increment if in use)
  -H, --host HOST              Host to bind to (default: 127.0.0.1)
  --thumb-size SIZE            Thumbnail short edge in pixels (default: 256)
  --thumb-quality QUALITY      Thumbnail WebP quality 1-100 (default: 70)
  --source-column NAME         Column to load image paths from in table mode
  --base-dir PATH              Base directory for resolving relative paths in table mode
  --cache-wh / --no-cache-wh   Cache width/height back into parquet (default: on)
  --skip-indexing / --no-skip-indexing
                               Skip probing image dimensions during table load (default: on)
  --thumb-cache / --no-thumb-cache
                               Cache thumbnails on disk when a workspace is available (default: on)
  --no-write                   Disable workspace writes (.lenslet/) for one-off sessions
  --reload                     Enable auto-reload for development
  --share                      Create a public share URL via cloudflared
  --verbose                    Show detailed server logs
  -v, --version                Show version and exit

Examples:

# Serve images from your Pictures folder
lenslet ~/Pictures

# Use a custom port
lenslet ~/Photos --port 8080

# Make accessible on local network
lenslet ~/Images --host 0.0.0.0 --port 7070

# Create a public share URL (prints a trycloudflare.com link)
lenslet ~/Images --share

# Start from a Parquet workspace (paths can be local, s3://, or https://)
lenslet /data/items.parquet --source-column image_path --base-dir /data

# Start from a folder containing items.parquet
lenslet /data/dataset --source-column image_path

Programmatic API (Python/Jupyter)

Launch lenslet directly from Python code or notebooks:

import lenslet

datasets = {
    "my_images": ["/path/to/img1.jpg", "/path/to/img2.jpg"],
    "more_images": [
        "s3://bucket/img3.jpg",           # S3 URIs
        "https://example.com/img4.jpg",   # HTTP/HTTPS URLs
    ],
}

# Launch in non-blocking mode (returns immediately)
lenslet.launch(datasets, blocking=False, port=7070)

Key Features:

  • 🚀 Jupyter-friendly: Non-blocking mode for notebooks
  • ☁️ S3 support: Automatically handles S3 URIs via presigned URLs
  • 📁 Multiple datasets: Organize images into named collections
  • 🔗 Mixed sources: Combine local files, S3 URIs, and HTTP URLs

See Programmatic API Documentation for details and examples.

Notes

  • Workspace files: .lenslet/views.json stores Smart Folders; optional thumbnail cache lives under .lenslet/thumbs/
    • For Parquet, views live at <table>.lenslet.json and thumbs at <table>.cache/thumbs/
  • Read-only sources: The server never writes into your image directories or S3 buckets
  • Labels: Tags/notes/ratings are editable in the UI (session-only) and exportable as JSON/CSV
  • No-write mode: Pass --no-write to keep the session fully ephemeral (no .lenslet/ or .lenslet.json)
  • Formats: Supports JPEG, PNG, and WebP
  • Hidden files: Files/folders starting with . are ignored

License

MIT License

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

lenslet-0.2.7.tar.gz (494.8 kB view details)

Uploaded Source

Built Distribution

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

lenslet-0.2.7-py3-none-any.whl (156.3 kB view details)

Uploaded Python 3

File details

Details for the file lenslet-0.2.7.tar.gz.

File metadata

  • Download URL: lenslet-0.2.7.tar.gz
  • Upload date:
  • Size: 494.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.16

File hashes

Hashes for lenslet-0.2.7.tar.gz
Algorithm Hash digest
SHA256 ca11b8185a3453384b0279eb83cc3153e0dbac34514da9f10b24ddcc394ff9b9
MD5 8032e965cb9db00dc8eb6702cd7d9f15
BLAKE2b-256 550aa911df117c79ecb23276826ffda78b34722532269d7b03a6fab9c5e564f7

See more details on using hashes here.

File details

Details for the file lenslet-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: lenslet-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 156.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.16

File hashes

Hashes for lenslet-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 613eb6e775f2918170f5f04c2482139598b63319b1789423dde68a2f5e0c9a7e
MD5 328d8489ae1d051c20e6c5b0ba951cd8
BLAKE2b-256 fb13afe7ea1ff34d3de69fd9367c076e8b5bfc6abaf3fdaedfa2fc5d6e91cdb5

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