跳转到主要内容

使用文件系统API挂载本地文件

项目描述

jupyterlab-filesystem-access

ci-badge lite-badge docs-badge

使用非标准的Web浏览器文件系统访问API浏览本地文件。

⚠️ 此扩展仅与基于Chromium的浏览器兼容(目前如此) ⚠️

image

更多关于MDN的信息:https://mdn.org.cn/en-US/docs/Web/API/Window/showOpenFilePicker

https://user-images.githubusercontent.com/591645/160241594-6b363b06-2103-445a-ac68-9ecc6104e0c4.mp4

动机

此扩展的主要动机是为JupyterLite提供对本地文件的访问: https://github.com/jupyterlite/jupyterlite/issues/403

它也可以用于托管和瞬态的JupyterLab部署,例如 Binder

要求

  • JupyterLab >= 3.0

安装

要安装扩展,请执行

pip install jupyterlab-filesystem-access

卸载

要删除扩展,请执行

pip uninstall jupyterlab-filesystem-access

贡献

开发安装

注意:您将需要NodeJS来构建扩展包。

jlpm 命令是JupyterLab预装的 yarn 的版本。您可以使用 yarnnpm 替代 jlpm

# 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

您可以在不同的终端中同时监视源目录并运行JupyterLab,以监视扩展源中的更改并自动重新构建扩展。

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

在运行监视命令时,每次保存的更改都将立即在本地构建并可供正在运行的JupyterLab使用。刷新JupyterLab以在浏览器中加载更改(您可能需要等待几秒钟以重新构建扩展)。

默认情况下,jlpm build 命令为此扩展生成源映射,使其更容易使用浏览器开发工具进行调试。要为JupyterLab核心扩展也生成源映射,可以运行以下命令

jupyter lab build --minimize=False

开发卸载

pip uninstall jupyterlab-filesystem-access

在开发模式下,您还需要删除由 jupyter labextension develop 命令创建的符号链接。要找到其位置,可以运行 jupyter labextension list 以确定 labextensions 文件夹的位置。然后您可以删除该文件夹中的名为 jupyterlab-filesystem-access 的符号链接。

打包扩展

RELEASE

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解更多关于 安装软件包 的信息。

源分布

jupyterlab_filesystem_access-0.6.0.tar.gz (99.3 kB 查看散列)

上传时间

构建分布

jupyterlab_filesystem_access-0.6.0-py3-none-any.whl (21.8 kB 查看散列)

上传时间 Python 3