Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tools/clean.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python

import nbformat
from execnb.nbio import read_nb
from nbdev.export import *
from nbdev.clean import *
from fastcore.all import *
Expand Down Expand Up @@ -29,6 +30,8 @@ def proc_all(
path:str='.', # Path for source NBs
dest_path:str='clean'): # Path for dest NBs
path,dest_path = Path(path),Path(dest_path)
if not dest_path.is_dir():
dest_path.mkdir()
fns = [f for f in path.iterdir() if f.suffix == '.ipynb' and not f.name.startswith('_')]
for fn in fns: proc_nb(fn, dest=dest_path)