Dulwich is a Python implementation of the Git file formats and protocols. It aims to give an interface to git repos (both local and remote) that doesn't call out to git directly but instead uses pure Python.