nbstripout icon indicating copy to clipboard operation
nbstripout copied to clipboard

please add -r flag

Open AndrewLouw opened this issue 4 years ago • 8 comments

It'd be a nice feature to clear outputs recursively in a folder instead of listing all the files when doing this manually Thanks

AndrewLouw avatar Jun 08 '20 12:06 AndrewLouw

You can the really easily by just recursively finding all the files you want and pass them to nbstripout:

find . -name *.ipynb -exec nbstripout {} +

I'd prefer to leave functionality for selecting input out of nbstripout.

kynan avatar Jun 27 '20 19:06 kynan

@AndrewLouw Is that sufficient for your use case? Can we close this?

kynan avatar Apr 11 '21 23:04 kynan

I mean, it works, but I'd still recommend a -r flag to have it built in. There are lots of people out there that don't feel comfortable chaining command line programs together and I don't imagine it'd be a hard feature to add. But it's your project and if you'd rather keep it as a one in one out tool then that's fine with me.

AndrewLouw avatar Apr 11 '21 23:04 AndrewLouw

nbstripout is not a one-in-one-out tool: you can already specify any number of notebooks on the command line.

Adding a flag for searching directories recursively may sound simple, but it opens up a whole host of other issues nbstripout may need to deal with: what if the next persona wants to exclude certain subdirectories or certain file patterns? I don't want to re-implement functionality for which there are better tools (and find is a much better tool to find files in a particular directory).

If you (or someone else) feels strongly about this feature and wants to implement it I'll happily accept a PR.

For now I feel there are good enough workarounds to make this not a high priority feature. I'll add it to the backlog.

kynan avatar Apr 12 '21 19:04 kynan