Skip to content

Instantly share code, notes, and snippets.

@michaeldorner
Created May 10, 2022 09:27
Show Gist options
  • Save michaeldorner/8bac48a4592d99438ecf366889fd1ee0 to your computer and use it in GitHub Desktop.
Save michaeldorner/8bac48a4592d99438ecf366889fd1ee0 to your computer and use it in GitHub Desktop.
def count_ipynb_loc(ipynb_file):
with open(ipynb_file) as file:
content = json.load(file)
cells = content['cells']
loc = sum(len(c['source']) for c in cells if c['cell_type'] == 'code')
return loc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment