Browse local files using the non-standard Web Browser File System Access API

Overview

jupyterlab-filesystem-access

Github Actions Status

Browse local files using the non-standard Web Browser File System Access API.

⚠️ This extension is compatible with Chromium-based browsers only (for now) ⚠️

image

More info on MDN: https://developer.mozilla.org/en-US/docs/Web/API/Window/showOpenFilePicker

filesystem-extension.mp4

Motivation

The main motivation for this extension is to give access to local files in JupyterLite: jupyterlite/jupyterlite#403

It can also be used on hosted and ephemeral JupyterLab deployments such as Binder.

Requirements

  • JupyterLab >= 3.0

Install

To install the extension, execute:

pip install jupyterlab_filesystem_access

Uninstall

To remove the extension, execute:

pip uninstall jupyterlab_filesystem_access

Contributing

Development install

Note: You will need NodeJS to build the extension package.

The jlpm command is JupyterLab's pinned version of yarn that is installed with JupyterLab. You may use yarn or npm in lieu of jlpm below.

# Clone the repo to your local environment
# Change directory to the jupyterlab_filesystem_access directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm build

You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.

# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm watch
# Run JupyterLab in another terminal
jupyter lab

With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).

By default, the jlpm build command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:

jupyter lab build --minimize=False

Development uninstall

pip uninstall jupyterlab_filesystem_access

In development mode, you will also need to remove the symlink created by jupyter labextension develop command. To find its location, you can run jupyter labextension list to figure out where the labextensions folder is located. Then you can remove the symlink named jupyterlab-filesystem-access within that folder.

Packaging the extension

See RELEASE

Comments
  • Problem with build instructions

    Problem with build instructions

    I am trying to follow the build instructions. (The pip install doesn't work as the package isn't on pypi (yet?)).

    I clone the repo and cd into the folder jupyterlab-filesystem, i.e. the top-level folder of the cloned repo (the instructions say to cd into jupyterlab_filesystem with underscore which I also tried).

    pip instatll -e . works fine but jupyter labextension develop . --overwrite fails.

    ~/Github/jupyterlab-filesystem$ jupyter labextension develop . --overwrite
    WARNING: Build tool `jupyter-packaging` is missing. Install it with pip or conda.
    An error occurred.
    ModuleNotFoundError: There is no labextension at .. Errors encountered: [TypeError("the 'package' argument is required to perform a relative import for '.'"), 
    
    opened by VolkerH 9
  • Implement rename and copy

    Implement rename and copy

    Implementing rename and copy. The file-system access PR in JupyterLite https://github.com/jupyterlite/jupyterlite/pull/655 will need a proper "rename" method for creating files (mainly because you cannot create a new file given a name with the newUntitled Drive method, so we need to do a rename right after).

    Fix #18 and fix #19

    enhancement 
    opened by martinRenou 8
  • Automated Changelog Entry for 0.5.1 on main

    Automated Changelog Entry for 0.5.1 on main

    Automated Changelog Entry for 0.5.1 on main

    After merging this PR run the "Full Release" Workflow on your fork of jupyter_releaser with the following inputs | Input | Value | | ------------- | ------------- | | Target | jupyterlab-contrib/jupyterlab-filesystem-access | | Branch | main | | Version Spec | 0.5.1 | | Since | v0.5.0 |

    documentation 
    opened by martinRenou 3
  • Implement newUntitled

    Implement newUntitled

    Implement the newUntitled method.

    I am reusing the same pattern as the classic JupyterLab file browser where new folders are name Untitled Folder {N} and new files are named untitled{N}.{ext}

    newuntitled

    opened by martinRenou 3
  • Unclear whether this will create access to the browser-mounted fs from within a notebook

    Unclear whether this will create access to the browser-mounted fs from within a notebook

    So I managed to get this to work (thanks for your help in the other issue) and I can run a notebook from a local filesystem mounted through this extension and edit files from my local folder in the Jupyterlab IDE. What is not quite clear to me (and what got me excited to try this out straight away): will I be able to access this filesystem from within a notebook, e.g. to access some locally saved data from a notebook executed on a remote server?

    opened by VolkerH 3
  • Fix README reading

    Fix README reading

    Fix reading special characters from the README, should fix the Windows build in https://github.com/conda-forge/staged-recipes/pull/19491#pullrequestreview-1024422500

    bug 
    opened by martinRenou 2
  • Add Binder and/or JupyterLite demo

    Add Binder and/or JupyterLite demo

    Looks like this extension was generated without the Binder files.

    We should add them to be able to try it easily on Binder.

    Alternatively we could also setup docs and deploy a demo site with jupyterlite-sphinx.

    opened by jtpio 2
  • Basic support for saving a file

    Basic support for saving a file

    Still quite a lot of errors in the dev tools console, but this should help get the basic flow of listing, opening and saving a file at the top-level to work.

    enhancement 
    opened by jtpio 2
  • Run CI on Windows + Use micromamba

    Run CI on Windows + Use micromamba

    The CI on windows fails on https://github.com/conda-forge/staged-recipes/pull/19491#pullrequestreview-1024422500, so let's add a workflow for Windows here

    maintenance 
    opened by martinRenou 1
  • Transparent mounting of local folder as a regular folder

    Transparent mounting of local folder as a regular folder

    Currently, the only files that can be accessed from a pyodide kernel are those in the "internal memory" of the instance. This can be alleviated by uploading manually files, but it is cumbersome and not practical if the number of files is large.

    Describe the solution you'd like

    Instead, it would be helpful to have a way of “mounting” a folder in the file system as a folder accessible to jupyterlite through the filesystem API so that the pyodide kernel has a transparent access to local files on the hard drive.

    Describe alternatives you've considered

    Drag and dropping files works, but it is cumbersome and unpractical for a large number of files and requires all files to be uploaded prior to doing any work. It is also possible to rely on ipywidgets to upload files with the same limitations.

    Additional context

    • Related to jupyterlite/pyodide only, this is not required for classical jupyterlab instances.
    enhancement 
    opened by cphyc 1
  • Add support for base64 types

    Add support for base64 types

    Attempt to fix #17

    The implementation I'm suggesting here looks for the mimetype:

        if (file.type === 'image/png') {
          format = 'base64';
        } else {
          format = 'text';
        }
    

    For comparison, jupyter_server seems to try to encode the file content to utf8, if that fails it falls back to base64: https://github.com/jupyter-server/jupyter_server/blob/25ec3ed0dad617a4388db865e9c1a585e54c0b7c/jupyter_server/services/contents/fileio.py#L300-L327

    I wonder if we could implement something similar in JavaScript

    https://user-images.githubusercontent.com/21197331/162987570-c8084882-9176-4bdb-a3bb-4c969830c60a.mp4

    enhancement 
    opened by martinRenou 1
  • Missing file browser toolbar items with JupyterLab 3.4.0

    Missing file browser toolbar items with JupyterLab 3.4.0

    Description

    The file browser toolbar is missing a couple of items with JupyterLab 3.4.0.

    With JupyterLab 3.3.4

    image

    With JupyterLab 3.4.0

    image

    Reproduce

    • pip install jupyterlab>=3.4.0 jupyterlab-filesystem-access
    • Open JupyterLab

    Context

    This is most likely related to https://github.com/jupyterlab/jupyterlab/pull/12281

    • Python package version: 0.4.0
    • Extension version: 0.4.0
    • Operating System and its version: Ubuntu 20.04 - Chromium 101
    bug 
    opened by jtpio 2
  • Accessing Data Files

    Accessing Data Files

    This extension works well for opening notebook files from the filesystem :-)

    It might be useful to try to catalogue how things are handled differently compared to accessing files from local storage because different workarounds may be required to handle different situations depending on where files are located:

    • when opening notebook files from the JupyterLite file system, a copy of the files appears in local browser storage; when opening from the desktop filesystem, no copy appears in local browser storage;
    • if you open a data file from the JupyterLite file system and then save it, it appears in local browser storage; it can then be opened programmatically from local browser storage;
    • you can't seem to open a data file from the local filesystem and save it into browser storage (I guess if you could do that it could start to provide a way to exfiltrate files?)?
    • Irrespective of whether the jupyterlab-filesystem-access extension is installed, you can manually upload a data file from the desktop file system into the JupyterLite file system (this seems to have a side effect of also placing the file immediately into browser storage). I note that the directory path the upload file file picker opens at may be different to the directory path used in selecting the directory on the desktop filesystem. It might be useful if these could be synched?
    enhancement 
    opened by psychemedia 0
  • Remember previously opened folders

    Remember previously opened folders

    For now we need to re-open the folders manually after reloading the page.

    Maybe the previous folder should be automatically opened is possible (best effort). That could be convenient for those always working with the same folder.

    This could also be made opt-in or opt-out via the settings.

    enhancement 
    opened by jtpio 1
Releases(v0.5.2)
Owner
Jeremy Tuloup
Scientific Software Engineer - @jupyter @jupyterlab @jupyterlite @voila-dashboards Core Developer and Jupyter Distinguished Contributor
Jeremy Tuloup
[Experimental] Browse local files using the non-standard File System Access API

jupyterlab-filesystem-access Browse local files using the non-standard Web Browser File System Access API. ⚠️ This extension is compatible with Chromi

JupyterLab Unofficial Extensions & Tools 12 Apr 15, 2022
Serve file server with single zip file as file system in Deno.

zipland Serve file server with one-single zip file in Deno. Support zip just zip32 with deflated or uncompressed serving plaintext deflate Examples Yo

