# ``` # extracts the git log, and define: # # - foo.all_commits = the whole git log # - foo.commits = the commits SHA-1 # - foo.all_files = all the unique file ever existed # # # In[19]: import os path = os.getcwd() # put here the desired git repo path gt = ghv.git_history(path) gt.get_history() # ### Visualize the data # # We define a pandas DataFrame to contain all the files (Rows) and the status (Columns). # # This Grid represent the status of each file at each step or commit. # # The inizial stata for all the files is `N` or `Non existent`, they are updated in the sequential reding of `git_history.all_commits` object. # ## Deserialize and structure the data # # The data gather in `githistoryvis.git_history()` object are deserialized and gathered in a pandas DataFrame by the `githistoryvis.definedatamatrix()` method.
# coding: utf-8 import githistoryvis as ghv # put here the desired git repo path import os path = os.getcwd() # define the obejct linked to your repository # essentially add the gt.path variable gt = ghv.git_history(path) # get the history : define gt.all_commits, gt.commit, gt.all_file gt.get_history() # if the git log data are in a file somewhere, # read the file in a string and pass it with open('gitoutput', 'r') as file: data = file.read() gt.get_history(gitcommitlist=data) # Here is Pandas needed # define the datamatrix : define gt.datamatrix, # a Pandas.Dataurame with categorical columns gt.definedatamatrix() # new compact version gt = ghv.git_history(path, get_history=True, definedatamatrix=True) # visualization import matplotlib from matplotlib import pyplot as plt