Metadata-Version: 2.5
Name: jupyterlab_advanced_file_browser_extension
Version: 1.0.6
Summary: Folders that unfold in place as a tree, Unix Style Sorting and Open in Terminal for the JupyterLab file browser
Project-URL: Homepage, https://github.com/stellarshenson/jupyterlab_advanced_file_browser_extension
Project-URL: Bug Tracker, https://github.com/stellarshenson/jupyterlab_advanced_file_browser_extension/issues
Project-URL: Repository, https://github.com/stellarshenson/jupyterlab_advanced_file_browser_extension.git
Author-email: Stellars Henson <konrad.jelen@gmail.com>
License-Expression: BSD-3-Clause
License-File: LICENSE
Keywords: jupyter,jupyterlab,jupyterlab-extension
Classifier: Framework :: Jupyter
Classifier: Framework :: Jupyter :: JupyterLab
Classifier: Framework :: Jupyter :: JupyterLab :: 4
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.12
Requires-Dist: jupyter-server<3,>=2.21
Provides-Extra: dev
Requires-Dist: jupyter-builder<2,>=1.2; extra == 'dev'
Requires-Dist: jupyterlab<5,>=4.6; extra == 'dev'
Provides-Extra: test
Requires-Dist: coverage<8,>=7.17; extra == 'test'
Requires-Dist: pytest-asyncio<2,>=1.4; extra == 'test'
Requires-Dist: pytest-cov<8,>=7.1; extra == 'test'
Requires-Dist: pytest-jupyter[server]<1,>=0.11; extra == 'test'
Requires-Dist: pytest<10,>=9.2; extra == 'test'
Description-Content-Type: text/markdown

# jupyterlab_advanced_file_browser_extension

