Name: nbgdrive
Owner: Data Science 8
Description: NB extension for Google Drive file sync'ing
Created: 2016-11-22 02:59:46.0
Updated: 2017-04-19 23:21:06.0
Pushed: 2017-05-12 00:12:55.0
Homepage: null
Size: 2711
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A Google Drive extension for Jupyter notebook. Automatically creates a sync directory for the user on Google Drive and autosyncs their files every 24 hours. Adds a button to allow users to sync whenever they need to.
You can currently install this directly from git:
install git+https://github.com/data-8/nbgdrive.git
ter serverextension enable --py nbgdrive
ter nbextension install --py nbgdrive
To enable this extension for all notebooks:
ter nbextension enable --py nbgdrive
This repository was made specifically for UC Berkeley's Data 8 class, and as such, makes assumptions about the location of your work directory with which we are to sync files upstream. It currently matches some Docker images we use, and defaults to /home/jovyan
. Please note that if the structure of your directory does not match, you will be unable to sync files to Google Drive. Before we make a fix to this, you can still use this repository by changing this file directory to whatever local directory you will be using. Then, please rerun the above commands. In this directory, you can run:
uninstall nbgdrive
install .
ter serverextension enable --py nbgdrive
ter nbextension install --py nbgdrive
ter nbextension enable --py nbgdrive
Once correctly installed, you can login with Google Drive in order to grant nbgdrive the required permissions to run.
You will be redirected to a new page where you will be given a verification code to insert back in a text field in the Jupyter Notebook, as shown below:
Once you are successfully logged in, you will be able to Sync manually by pressing the cloud button. Otherwise, nbgdrive will sync your directory automatically whenever you haven't synched in the past 24 hours.
Syncing will create a sync folder in the main directory of your Google Drive, and upstream sync to it the contents of the Jupyter Notebook directory /home/jovyan
. As this tool was created with UC Berkeley's Data 8 class in mind, the default folder structure will be named Jupyter/Nbgdrive
.
Tampering with the contents or location of the sync folder will cause nbgdrive to break. To fix any such issue, it's recommended to log out (through the logout button next to the sync button), delete any preexisting synced folders on your Google Drive account, and reauthenticate Google Drive.
There are a few dependencies required for this repository to function currectly. Underlying nbgdrive
is a Google Drive CLI. You must install and give this tool proper access before using nbgdrive
. Please ensure this tool exists on your $PATH
, by putting in the default /usr/bin
or by modifying your bash_profile
.
On unix based systems, after downloading gdrive
, you must make it executable by running a chmod +x gdrive
command, before mv gdrive /usr/bin
. Alternatively, you can use brew install gdrive
.
Additionally, there are Selenium tests located in the tests
subdirectory. To run these tests, first pip install selenium
. Depending on what browsers you'd like to test for, you will also need to download some drivers and place them in your /usr/bin
directory.
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.