跳转到主要内容

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 (6.3 kB 查看哈希值)

上传时间 源代码

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面