def pprint_data_history(doc: Doc):
    """Pretty print data history across all revisions."""
    W_NUM = 10
    ver = len(doc.data)
    hist = [{} for x in range(ver)]
    maxs = [1] * ver
    for i in range(ver):
        fd = doc.data[i].get('fdata')
        bd = doc.data[i].get('bdata')
        cut = doc.data[-i].get('eof_cut')
        _, _, _, sz = fd(None, -1)
        n = fd.__name__
        hist[i]['data_f()'] = n.split('_')[0]
        hist[i]['data_sz'] = sz
        hist[i]['add_data'] = len(bd) if bd else "None"
        hist[i]['eof_cut'] = cut if cut else "None"
    for k in 'data_f() data_sz add_data eof_cut'.split():
        line = f"{k:<{W_NUM}}"
        for i in range(ver):
            line += f"| {hist[i][k]:<{W_NUM}} "
        print(line)
    return
Pretty print data history across all revisions.
pdfsyntax/docstruct.py