Created
          November 3, 2018 21:37 
        
      - 
      
 - 
        
Save gjlondon/65ce0a17bb0ea472ec41ae4710e0b36b to your computer and use it in GitHub Desktop.  
    Recipe for stripping outputs before using nbdime to compare Jupyter notebooks
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | alias nbstrip_jq="jq --indent 1 \ | |
| '(.cells[] | select(has(\"outputs\")) | .outputs) = [] \ | |
| | (.cells[] | select(has(\"execution_count\")) | .execution_count) = null \ | |
| | .metadata = {\"language_info\": {\"name\": \"python\", \"pygments_lexer\": \"ipython3\"}} \ | |
| | .cells[].metadata = {} \ | |
| '" | |
| nbdime diff-web <(nbstrip_jq <1st notebook>) <(nbstrip_jq <2nd notebook>) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment