Skip to content

A tool to create seperate exercise/solution files from a single .ipynb input notebook.

Notifications You must be signed in to change notification settings

mueller91/IPYNB_Exercise_creator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ipynb Exercise Creator

When you use ipynb notebooks for lectures and exercises, you might want to have a single notebook file from which you can easily compile both the training notebook, as well as the solution.

This script presents a way to create these:

./make_notebook.py -f example/example.ipynb

This will create example_exercise.ipynb as well as example_solution.ipynb.

Usage

You can mark a cell (either markdown or code) to be included either in the exercise, solution, or both. To be included only in the exercise, start the cell with #!!exercise, and solution cells with #!!solution. Cells without such markers will be included in both output files. See the folder example for a working example.

Help

usage: make_notebook.py [-h] -f FILENAME [-e OUT_EXERCISE] [-s OUT_SOLUTION] [--token_exercise TOKEN_EXERCISE] [--token_solution TOKEN_SOLUTION]

optional arguments:
  -h, --help            show this help message and exit
  -f FILENAME, --filename FILENAME
                        The input .ipynb file.
  -e OUT_EXERCISE, --out_exercise OUT_EXERCISE
                        Optional, where to write output exercise to.
  -s OUT_SOLUTION, --out_solution OUT_SOLUTION
                        Optional, where to write output solution to.
  --token_exercise TOKEN_EXERCISE
                        Optional, use another token to mark exercise cells in the ipynb file.
  --token_solution TOKEN_SOLUTION
                        Optional, use another token to mark solution cells in the ipynb file.

About

A tool to create seperate exercise/solution files from a single .ipynb input notebook.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published