Yongwook Choi 18 Nov 2, 2022
A high-resolution local database that uses precise algorithms to easily record data in local files within a project with persistent JSON and YAML support designed to be easy to set up and use

About A high-resolution local database that uses precise algorithms to easily record data in local files within a project with persistent JSON and YML

Shuruhatik 5 Dec 28, 2022
The Frontend of Escobar's Inventory Management System, Employee Management System, Ordering System, and Income & Expense System

Usage Create an App # with npx $ npx create-nextron-app my-app --example with-javascript # with yarn $ yarn create nextron-app my-app --example with-

Viver Bungag 4 Jan 2, 2023
example app that creates a new player in Spotify Connect to play music from in the browse using Spotify Web Playback SDK.

Spotify Web Playback SDK Demo Requirements User must have Spotify Premium, DRM & EME supported and JavaScript enabled Web Browser. License Copyright 2

Sijey 8 Jul 20, 2022
a cobbled together alternative UI to launchdarkly, allowing read/write access via LD API access token

discount-launchdarkly a cobbled together alternative UI to launchdarkly, allowing read/write access via LD API access token setup make sure you have a

null 9 Oct 19, 2022
An Obsidian plugin that lets you browse the web within Obsidian.

Obsidian Web Browser An Obsidian plugin that allows you to browse the web within Obsidian using v1.0 tabs. The core functionality of the plugin, rende

Dion Tryban 102 Dec 28, 2022
File Hider - This is a plugin for Obsidian that allows hiding specific files and folders from the file explorer

File Hider - This is a plugin for Obsidian that allows hiding specific files and folders from the file explorer

Oliver 24 Dec 16, 2022
A quickstart AWS Lambda function code generator. Downloads a template function code file, test harness file, sample SAM deffiniation and appropriate file structure.

Welcome to function-stencil ?? A quickstart AWS Lambda function code generator. Downloads a template function code file, test harness file, sample SAM

Ben Smith 21 Jun 20, 2022
Feel free to create new file, don't hesitate to pull your code, the most important thing is that the file name here must match your nickname so that file does not conflict with other people.

Hacktoberfest Indonesia Apa Itu Hacktoberfest ? Hacktoberfest adalah acara tahunan yang bertujuan untuk mendorong berkontribusi kedalam ekosistem open

Juan Daniel 5 Dec 15, 2022
Country finder: A site that allows you to browse the countries of the world with all the necessary information about the country

Country finder: A site that allows you to browse the countries of the world with all the necessary information about the country

Medjahdi Islem 12 Nov 18, 2022
Browse a list of your favorite movies and tv shows on the Steam-It Movie Database.

Preview Desktop view Stream-It The website allows users to browse a list of movies, like a movie, view and add comments to a movie Built With HTML and

Ben Kiarie 10 Sep 30, 2022
A GUI to browse and restore restic backup repositories.

A simple, cross-platform restic backup GUI for browsing and restoring restic repositories. Built with Wails2, based on leaanthony's Restoric PoC. Down

Eduard Müller / taktik 91 Dec 29, 2022
Make a release for Jitsi test browser page (minify js/css files, pack the app in one file).

JitsiTestBrowserTool This tools allows you to make a release for Jitsi test browser page (minify js/css files, pack the app in one file). /!\ Not work

GIP Renater 4 Aug 15, 2022
This project is a Web application based on an external API. The API provides data about music (including artists, albums, etc) that users can access on-demand. This project was built with ES6, HTML and CSS and it is a SPA.

Capstone M2: Music App This project is a Web application based on the music API Napster built with ES6, HTML and CSS and it is a SPA. This API provide

Karla Delgado 12 Aug 29, 2022
The full power of the Go Compiler directly in your browser, including a virtual file system implementation. Deployable as a static website.

Static Go Playground Features Full Go Compiler running on the browser. Supports using custom build tags. Incremental builds (build cache). Supports mu

null 25 Jun 16, 2022
A simple single page web-app that stores, removes and edits books' names in the browser's local storage.

A simple single page web-app that stores, removes and edits books' names in the browser's local storage. Made with Webpack bundler

Alejandro Neira 5 Apr 1, 2022
Microverse Module 02 Project: This is education project that allow user to add desire books to the list and also delete books. It makes use of local storage to preserve the data on the web browser.Built with HTML, CSS, JavaScript

Project Demo Live Demo AWESOME BOOK PROJECT Project allow user to add desire books to the list and also delete books. It makes use of local storage to

Ajayi Ridwan 8 Dec 3, 2022
A W3C standard compliant Web rendering engine based on Flutter.

WebF WebF (Web on the Flutter) is a W3C standard compliant Web rendering engine based on Flutter, it can run web application on Flutter natively. W3C

openwebf 418 Dec 25, 2022