Skip to main content

jupygit

CircleCI PyPI

Integrating Jupyter Notebooks to a git workflow.

Installation.

(I highly recommend installing this into a conda environment) To install the extension and enable it just run the following commands:

pip install jupygit
jupyter serverextension enable --py jupygit --sys-prefix
jupyter nbextension install --py jupygit --sys-prefix
jupyter nbextension enable --py jupygit --sys-prefix

Why?

I've been working with Jupyter Notebooks for a while, and I always felt something dying inside me everytime I pushed a massive file to GitHub, only to have it overwritten by my next huge commit causing me to have unreadable diffs. I decided to create this extension that, as I previously stated, is a hack.

How? (and usage)

Let's say you are working on a file called Awesome.ipynb. What this extension will do once you press shiny new git button on your Notebook is:

  1. Shows a nice modal with an encouraging message.
  2. Renames your current file to Awesome-jupygit___.ipynb using Jupyter's API so that your kernel stays alive and you do not lose any work, we'll call this the "dirty" file.
  3. Adds the pattern *-jupygit___.ipynb to your .gitignore file, so that your "dirty" file does not show up as a new file in your git repository.
  4. Creates a copy of Awesome-jupygit___.ipynb but with the original name Awesome.ipynb, this copy is clean, no outputs and no execution_counts, we'll call this the "clean" file.
  5. Now is your turn to commit Awesome.ipynb, the "clean" file to source control!

Are you done pushing things to Git? Now close the dialog and this will happen:

  1. Delete the file Awesome.ipynb (do not worry! your kernel and work is safe in the "dirty" file).
  2. Rename Awesome-jupygit___.ipynb to Awesome.ipynb so that you can resume your work where you left it before being a good human and using source control.

Metadata

Release files for jupygit 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jupygit 0.4.0
File Size Uploaded
jupygit-0.4.0.tar.gz 5.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jupygit 0.4.0
File Interpreter ABI Platform
jupygit-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.1 kB

Release files / jupygit-0.4.0.tar.gz

Download URL jupygit-0.4.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4f5714986a092a28ee4d20fbac4a156b280c0278c200b29bcd2d37e88cd7030f
BLAKE2b-256 checksum
How to use checksums
b95d894b59d0e513b719f57c55747ebecde5eb660ec4dc5a9940ec65f5e63472
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.4

Release files / jupygit-0.4.0-py3-none-any.whl

Download URL jupygit-0.4.0-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
439ac30e5051dc8001f1a18828d007c63e63e4f76a32168c44148a4617edbce5
BLAKE2b-256 checksum
How to use checksums
6951f4894c78e21866190160ddce2fa78c3943bb91aa308bfdb8f748c3b2a79a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.4

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.1

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page