Jupyter Host File Picker
Jupyter widget for picking files on the host machine.
This widget allows users to select files from the machine that Jupyter is running on. This can be the user's own machine in the case of a local Jupyter session, or it can be a remote system when using Jupyter Hub. In contrast, ipywidgets.FileUpload can only select files on the user machine.
Installation
Install with pip:
python -m pip install jupyter_host_file_picker
or with uv:
uv add jupyter_host_file_picker
Usage
See the example notebook for a complete usage example.
The HostFilePicker class is a dialog with a file browser on the host machine.
You can create and display a HostFilePicker just like any other
Jupyter widget:
from jupyter_host_file_picker import HostFilePicker
picker = HostFilePicker()
# At the end of a cell:
picker
In the dialog, navigate folders by double-clicking on a folder or by single-clicking and using the 'Open' button. Similarly, select a file by double-clicking or by using the 'Select' button.
Accessing the selected file
The selected file path is stored in
picker.selected
This attribute is a list of Path objects.
Callback
Alternatively to the selected attribute, you can register an observer function
that will be called whenever the user selects a file:
def print_selected(change):
print("Selected file", change["new"])
picker.observe(print_selected, names="selected")
Note that this will only print to the Jupyter log console.
Example with button and text field
Here is a more extensive example that uses a button to open the dialog and a text field to display the selected file:
import os
from pathlib import Path
from typing import Any
from IPython.display import display
from ipywidgets import Button, HBox, Layout, Output, Text
from jupyter_host_file_picker import HostFilePicker
selected_text = Text(layout=Layout(width="100%"))
browse_button = Button(description="Browse", icon="folder-open")
dialog_output = Output(layout=Layout(display="none"))
def sync_selected(change: dict[str, Any]) -> None:
# Insert the selected path into the text field.
selected: list[Path] = change["new"]
if selected:
path = selected[0] # For now, there always is only one path.
selected_text.value = os.fspath(path)
def browse_files(_: Button) -> None:
# Open a dialog when the button is clicked.
with dialog_output: # Use the Output widget as a display context.
dialog_output.clear_output() # Remove old dialog, if any.
picker = HostFilePicker()
picker.observe(sync_selected, names="selected")
display(picker)
browse_button.on_click(browse_files)
HBox([selected_text, browse_button, dialog_output])
We open the dialog from a callback of the button.
This callback does not have a display context,
and so we cannot simply show the dialog using display(picker).
Instead, we use a dedicated Output widget to provide the necessary display context.
(This widget hat Layout(display="none") because it does not need to be visible itself;
it only provides access to the HTML document.)
Development
Requirements
Install the following:
These tools manage all dependencies and build the package.
Run development build
The first time you clone the repository, install JavaScript dependencies using
npm install
Run the following to build the TypeScript code.
This will automatically rebuild after any changes in the js folder.
npm run dev
Then, launch Jupyter with the example notebook:
uv run jupyter lab example.ipynb
Uncomment the first code cell to enable hot-reloading of JavaScript and CSS code. If you make changes to the Python code, you need to restart the kernel.
Make a release
To make a release, create a new release on GitHub and select a tag name according to the calendar versioning scheme. GitHub actions will do the rest; you only have to approve the deployment to PyPI.
Metadata
Release files for jupyter-host-file-picker 26.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jupyter_host_file_picker-26.7.0.tar.gz | 100.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jupyter_host_file_picker-26.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 201.5 kB
Release files / jupyter_host_file_picker-26.7.0.tar.gz
| Download URL | jupyter_host_file_picker-26.7.0.tar.gz |
|---|---|
| Size | 100.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f20e4183d329e70231bbb50506c152a24afdc490e95b01c9cd0f20ddfb66d2d1
|
|
BLAKE2b-256 checksum How to use checksums |
47d2f540051588450eebabd62c37e6b719b461ecb0903cd865c894edab59baf8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 16, 2026.
Transparency logRelease files / jupyter_host_file_picker-26.7.0-py3-none-any.whl
| Download URL | jupyter_host_file_picker-26.7.0-py3-none-any.whl |
|---|---|
| Size | 101.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ae3437e6efa0a08f437b83aaed54848c2cebe3ab82fef69aa5530314dffd4e7a
|
|
BLAKE2b-256 checksum How to use checksums |
535f8395a317965b534dccc8ae30e496679964de7685c3e28ca1a795c9c6aea2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 16, 2026.
Transparency log