[![GitHub Actions](https://github.com/stellarshenson/jupyterlab_advanced_file_browser_extension/actions/workflows/build.yml/badge.svg)](https://github.com/stellarshenson/jupyterlab_advanced_file_browser_extension/actions/workflows/build.yml)
[![npm version](https://img.shields.io/npm/v/@stellarshenson/jupyterlab-advanced-file-browser-extension.svg)](https://www.npmjs.com/package/@stellarshenson/jupyterlab-advanced-file-browser-extension)
[![PyPI version](https://img.shields.io/pypi/v/jupyterlab-advanced-file-browser-extension.svg)](https://pypi.org/project/jupyterlab-advanced-file-browser-extension/)
[![Total PyPI downloads](https://static.pepy.tech/badge/jupyterlab-advanced-file-browser-extension)](https://pepy.tech/project/jupyterlab-advanced-file-browser-extension)
[![JupyterLab 4](https://img.shields.io/badge/JupyterLab-4-orange.svg)](https://jupyterlab.readthedocs.io/en/stable/)
[![Brought To You By KOLOMOLO](https://img.shields.io/badge/Brought%20To%20You%20By-KOLOMOLO-00ffff?style=flat)](https://kolomolo.com)
[![Donate PayPal](https://img.shields.io/badge/Donate-PayPal-blue?style=flat)](https://www.paypal.com/donate/?hosted_button_id=B4KPBJDLLXTSA)

Adds features to the JupyterLab file browser: folders that unfold in place as a tree, Unix Style Sorting, Open in Terminal on files and drag-and-drop path insertion into terminals, editors and notebooks. It replaces `jupyterlab_file_browser_sorting_extension`, `jupyterlab_open_in_terminal_extension` and `jupyterlab_drag_and_drop_path_extension`.

## Features

- **Folder unfolding** - A triangle on each folder row folds or unfolds the folder in place, as a tree; folding and unfolding animate over a short interval; a double-click on a folder still enters it. Based on [jupyterlab-unfold](https://github.com/jupyterlab-contrib/jupyterlab-unfold)
- **Unfolding switch** - Right-click the column header of the file browser to turn unfolding on or off, beside Show Last Modified Column and the other column items
- **Unix Style Sorting** - Names sorted in `LC_COLLATE=C` byte order (dot files, digits, capitals, underscore, lower case), folders first, also inside unfolded folders; switched in the column-header menu
- **Open in Terminal** - On a file or on the empty area of the file browser, opens a terminal in that file's folder, also for a file inside an unfolded folder
- **Drop a path into a terminal** - Drag a file or folder from the file browser onto a terminal to insert its path escaped for the shell, or single-quoted with quoting turned on; the dropped-on terminal comes to the foreground
- **Drop several files onto a terminal** - Every dragged path arrives in one send, in the order selected, separated by a space or by a newline
- **Drop a path into an editor or a notebook** - A Python file or a Python notebook code cell receives a quoted string literal or a `pathlib` expression; any other open file or code cell receives the bare path. A notebook drop lands in the cell under the pointer at that cell's cursor, and a drag holding several items is declined by an editor and by a notebook
- **Drag from the breadcrumbs** - The folder trail above the listing is a drag source, so the folder the browser shows can be dropped onto a target without first finding its row; a click on a breadcrumb still navigates
- **Delete with trash** - With the server's trash on, the Delete dialog offers Cancel, Delete Permanently and Move to Trash, and Move to Trash is the default; with the trash off, it offers Cancel and Delete. Delete Permanently removes a folder with its content whatever the server's `always_delete_dir` setting
- **Trash only where it is monitored** - Move to Trash moves only the items whose trash the trash management extension monitors: the item's mount, found from the real path of its folder, is the mount of the home trash, the server root, or a folder in the server option `TrashManagement.locations` (default `[]`; `~` is expanded and a relative entry is taken from the server root). When no selected item is monitored, such as on a network volume linked into the server root, the dialog offers Cancel and Delete Permanently only, with a line saying the trash of this location is not monitored. When some are, a line in the dialog gives the count of the others; Move to Trash moves the monitored items, then a second dialog lists the others and asks to delete them permanently, with Cancel the default
- **Trash on all volumes** - The server option `c.AdvancedFileBrowser.trash_on_all_volumes` (default `False`) set to `True` offers Move to Trash for every item whatever its mount, and Move to Trash moves the item through the server's contents manager; `False` keeps the rule above
- **Core patches recommended** - `jupyterlab_core_patches_extension` with its `jupyterlab_file_delete_trash_fix` switch on is recommended for Move to Trash on other mounts, where it moves each item into the trash of its own mount; without it, the stock JupyterLab trash behaviour applies, and the server logs one start line saying the fix is not installed or switched off
- **Large removal warning** - With the trash on, a selection larger than 10 GiB shows a warning that moving large files to the trash is not advised; the 10 GiB threshold is not a setting
- **Removal progress** - A removal still running after 1 second shows a progress dialog with a spinner and a progress bar; its Hide button closes the dialog and the removal keeps running

## Settings

Open **Settings → Settings Editor → Advanced File Browser**. These six keys replace the former Drag and Drop Path settings page; saved values from that extension are not carried over. Each entry below leads with the label the editor shows, with the JSON key in brackets:

- **Enable drag-and-drop path insertion** (`dragDropPathEnabled`) - master on/off switch; default `true`
- **Path type** (`pathType`) - `relative` (default) or `absolute`; a relative path is measured from the terminal's working directory or from the open document's folder
- **Relative terminal path caveat** - the terminal working directory comes from the deepest shell the terminal is running, so a background job that changed directory can be the one used; absolute paths and editor or notebook drops are unaffected
- **Python path style** (`pythonPathStyle`) - `posix` inserts a quoted string literal (default), `pathlib` inserts a `Path(...)` expression
- **Pathlib constructor** (`pathlibConstructor`) - `pathlib.Path` (default) or `Path`; choose `Path` only in files that already do `from pathlib import Path`, because the extension inserts no import
- **Terminal separator for several paths** (`terminalSeparator`) - `space` (default) keeps the paths on one line as arguments; `newline` gives each path a line of its own, ending every line but the last with a backslash so the shell reads it as a continuation
- **Quote paths in the terminal** (`terminalQuotePaths`) - `false` (default) backslash-escapes the characters that need it; `true` wraps each path in single quotes instead

## Requirements

- JupyterLab 4.6 or later
- Python 3.12 or later

## Install

```bash
pip install jupyterlab_advanced_file_browser_extension
```

## Uninstall

```bash
pip uninstall jupyterlab_advanced_file_browser_extension
```
