def hours_estimate(self, branch='master', grouping_window=0.5, single_commit_hours=0.5, limit=None, days=None, committer=True, by=None, ignore_globs=None, include_globs=None):
        """
        inspired by: https://github.com/kimmobrunfeldt/git-hours/blob/8aaeee237cb9d9028e7a2592a25ad8468b1f45e4/index.js#L114-L143

        Iterates through the commit history of repo to estimate the time commitement of each author or committer over
        the course of time indicated by limit/extensions/days/etc.

        :param branch: the branch to return commits for
        :param limit: (optional, default=None) a maximum number of commits to return, None for no limit
        :param grouping_window: (optional, default=0.5 hours) the threhold for how close two commits need to be to consider them part of one coding session
        :param single_commit_hours: (optional, default 0.5 hours) the time range to associate with one single commit
        :param days: (optional, default=None) number of days to return, if limit is None
        :param committer: (optional, default=True) whether to use committer vs. author
        :param ignore_globs: (optional, default=None) a list of globs to ignore, default none excludes nothing
        :param include_globs: (optinal, default=None) a list of globs to include, default of None includes everything.
        :return: DataFrame
        """

        if limit is not None:
            limit = int(limit / len(self.repo_dirs))

        if committer:
            com = 'committer'
        else:
            com = 'author'

        df = pd.DataFrame(columns=[com, 'hours', 'repository'])

        for repo in self.repos:
            try:
                ch = repo.hours_estimate(
                    branch,
                    grouping_window=grouping_window,
                    single_commit_hours=single_commit_hours,
                    limit=limit,
                    days=days,
                    committer=committer,
                    ignore_globs=ignore_globs,
                    include_globs=include_globs
                )
                ch['repository'] = repo.repo_name
                df = df.append(ch)
            except GitCommandError:
                print('Warning! Repo: %s seems to not have the branch: %s' % (repo, branch))

        df.reset_index()

        if by == 'committer' or by == 'author':
            df = df.groupby(com).agg({'hours': sum})
            df = df.reset_index()
        elif by == 'repository':
            df = df.groupby('repository').agg({'hours': sum})
            df = df.reset_index()

        return df
def hours_estimate ( self , branch = 'master' , grouping_window = 0.5 , single_commit_hours = 0.5 , limit = None , days = None , committer = True , by = None , ignore_globs = None , include_globs = None ) : if limit is not None : limit = int ( limit / len ( self . repo_dirs ) ) if committer : com = 'committer' else : com = 'author' df = pd . DataFrame ( columns = [ com , 'hours' , 'repository' ] ) for repo in self . repos : try : ch = repo . hours_estimate ( branch , grouping_window = grouping_window , single_commit_hours = single_commit_hours , limit = limit , days = days , committer = committer , ignore_globs = ignore_globs , include_globs = include_globs ) ch [ 'repository' ] = repo . repo_name df = df . append ( ch ) except GitCommandError : print ( 'Warning! Repo: %s seems to not have the branch: %s' % ( repo , branch ) ) df . reset_index ( ) if by == 'committer' or by == 'author' : df = df . groupby ( com ) . agg ( { 'hours' : sum } ) df = df . reset_index ( ) elif by == 'repository' : df = df . groupby ( 'repository' ) . agg ( { 'hours' : sum } ) df = df . reset_index ( ) return df
inspired by: https://github.com/kimmobrunfeldt/git-hours/blob/8aaeee237cb9d9028e7a2592a25ad8468b1f45e4/index.js#L114-L143

        Iterates through the commit history of repo to estimate the time commitement of each author or committer over
        the course of time indicated by limit/extensions/days/etc.

        :param branch: the branch to return commits for
        :param limit: (optional, default=None) a maximum number of commits to return, None for no limit
        :param grouping_window: (optional, default=0.5 hours) the threhold for how close two commits need to be to consider them part of one coding session
        :param single_commit_hours: (optional, default 0.5 hours) the time range to associate with one single commit
        :param days: (optional, default=None) number of days to return, if limit is None
        :param committer: (optional, default=True) whether to use committer vs. author
        :param ignore_globs: (optional, default=None) a list of globs to ignore, default none excludes nothing
        :param include_globs: (optinal, default=None) a list of globs to include, default of None includes everything.
        :return: DataFrame