Metadata-Version: 2.4
Name: fileviewer
Version: 2.0.1
Summary: Web-based file browser and viewer with support for images, video, audio, archives, tabular data, MIDI, hex, and more
Author: SkyTNT
License: Apache-2.0
Project-URL: Homepage, https://github.com/SkyTNT/fileviewer
Project-URL: Repository, https://github.com/SkyTNT/fileviewer
Project-URL: Issues, https://github.com/SkyTNT/fileviewer/issues
Keywords: file browser,file viewer,web ui,fastapi,image viewer,archive,dataframe,midi,hex viewer,file manager
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: Multimedia :: Graphics :: Viewers
Classifier: Topic :: System :: Filesystems
Classifier: Topic :: Utilities
Classifier: Environment :: Web Environment
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.111
Requires-Dist: uvicorn[standard]>=0.30
Requires-Dist: python-multipart>=0.0.9
Requires-Dist: pillow>=10.0
Requires-Dist: polars>=0.20
Requires-Dist: httpx>=0.27
Requires-Dist: async-lru>=2.0
Requires-Dist: tomli>=2.0; python_version < "3.11"
Requires-Dist: pyzipper>=0.3
Requires-Dist: psd_tools>=1.16.0
Requires-Dist: mutagen>=1.47.0
Provides-Extra: archive
Requires-Dist: py7zr; extra == "archive"
Dynamic: license-file

# fileviewer

A web-based file browser and viewer with a modern UI. Browse local directories, view files of many formats, and optionally manage files — all from your browser.

All written by Claude

## Features

### File browsing
- **Multi-root** — expose one or more directories with custom display names
- **Two view modes** — masonry waterfall grid and detailed list view
- **Directory tree** sidebar for quick navigation
- **Sorting** — by name, size, modified date, or type (ascending/descending); affects all views including the directory tree
- **Regex filter** — filter the current directory by filename pattern
- **Rubber-band selection** — drag to select multiple files; also Shift+click and Ctrl+click

### File viewers
- **Text** — syntax highlighting for 50+ languages via CodeMirror; inline editing with Ctrl+S save in write mode
- **Images** — thumbnail grid, full-resolution pan/zoom viewer, side-by-side comparison slider; **image editor** with layer management, 15 drawing/selection tools (Move, Brush, Eraser, Crop, Fill, Gradient, Text, Shape, Lasso, Magic Wand, Blur, Smudge, and more), adjustments (Brightness/Contrast, Curves, Levels, Hue/Saturation, Color Balance, Exposure/Vibrance, Shadows/Highlights), WebGL-accelerated filters (Gaussian Blur, Sharpen, Noise, Vignette, Pixelate, Sepia, Emboss, Chromatic Aberration, and more), undo/redo history, export with format/quality control; **PSD** files open with full layer support
- **Tabular data** — Parquet, CSV, JSON, JSONL powered by Polars with SQL `WHERE` filter, sorting, schema browser, image column preview, and inline image editing
- **Archives** — browse zip, tar, tar.gz, tar.bz2, tar.xz, 7z; random-access preview (zip/7z); extract here or to subfolder; create archives with compression level and password
- **MIDI** — playback with Web Audio synthesis, oscilloscope visualization, gain control, loop mode, and download
- **Video & audio** — HTTP range streaming
- **Markdown** — rendered preview with source toggle
- **Hex dump** — paged hex viewer for binary files

### File management (write mode)
- Create, rename, delete files and directories
- Upload via drag & drop onto the file area or file picker
- Copy/move with conflict resolution: overwrite, skip, or keep both
- Cut/copy/paste with clipboard indicator
- Compress files and directories into archives
- Copy images directly to the system clipboard
- Real-time progress for bulk operations via Server-Sent Events

### Keyboard shortcuts
| Shortcut | Action |
|----------|--------|
| Ctrl+A | Select all visible files |
| Ctrl+C | Copy selected files |
| Ctrl+X | Cut selected files |
| Ctrl+V | Paste clipboard |
| Delete | Delete selected files |
| F5 | Refresh |
| ←/→ | Navigate to prev/next image (in image viewer) |

### Other
- **Bookmarks** — save favorite directories for quick sidebar access (persisted in localStorage)
- **Authentication** — optional username/password login with HttpOnly session cookies
- **Internationalization** — English, Simplified Chinese, Traditional Chinese, Japanese
- **Theme** — light/dark mode and customizable accent color

## Installation

```bash
pip install fileviewer
```

## Quick Start

```bash
# Browse the current directory
fileviewer

# Browse a specific directory
fileviewer /path/to/dir

# Browse multiple directories with display names
fileviewer /data /projects --name Data Projects

# Enable write mode
fileviewer /path/to/dir --write

# Require login
fileviewer /path/to/dir --user admin --password secret

# Custom host and port
fileviewer /path/to/dir --host 0.0.0.0 --port 9000

# Don't auto-open browser
fileviewer /path/to/dir --no-browser
```

## CLI Options

| Option | Default | Description |
|--------|---------|-------------|
| `paths` | `.` | One or more root directories to browse |
| `--name NAME [NAME ...]` | directory name | Display names for root directories (one per path, in order) |
| `--host HOST` | `127.0.0.1` | Host to bind to |
| `--port PORT` | `8001` | Port to listen on |
| `--write` | off | Enable file write operations |
| `--user USER` | — | Username for authentication |
| `--password PASS` | — | Password for authentication |
| `--no-browser` | off | Do not open browser on startup |

## Tech Stack

**Backend:** Python 3.10+, FastAPI, Uvicorn, Polars, Pillow, py7zr

**Frontend:** Vue 3, Vuetify 3, CodeMirror 6, Vite

## Development

```bash
# Backend (runs on port 8001)
pip install -e .
fileviewer . --port 8001 --write

# Frontend (runs on port 5173, proxies /api to backend)
pnpm install
pnpm dev
```

Build for production:

```bash
pnpm build      # outputs to static/
pip install .
```

## Security Notes

- All paths are validated against the configured root directories — no directory traversal is possible.
- Write operations are disabled by default.
- Auth tokens are stored in HttpOnly, SameSite cookies.

## License

See [LICENSE](LICENSE).
