nb库管理员:用于从源仓库检索笔记本的工具
项目描述
用于维护从“仓库”笔记本(另一个github仓库)中获取的Jupyter笔记本库的工具。
安装
您可以从PyPI安装nb库管理员
pip install nblibrarian
或从源代码安装
git clone https://github.com/lheagy/nblibrarian
cd nblibrarian
pip install -e .
配置nb库管理员
您需要两个文件来配置 nb库管理员
.library-config.yml
.library-config.yml 文件指定了源仓库的详细信息,以及您是否想包含 environment.yml 文件和/或 requirements.txt 文件。(我们建议您至少下载其中一个)。.library-config.yml 的结构如下
# information about the source library
source:
github:
user: geoscixyz # github username or organization
repo: geosci-labs # github repository
branch: master # [optional] branch to fetch material from
directory: notebooks # [optional] directory where the notebooks are in the repository - including it will speed up the search for the desired notebooks
# setup options for the library
setup:
environment: environment.yml # [optional] include the environment.yml from the source
requirements: requirements.txt # [optional] include the requirements.txt file
.jupyter-include
.jupyter-include 文件描述了您希望包含在库中的哪些笔记本。它遵循与 .gitignore 文件相同的语法。
# this is a comment
# dc resistivity
notebooks/dcip/DCIP_2D_Overburden_Pseudosections.ipynb # you can specify the full path
notebooks/dcip/DC_Building_Pseudosections # also without the .ipynb extension
DC_Cylinder_2D.ipynb # or just specify the notebook name
# em
/em/EM_Pipeline.ipynb
em/EM_ThreeLoopModel.ipynb
em/*Sphere*.ipynb # includes all notebooks in a directory called em with "Sphere" in the title
# magnetics
mag/*.ipynb # includes all notebooks in the mag directory
# inversion
inversion # includes notebooks in the inversion directory
用法
一旦您指定了 .library-config.yml 和 .jupyter-include,您就可以从命令行运行nb库管理员以下载您指定的文件。
nblibrarian
还有一些选项,要在 verbose 模式下运行,请使用
nblibrarian -v
如果您想更新库,您可以始终更改 .jupyter-include 并重新运行 nb库管理员。默认情况下,它不会覆盖您当前笔记本。如果您希望它覆盖它们,请运行
nblibrarian --overwrite=True
如果您想指定jupyter的包含文件和配置文件的路径(例如,如果您将它们放在不同的目录中),请使用以下方法:
nblibrarian --config=.library-config.yml --jupyter-include=.jupyter-include
问题
如果在使用nblibrarian时遇到任何错误、疑问或问题,请在github上创建一个issue。
许可证
本作品受BSD 3-Clause License许可。
项目详情
关闭
nblibrarian-0.0.1.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 05a3827e83f84a46758f5378fe49bba7f48fef820446606b2084d6c621b7dc3a |
|
MD5 | 7d19defa308507c28a9462e9f2c1affb |
|
BLAKE2b-256 | 2c031d2eaff4b273ef6319c6fbd898e7b297c90f5e180edf925b03ab58c3596e |