• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

data-8/nbpuller: A interact extension for jupyter notebook.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

data-8/nbpuller

开源软件地址:

https://github.com/data-8/nbpuller

开源编程语言:

Python 77.1%

开源软件介绍:

DEPRECATED

This extension is deprecated, please use nbgitpuller instead.

nbpuller

An extension for jupyter notebook to retrieve and update local files from remote git repository using native git pull and merge.

Installation

You can currently install this directly from git:

pip install git+https://github.com/data-8/nbpuller.git
jupyter serverextension enable --py nbpuller
jupyter nbextension install --py nbpuller

To enable this extension for all notebooks:

jupyter nbextension enable --py nbpuller

Usage

nbpuller can be activated through a HTTP GET request to a link in the following format:

<notebook_url>/interact?<settings>

<settings> has the form of URL query strings, with the following possible parameters:

Field name Required / Default
domain "github.com"
account "data-8"
repo REQUIRED
branch "gh-pages"
path REQUIRED, can be multiple
notebook_path ""

The remote git repo url is constructed as follows: https://<domain>/<account>/<repo>.git

Files or directories at each <path> of the given branch will be retrieved using git.

For example, path=README.md will retrieve a typical README file, while path=labs/ would retrieve a directory called labs in the root of the git repo.

Alternative setting will be:

Field name Required / Default
file_url REQUIRED

file_url should be a url. An example is ?file_url=http://localhost/README.md

Configuration

Nbpuller enforces several whitelists for security.

  1. File type whitelist for pulling from arbitary url (using file_url option). By default, only ipynb file type is allowed. It can be overriden by ALLOWED_FULETYPES environment variable, delimited by ":".

  2. Domain whitelist for pulling from arbitary url. By default none is allowed. Overriden by ALLOWED_URL_DOMAIN variable.

  3. Github account whitelist, enforced when pulling from a repo on github. By default, only data-8 is allowed as an account to pull from. This can be overriden by setting ALLOWED_GITHUB_ACCOUNTS variable.

  4. Git remote domain whitelist, restricting which domain can the git repo be at. By default, only Github is allowed. This can be overriden by setting ALLOWED_WEB_DOMAINS variable.

Expected behavior

If the destination folder is empty, nbpuller will git clone remote repo.

If the destination folder exist, in general, nbpuller tries to do git pull and merge with -Xours parameter, if necessary. In the case that there is any change in the folder, nbpuller will git add all of them and commit them, before pulling and merging.

After files are ready, user will receive a HTTP redirect to the file tree at the last path downloaded. In case error, the user will stay at the initial page and see an error output.

Cal Blueprint

bp

This project was worked on in close collaboration with Cal Blueprint. Cal Blueprint is a student-run UC Berkeley organization devoted to matching the skills of its members to our desire to see social good enacted in our community. Each semester, teams of 4-5 students work closely with a non-profit to bring technological solutions to the problems they face every day.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap