Skip to content

runsun-edu/githubcommit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

githubcommit

githubcommit is a jupyter notebook extension enabling users push ipython notebooks to a git repo. The git button gets displayed in the notebook toolbar. After saving any notebook the user can push notebook to pre-specified git repository. There are few environment variables that must be exported. Currently this extension supports commits to a single github repo defined in environment variable but in the long run need help to modify this extension allowing user to select his repo and branch.

files

- githubcommit/	-- 	
  |- __pycache__	
  |- static/		
  |  |- main.js -- make commit file selectable by checkbox
  |- .DS_Store	
  |- __init__.py	
  |- handlers.py -- Handle commit/push when the commit button is clicked.
- screens/	
- LICENSE	
- README.md	
- config --	Github remove strict key checking
- env.sh -- Repo settings for githubcommit for Jupyter. Don't override exsisting ssh key pair	
- setup.py --	For setting up githubcommit, make it available to python 

Installation

You can currently install this directly from git:

pip install git+https://github.com/sat28/githubcommit.git
jupyter serverextension enable --py githubcommit
jupyter nbextension install --py githubcommit

To enable this extension for all notebooks:

jupyter nbextension enable --py githubcommit

Steps

  • Install package using above commands
  • Create Git repo where notebooks will be pushed if not already exists and clone it in your GIT_PARENT_DIR
  • Clone this repo as well in your GIT_PARENT_DIR directory
  • Replace the values in env.sh present in this repo itself
  • Run the command - source ~/githubcommit/env.sh
  • Configure ssh key (present in ~/.ssh/id_rsa.pub or specified location) in github account
  • Run jupyter notebook from within your repo directory

Example git configuration

export GIT_PARENT_DIR=~
export GIT_REPO_NAME=gitjupyter
export GIT_BRANCH_NAME=master
export GIT_USER=sat28
export GIT_EMAIL=[email protected]
export GITHUB_ACCESS_TOKEN=#access-token from github developer settings
export GIT_USER_UPSTREAM=sat28

Screenshots

Extension

Commit Message

Success Message

Credits

Thanks to https://github.com/Lab41/sunny-side-up for laying the foundation of this extension.

Thanks to https://github.com/justvarshney for support.

About

A jupyter notebook extension enabling users push ipython notebooks to a git repo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 50.0%
  • JavaScript 38.3%
  • Shell 11.7%