Last active
September 17, 2015 18:41
-
-
Save basnijholt/2ed10ccc90523d10ac1d to your computer and use it in GitHub Desktop.
Take only notes from ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def isnote(cell): | |
try: | |
return cell['metadata']['slideshow'][u'slide_type'] == 'notes' | |
except KeyError: | |
return False | |
with open('Presentation.ipynb') as json_data: | |
data = json.load(json_data) | |
data['cells'] = [cell for cell in data['cells'] if isnote(cell)] | |
json.dump(data2, open('Presentation-notes.ipynb', 'w')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment