4

When saving my jupyter Notebooks with Git, I'd like to remove:

  • Outputs (answered in https://stackoverflow.com/a/58004619/3733974)

  • ExecuteTime in metadata (code below in .ipynb)

     "metadata": {
      "ExecuteTime": {
       "end_time": "2020-07-09T11:09:35.842718Z",
       "start_time": "2020-07-09T11:09:35.837714Z"
      },
      "tags": [
       "parameters"
      ]
     }
    

I am able to remove all the metadata with --ClearMetadataPreprocessor.enabled=True but I want to remove only ExecuteTime metadata.

How to update my current command in .git/config?

[filter "strip-notebook-output"]
    clean = "jupyter nbconvert --ClearOutputPreprocessor.enabled=True --ClearMetadataPreprocessor.enabled=True --to=notebook --stdin --stdout --log-level=ERROR"

How to pass arguments to ClearMetadataPreprocessor?

mbh86
  • 4,591
  • 3
  • 14
  • 24
  • Unfortunately the ClearMetadataPreprocessor does not have any more options than to remove all the metadata. See also the pull request for this feature https://github.com/jupyter/nbconvert/pull/805 – onno Oct 23 '20 at 08:38

0 Answers0