Pure-Python Git implementation
Switch branches/tags
upstream/0.19.8 upstream/0.19.7 upstream/0.19.6 upstream/0.19.5 upstream/0.19.4 upstream/0.19.3 upstream/0.19.1 upstream/0.19.0 upstream/0.18.5 upstream/0.18.4 upstream/0.18.3 upstream/0.18.2 upstream/0.18.1 upstream/0.18.0 upstream/0.17.3 upstream/0.17.1 upstream/0.16.3 upstream/0.16.2 upstream/0.16.1 upstream/0.16.0 upstream/0.15.0 upstream/0.14.1 upstream/0.14.0 upstream/0.13.0 upstream/0.12.0 upstream/0.11.2 upstream/0.11.1 upstream/0.10.1 upstream/0.10.1+git20150525 upstream/0.10.1+git20150425 upstream/0.10.0 upstream/0.9.8 upstream/0.9.7 upstream/0.9.6 upstream/0.9.5 upstream/0.9.1 rc-fix-pack-protocol-v2 dulwich-0.19.8 dulwich-0.19.7 dulwich-0.19.6 dulwich-0.19.5 dulwich-0.19.4 dulwich-0.19.3 dulwich-0.19.2 dulwich-0.19.1 dulwich-0.19.0 dulwich-0.18.6 dulwich-0.18.5 dulwich-0.18.4 dulwich-0.18.3 dulwich-0.18.2 dulwich-0.18.1 dulwich-0.18.0 dulwich-0.17.3 dulwich-0.17.2 dulwich-0.17.1 dulwich-0.17.0 dulwich-0.16.3 dulwich-0.16.2 dulwich-0.16.1 dulwich-0.16.0 dulwich-0.15.0 dulwich-0.14.1 dulwich-0.14.0 dulwich-0.13.0 dulwich-0.12.0 dulwich-0.11.1 dulwich-0.11.0 dulwich-0.10.1 dulwich-0.10.0 dulwich-0.9.10 dulwich-0.9.9 dulwich-0.9.8 dulwich-0.9.7 dulwich-0.9.6 dulwich-0.9.5 dulwich-0.9.4 dulwich-0.9.3 dulwich-0.9.2 dulwich-0.9.1 dulwich-0.9.0 dulwich-0.8.7 dulwich-0.8.6 dulwich-0.8.5 dulwich-0.8.4 dulwich-0.8.3 dulwich-0.8.2 dulwich-0.8.1 dulwich-0.8.0 dulwich-0.7.1 dulwich-0.7.0 dulwich-0.6.2 dulwich-0.6.1 dulwich-0.6.0 dulwich-0.5.0 dulwich-0.4.1 dulwich-0.4.0 dulwich-0.3.3 dulwich-0.3.2 dulwich-0.3.1
Nothing to show
Clone or download
Failed to load latest commit information.
bin Pass through deepen flag. Nov 4, 2018
devscripts Add script for updating preamble. Sep 17, 2016
docs Fix the tutorial tests on python3. Fixes: #573 Apr 12, 2018
dulwich Add basic server side implementation of 'git-upload-archive'. Nov 14, 2018
examples Add example for using memoryrepo. Jun 3, 2018
.coveragerc Set source in coveragerc rather than passing on command-line. May 7, 2018
.gitignore Ignore .pyo files. Mar 25, 2018
.mailmap Update mailmap. Mar 17, 2018
.testr.conf testr: Allow id list files (fixes parallel runs). Dec 19, 2010
.travis.yml Drop support for Python 3 < 3.4. This is because pkg_resources (which… Nov 4, 2018
AUTHORS Update AUTHORS. Aug 11, 2018
CONTRIBUTING.md Reformat to 80 columns. Jan 7, 2018
COPYING As agreed by all contributors, change the license from: Aug 7, 2016
MANIFEST.in Update MANIFEST.in. Jan 15, 2017
Makefile Move flake8 configuration to setup.cfg. Nov 10, 2018
NEWS Add basic server side implementation of 'git-upload-archive'. Nov 14, 2018
README.md Update README; python 3.3 is no longer supported. Nov 5, 2018
README.swift.md Fix typo Sep 21, 2017
TODO Update TODO. Jan 7, 2018
appveyor.yml Drop support for Python 3 < 3.4. This is because pkg_resources (which… Nov 4, 2018
build.cmd Attempt to fix 64 bit builds on Windows. May 1, 2017
dulwich.cfg Change homepage to www.dulwich.io. Jul 27, 2015
requirements.txt Enable SSL verification for `urllib3` Jan 29, 2018
setup.cfg Move flake8 configuration to setup.cfg. Nov 10, 2018
setup.py Fix setup.py: Nov 6, 2018
tox.ini Run tests on Python3.3. Mar 20, 2017


Build Status Windows Build status

This is the Dulwich project.

It aims to provide an interface to git repos (both local and remote) that doesn't call out to git directly but instead uses pure Python.

Main website: www.dulwich.io

License: Apache License, version 2 or GNU General Public License, version 2 or later.

The project is named after the part of London that Mr. and Mrs. Git live in in the particular Monty Python sketch.


By default, Dulwich' setup.py will attempt to build and install the optional C extensions. The reason for this is that they significantly improve the performance since some low-level operations that are executed often are much slower in CPython.

If you don't want to install the C bindings, specify the --pure argument to setup.py::

$ python setup.py --pure install

or if you are installing from pip::

$ pip install dulwich --global-option="--pure"

Note that you can also specify --global-option in a requirements.txt file, e.g. like this::

dulwich --global-option=--pure

Getting started

Dulwich comes with both a lower-level API and higher-level plumbing ("porcelain").

For example, to use the lower level API to access the commit message of the last commit:

>>> from dulwich.repo import Repo
>>> r = Repo('.')
>>> r.head()
>>> c = r[r.head()]
>>> c
<Commit 015fc1267258458901a94d228e39f0a378370466>
>>> c.message
'Add note about encoding.\n'

And to print it using porcelain:

>>> from dulwich import porcelain
>>> porcelain.log('.', max_entries=1)
commit: 57fbe010446356833a6ad1600059d80b1e731e15
Author: Jelmer Vernooij <jelmer@jelmer.uk>
Date:   Sat Apr 29 2017 23:57:34 +0000

Add note about encoding.

Further documentation

The dulwich documentation can be found in docs/ and on the web.

The API reference can be generated using pydoctor, by running "make pydoctor", or on the web.


There is a #dulwich IRC channel on the Freenode, and dulwich-announce and dulwich-discuss mailing lists.


For a full list of contributors, see the git logs or AUTHORS.

If you'd like to contribute to Dulwich, see the CONTRIBUTING file and list of open issues.

Supported versions of Python

At the moment, Dulwich supports (and is tested on) CPython 2.7, 3.4, 3.5, 3.6 and Pypy.