使用文件系统API挂载本地文件
项目描述
jupyterlab-filesystem-access
使用非标准的Web浏览器文件系统访问API浏览本地文件。
⚠️ 此扩展仅与基于Chromium的浏览器兼容(目前如此) ⚠️
更多关于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 的版本。您可以使用 yarn
或 npm
替代 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的散列
算法 | 散列摘要 | |
---|---|---|
SHA256 | 2ef1061f2291519d5089fb3442bd7839a89cb30d64d00b928f39613acee8fc89 |
|
MD5 | d34c773b41f1a7de5bb01264d7e61238 |
|
BLAKE2b-256 | 48e991c415048f93b582932b0ad21a59d174a36f325980709fb896f79eea8207 |
哈希值 用于 jupyterlab_filesystem_access-0.6.0-py3-none-any.whl
算法 | 散列摘要 | |
---|---|---|
SHA256 | 66027f10ec383e8efe6bb7ed394cebd8f7e956c866f2c3e777db098f15e2c664 |
|
MD5 | cec078e7f76d043368bd0021c45da79f |
|
BLAKE2b-256 | c9148a236b0b73c141f40f287eeca4df6bcb17d02e68d083cacbe03be040e5d4 |