ssdeep was written by Jesse Kornblum. this is a set of python bindings for it.
the python bindings work with ssdeep 2.0-2.2.
from ssdeep import ssdeep
s = ssdeep()
# basic hash generation
for i in sys.argv[1:]:
print '%s %20s' % (i, s.hash_file(i))
h1 = s.hash_file('test.py')
h2 = s.hash_file('setup.py')
print s.compare(h1, h2)
print s.compare(h1, h1)