• Stars
    star
    409
  • Rank 105,128 (Top 3 %)
  • Language
    TypeScript
  • License
    BSD 3-Clause "New...
  • Created almost 7 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

GitHub integration for JupyterLab

JupyterLab GitHub

Binder

A JupyterLab extension for accessing GitHub repositories.

What this extension is

When you install this extension, an additional filebrowser tab will be added to the left area of JupyterLab. This filebrowser allows you to select GitHub organizations and users, browse their repositories, and open the files in those repositories. If those files are notebooks, you can run them just as you would any other notebook. You can also attach a kernel to text files and run those. Basically, you should be able to open any file in a repository that JupyterLab can handle.

Here is a screenshot of the plugin opening this very file on GitHub: gitception

What this extension is not

This is not an extension that provides full GitHub access, such as saving files, making commits, forking repositories, etc. For it to be so, it would need to more-or-less reinvent the GitHub website, which represents a huge increase in complexity for the extension.

A note on rate-limiting

This extension has both a client-side component (that is, JavaScript that is bundled with JupyterLab), and a server-side component (that is, Python code that is added to the Jupyter server). This extension will work with out the server extension, with a major caveat: when making unauthenticated requests to GitHub (as we must do to get repository data), GitHub imposes fairly strict rate-limits on how many requests we can make. As such, you are likely to hit that limit within a few minutes of work. You will then have to wait up to an hour to regain access.

For that reason, we recommend that you take the time and effort to set up the server extension as well as the lab extension, which will allow you to access higher rate-limits. This process is described in the installation section.

Prerequisites

  • JupyterLab 3.0
  • A GitHub account for the server extension

Installation

As discussed above, this extension has both a server extension and a lab extension. Both extensions will be installed by default when installing from PyPI, but you may have only lab extension installed if you used the Extension Manager in JupyterLab 3.x.

We recommend completing the steps described below as to not be rate-limited. The purpose of the server extension is to add GitHub credentials that you will need to acquire from https://github.com/settings/developers, and then to proxy your request to GitHub.

For JupyterLab version older than 3 please see the instructions on the 2.x branch.

1. Installing both server and prebuilt lab extension

To install the both the server extension and (prebuilt) lab extension, enter the following in your terminal:

pip install jupyterlab-github

After restarting JupyterLab, the extension should work, and you can experience the joys of being rate-limited first-hand!

2. Getting your credentials from GitHub

There are two approaches to getting credentials from GitHub: (1) you can get an access token, (2) you can register an OAuth app. The second approach is not recommended, and will be removed in a future release.

Getting an access token (recommended)

You can get an access token by following these steps:

  1. Verify your email address with GitHub.
  2. Go to your account settings on GitHub and select "Developer Settings" from the left panel.
  3. On the left, select "Personal access tokens"
  4. Click the "Generate new token" button, and enter your password.
  5. Give the token a description, and check the "repo" scope box.
  6. Click "Generate token"
  7. You should be given a string which will be your access token.

Remember that this token is effectively a password for your GitHub account. Do not share it online or check the token into version control, as people can use it to access all of your data on GitHub.

Setting up an OAuth application (deprecated)

This approach to authenticating with GitHub is deprecated, and will be removed in a future release. New users should use the access token approach. You can register an OAuth application with GitHub by following these steps:

  1. Log into your GitHub account.
  2. Go to https://github.com/settings/developers and select the "OAuth Apps" tab on the left.
  3. Click the "New OAuth App" button.
  4. Fill out a name, homepage URL, description, and callback URL in the form. This extension does not actually use OAuth, so these values actually do not matter much, you just need to enter them to register the application.
  5. Click the "Register application" button.
  6. You should be taken to a new page with the new application information. If you see fields showing "Client ID" and "Client Secret", congratulations! These are the strings we need, and you have successfuly set up the application.

It is important to note that the "Client Secret" string is, as the name suggests, a secret. Do not share this value online, as people may be able to use it to impersonate you on GitHub.

3. Enabling and configuring the server extension

The server extension will be enabled by default on new JupyterLab installations if you installed it with pip. If you used Extension Manager in JupyterLab 3.x, please uninstall the extension and install it again with the instructions from point (1).

Confirm that the server extension is installed and enabled with:

jupyter server extension list

you should see the following:

- Validating jupyterlab_github...
     jupyterlab_github 3.0.0 OK

On some older installations (e.g. old JupyterHub versions) which use jupyter notebook server instead of the new jupyter-server, the extension needs to show up on the legacy serverextensions list (note: no space between server and extension):

jupyter serverextension list

If the extension is not enabled run:

jupyter server extension enable jupyterlab_github

or if using the legacy notebook server:

jupyter serverextension enable jupyterlab_github

You now need to add the credentials you got from GitHub to your server configuration file. Instructions for generating a configuration file can be found here. Once you have identified this file, add the following lines to it:

c.GitHubConfig.access_token = '< YOUR_ACCESS_TOKEN >'

where "< YOUR_ACCESS_TOKEN >" is the string value you obtained above. If you generated an OAuth app, instead enter the following:

c.GitHubConfig.client_id = '< YOUR_CLIENT_ID >'
c.GitHubConfig.client_secret = '< YOUR_CLIENT_SECRET >'

where "< YOUR_CLIENT_ID >" and "< YOUR_CLIENT_SECRET >" are the app values you obtained above.

With this, you should be done! Launch JupyterLab and look for the GitHub tab on the left!

Customization

You can set the plugin to start showing a particular repository at launch time. Open the "Advanced Settings" editor in the Settings menu, and under the GitHub settings add

{
  "defaultRepo": "owner/repository"
}

where owner is the GitHub user/org, and repository is the name of the repository you want to open.

More Repositories

1

jupyterlab

JupyterLab computational environment.
TypeScript
14,050
star
2

jupyterlab-desktop

JupyterLab desktop application, based on Electron.
TypeScript
3,616
star
3

jupyter-ai

A generative AI extension for JupyterLab
Python
3,094
star
4

jupyterlab-git

A Git extension for JupyterLab
TypeScript
1,434
star
5

jupyterlab-toc

Table of Contents extension for JupyterLab
TypeScript
726
star
6

jupyterlab-latex

JupyterLab extension for live editing of LaTeX documents
Python
615
star
7

lumino

Lumino is a library for building interactive web applications
TypeScript
612
star
8

debugger

A visual debugger for Jupyter notebooks, consoles, and source files
TypeScript
562
star
9

jupyter-renderers

Renderers and renderer extensions for JupyterLab
HTML
488
star
10

extension-examples

JupyterLab Extensions by Examples
TypeScript
443
star
11

jupyterlab-google-drive

Cloud storage for JupyterLab using Google Drive
TypeScript
400
star
12

retrolab

JupyterLab distribution with a retro look and feel 🌅
Jupyter Notebook
282
star
13

jupyterlab-monaco

A JupyterLab extension providing the Monaco editor
TypeScript
237
star
14

rtc

Real Time Collaboration for Jupyter and beyond
TypeScript
218
star
15

jupyterlab-demo

Demonstrations of JupyterLab
Jupyter Notebook
184
star
16

extension-cookiecutter-ts

A cookiecutter recipe for JupyterLab extensions in Typescript
CSS
179
star
17

jupyterlab-data-explorer

First class datasets in JupyterLab
TypeScript
178
star
18

jupyter-collaboration

A Jupyter Server Extension Providing Support for Y Documents
Jupyter Notebook
153
star
19

jupyterlab_server

A set of server components for JupyterLab and JupyterLab like applications
Python
139
star
20

jupyterlab-hdf5

Open and explore HDF5 files in JupyterLab. Can handle very large (TB) sized files, and datasets of any dimensionality
Jupyter Notebook
115
star
21

jupyterlab-celltags

A JupyterLab extension for notebook cell tags
TypeScript
113
star
22

jupyterlab-commenting

Commenting and annotation for JupyterLab
Jupyter Notebook
99
star
23

language-packs

Language packs for JupyterLab ecosystem
Python
78
star
24

scipy2018-jupyterlab-tutorial

