Python progress bar for PyGithub clone function

How can I see the progress of a cloning process? tqdm module does not work for single line statements. Is there a git argument that I should add? Any references would help. Thanks.

import git

#clone to local system
git.Repo.clone_from(repo_url,path, branch='master')

Answers

The GitPython source code includes:

def clone_from(cls, url, to_path, progress=None, env=None, multi_options=None, **kwargs):

with progress defined in git.remote.Remote.push

:param progress:
    Can take one of many value types:
        * None to discard progress information
        * A function (callable) that is called with the progress information.
          Signature: ``progress(op_code, cur_count, max_count=None, message='')``.
        * An instance of a class derived from ``git.RemoteProgress`` that
          overrides the ``update()`` function.

You can see an example of a progress function here or here.

Posted on by VonC