Skip to content

wise-toddler/ipynb-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jupyter Notebook Management Tools

Two simple Python tools for extracting and appending content to Jupyter notebooks.

🛠️ Tools

1. notebook_extractor.py

What it does: Extracts content from Jupyter notebooks and saves it to JSON files

Features:

  • Extracts code blocks and markdown blocks
  • Maintains cell order and execution counts
  • Captures outputs and errors
  • Saves in clean JSON format

Usage:

python notebook_extractor.py notebook.ipynb output.json

Example:

python notebook_extractor.py my_notebook.ipynb extracted_content.json

2. simple_notebook_appender.py

What it does: Loads JSON blocks and appends them to notebooks, then executes them

Features:

  • Loads blocks from JSON files
  • Appends to existing notebooks or creates new ones
  • Creates automatic backups
  • Executes newly added code cells

Usage:

python simple_notebook_appender.py

(Uses default files: NN_EDA.ipynb and example_blocks.json)

📋 JSON Format

The JSON file follows this structure:

[
  {
    "type": "md",
    "md": "# Your markdown content here"
  },
  {
    "type": "code", 
    "code": "print('Your Python code here')"
  }
]

🚀 Quick Start

# 1. Extract content from notebook
python notebook_extractor.py my_notebook.ipynb blocks.json

# 2. Add blocks to notebook
python simple_notebook_appender.py

💡 Use Cases

  • Backup: Save notebook content as JSON backup
  • Templates: Reuse common code blocks across notebooks
  • Automation: Programmatically manage notebook content
  • Version Control: Track notebook changes more easily

Simple tools for Jupyter notebook content management! 🎯

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages