nblibrary:从源存储库获取笔记本的实用程序

nblibrarian的Python项目详细描述


维护jupyter笔记本库的工具 从笔记本的“仓库”(另一个github存储库)。

安装

您可以从pypi安装nblibrary

pip install nblibrarian

或来源

git clone https://github.com/lheagy/nblibrarian
cd nblibrarian
pip install -e .

配置nblibrary

配置nblibrary需要两个文件::

库配置.yml

.library config.yml文件指定源存储库的详细信息,以及是否希望包含environment.yml文件和/或requirements.txt文件。(我们建议您至少下载其中一个)。library config.yml的结构如下:

# information about the source librarysource:github:user:geoscixyz# github username or organizationrepo:geosci-labs# github repositorybranch:master# [optional] branch to fetch material fromdirectory: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 librarysetup:environment:environment.yml# [optional] include the environment.yml from the sourcerequirements:requirements.txt# [optional] include the requirements.txt file

.jupyter包含

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,就可以从命令行运行nblibrary 下载指定的文件。

nblibrarian

还有一些选项,可以在verbose模式下运行使用

nblibrarian -v

如果你想更新你的库,你可以随时修改.jupyter include并重新运行nblibrary。默认情况下,它不会覆盖当前笔记本。如果确实要覆盖它们,请运行

nblibrarian --overwrite=True

如果要指定jupyter include和config文件的路径(例如,如果将它们放在其他目录中),请使用

nblibrarian --config=.library-config.yml --jupyter-include=.jupyter-include

问题

如果您在使用nblibrary时遇到任何错误、问题或问题,请在github上create an issue

许可证

这项工作是根据BSD 3-Clause License授权的。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java是导入组织。阿帕奇。oro无法解决   java如何同步多个线程访问一些公共数据   java TableModel在第二次单击“其他”复选框后更改jcheckbox单元格的值   java如何在ApacheFlink中连接两个流?   java NSSM服务不显示GUI   java扫描器+交换机的使用   java切换已被抑制的后台进程的标准输出(unix)   带字符串参数的构造函数Java constructor   使用MockRestServiceServer测试HttpRequestExecutingMessageHandler   java使用哪种数据结构来获得所需的结果   java LibGDX定心正交照相机   Java在计算表达式时的自动类型转换   XPath中的java工厂模式   java通知不显示在屏幕上,并且不存在错误   使用Hibernate和MySQL处理upsert的java优雅方式   Java 11中的CLI命令:运行类与运行模块   Java Web Start和allpermissions   swing Java JTable禁用单单元格选择边框高亮显示   使用secp256r1曲线(BouncyCastle)生成java ECDSA签名,给出长度为127的签名