Tutorial material and instruction for scipy 2018 jupyterlab tutorial
Jupyter Notebook
73
star
25

frontends-team-compass

A repository for team interaction, syncing, and handling meeting notes across the JupyterLab ecosystem.
58
star
26

extension-cookiecutter-js

A cookiecutter recipe for building JupyterLab extensions.
Python
55
star
27

jupyterlab-shortcutui

A JupyterLab extension for managing keyboard shortcuts
TypeScript
54
star
28

scipy2019-jupyterlab-tutorial

Scipy 2019 JupyterLab tutorial
Jupyter Notebook
51
star
29

extension-template

A `copier` template for JupyterLab extensions
Jinja
51
star
30

jupyterlab-statusbar

A status bar for JupyterLab
TypeScript
49
star
31

theme-cookiecutter

A cookiecutter template to help you make new JupyterLab theme extensions
CSS
49
star
32

jupyterlab-plugin-playground

A dynamic extension loader for JupyterLab
TypeScript
47
star
33

jupyterlab_pygments

Pygments theme making use of JupyterLab CSS variables
Python
39
star
34

hatch-jupyter-builder

A hatch plugin to help build Jupyter packages
Python
38
star
35

pull-requests

A JupyterLab extension for reviewing GitHub pull requests
Python
37
star
36

jupyterlab_xkcd

Random xkcd comic in a JupyterLab panel
TypeScript
31
star
37

galata

JupyterLab UI Testing Framework
JavaScript
30
star
38

jupyterlab-metadata-service

Linked data exploration in JupyterLab.
TypeScript
29
star
39

jupyterlab-telemetry

A JupyterLab extension for logging and telemetry of usage data
TypeScript
28
star
40

jupyterlab_apod

JupyterLab extension tutorial answer key. Please see the tutorial at https://jupyterlab.readthedocs.io/en/stable/extension/extension_tutorial.html
TypeScript
23
star
41

jupytercon-jupyterlab-tutorial

JupyterCon 2018 JupyterLab tutorial
Jupyter Notebook
22
star
42

mimerender-cookiecutter-ts

Cookie cutter for JupyterLab mimerenderer extensions using TypeScript
Python
19
star
43

pytest-check-links

pytest plugin that checks URLs
Python
17
star
44

jupyterlab-mp4

Example mimerenderer extension for showing mp4 videos.
TypeScript
17
star
45

mimerender-cookiecutter

A cookiecutter for rendering MIME type based output
Python
15
star
46

jupyter-chat

An extension to add a chat panel to JupyterLab
TypeScript
13
star
47

ui-profiler

Extension for profiling performance of JupyterLab UI for JupyterLab core developers, extension developers, and advanced users.
TypeScript
13
star
48

benchmarks

Benchmarking tools for JupyterLab
Jupyter Notebook
12
star
49

maintainer-tools

Workflows and Actions meant to be used by other repositories to make repo maintenance easier
Python
11
star
50

runall-extension

Add a "Run All Cells" toolbar button, context menu item, and keyboard shortcut.
TypeScript
8
star
51

jupyterlab-media

Repository storing movies and other media for JupyterLab tutorials and documentation
8
star
52

vscode-config-template

A copier template for creating the IDE config needed to debug the Python and Typescript code in any Jupyter project
Dockerfile
8
star
53

jupytercon-jupyterlab-training

JupyterCon 2018 JupyterLab Training
7
star
54

jupyterlab-translate

JupyterLab Language pack helper
Python
7
star
55

richoutput-js

Experimental investigation into a rendermime for es6 modules rendering rich output
Jupyter Notebook
7
star
56

jupyterlab-module-federation

Experimental playground for a JupyterLab extension system based on Module Federation
Python
5
star
57

jupyterlab-bot

JupyterLab Bot
Python
5
star
58

jupyterlab-probot

A probot for JupyterLab development
TypeScript
3
star
59

language-pack-cookiecutter

Template for Jupyterlab Language packs
Jinja
3
star
60

ux-research

3
star
61

.github

Community health files for the @JupyterLab organization
1
star
62

jupyter-builder

Build tools for JupyterLab (and remixes)
Python
1
star