skeletonize

Handles skeletonization and deskeletonization of python code.


License
Apache-2.0
Install
pip install skeletonize==2.8

Documentation

skeletonize

Handles skeletonization and deskeletonizaiton of programs. This allows for easily distributing assignments to students that contain skeleton code, and determining which parts of the skeleton they filled in after the fact, extracting blanks.

skeletonization

Skeletonization works by taking in a piece of code with "skeleton markers" as so:

def factorial(x):
    if <<<x == 0>>>:
        return <<<1>>>
    else:
        return <<<x>>> * <<<factorial(x - 1)>>>

and converting it into either a skeleton

def factorial(x):
    if ______:
        return ______
    else:
        return ______ * ______

or a solution

def factorial(x):
    if x == 0:
        return 1
    else:
        return x * factorial(x - 1)

reskeletonization

Reskeletonization works by taking a skeleton:

def factorial(x):
    if <<<x == 0>>>:
        return <<<1>>>
    else:
        return <<<x>>> * <<<factorial(x - 1)>>>

and a student solution:

def factorial(x):
    if not x:
        return 1
    else:
        return x * factorial(x)

and produces a reskeletonized program

def factorial(x):
    if <<<not x>>>:
        return <<<1>>>
    else:
        return <<<x>>> * <<<factorial(x)>>>