Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • I am considering a workflow where I keep both .ipynb and corresponding .py automatically created using post-save hooks described above. I would like to use .py for diffs - would nbstripout be able to clear .py file from the cell execution counters (# In[1] changed to In[*]), so that they don't clutter the diffs or should I create a simple script for doing that? Commented Dec 22, 2017 at 12:09
  • 1
    @KrzysztofSłowiński No, nbstripout doesn't support this use case easily since it relies on the JSON format of the Notebook. You're likely better off writing a script specialized to your use case.
    – kynan
    Commented Aug 5, 2018 at 11:36
  • Does nbstripout have an option to work recursively on a given folder (I'm talking about the executable itself)?
    – Royi
    Commented Nov 13, 2021 at 16:54
  • Not directly, and it doesn't need to. You can simply use find or some other standard way of recursively finding files you want to operate on.
    – kynan
    Commented Nov 13, 2021 at 17:33