Skip to main content

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

Project description

Lenslet

A lightweight image gallery server that runs entirely in-memory. Point it at a directory of images and browse them in your browser. No database, no metadata files left behind.

Introduction

image

Lenslet is a self-contained image gallery server designed for simplicity and speed. It indexes directories on-the-fly, generates thumbnails in memory, and serves everything through a clean web interface. Perfect for quickly browsing local image collections without modifying the source directory.

Features

  • Clean operation: No files written to your image directories
  • In-memory indexing: Fast directory scanning and caching
  • On-demand thumbnails: Generated and cached in RAM
  • Full web UI: Browse, search, and view images in your browser
  • Metadata support: Add tags, notes, and ratings (session-only)
  • Single command: Just point to a directory and go

Installation

pip install lenslet

Usage

Command Line Interface

lenslet /path/to/images

Then open http://127.0.0.1:7070 in your browser.

Options:

lenslet <directory> [options]

Options:
  -p, --port PORT              Port to listen on (default: 7070)
  -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)
  --reload                     Enable auto-reload for development
  --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

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 and S3 images

See Programmatic API Documentation for details and examples.

Notes

  • All indexes, thumbnails, and metadata are kept in memory
  • Metadata changes (tags, ratings, notes) are lost when the server stops
  • Supports JPEG, PNG, and WebP formats
  • Hidden files and 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.2.tar.gz (471.4 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.2-py3-none-any.whl (130.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lenslet-0.2.2.tar.gz
  • Upload date:
  • Size: 471.4 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.2.tar.gz
Algorithm Hash digest
SHA256 d2807e3f772e6531983ef640b0b4b2cdda25c3dde15664d7d1f71af22a6b4e58
MD5 e6b9e04cb42bb89dc77db2a4489e3758
BLAKE2b-256 47f89d8082441a360a8b28b47dd97981e3bec9ad07cdd97feaad66407f99d2dc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lenslet-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 130.4 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b4642eed9de812f378c99517aa574cd8538f018df20d23b8aea1217dea9f72e2
MD5 52216ca9d5bcb92136fa5ab28da92871
BLAKE2b-256 9f2df7f6f32e98e1f1cae24f7987f9048de75e79893c09e0b1479d16475d5b5d

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