Make Github commit in Jupyter IPython notebook
This is simply a python script that you can copy paste in your working directory. You can use it to commit changes in your github repo via Jupyter notebook.
#First import the script
import git_jupyter
#Create a session by giving in your details
sess = git_jupyter.Jupyter('README.ipynb','huzaifafaruqui','Github-via-IPython','*******','******')
# file name , owner name , repository name, github username , github password
# username and password will be hidden automatically
sess.create_file('README.ipynb','Read this')
# file name, commit message
sess.update_file('README.ipynb','Updated')
# file name, commit message
sess.delete.file('README.ipynb','commit msg')
- Requests - Requests is an elegant and simple HTTP library for Python
- Jupyter notebook - The Jupyter Notebook is a web application that allows you to create and share documents that contain live code, equations, visualizations and explanatory text.
- Github API
Please feel free to send PR. This is a very simple script but I want to extend its functionalities. Also, create an issue if you find any bug. Note - My code follows PEP8 guidelines.
- Replace Basic Auth with OAuth
- Ability to create a repo
- Write tests
Huzaifa Faruqui
MIT
sess.update_file('README.ipynb','Updated')