Skip to main content

Python bindings for the pHash (perceptual hashing) library.

Project description


Python bindings for the pHash (perceptual hashing) library.

Copyright (c) Dries007 2020.
Licensed under GPLv3 (or later), as is pHash itself.

The project uses cppyy to create a small wrapper around pHash functions.



  • Video hashing
  • Image hashing (dct & mh)


  • Audio
  • Text


As a Command Line Tool

You can use the tool as a command line utility to generate a list of hashes from a list of files.

Run python -m pHashPy --help for more info.

As a Library

Import functions from the package's __init__, this will automatically load the required library files. If you import the functions from the individual py files, you must call helper.init yourself.

Background Info

For more info on pHash:

Testing build manually

Using CentOS 7 (with docker container


yum install -y cmake3 libpng-devel libjpeg-turbo-devel libsamplerate-devel libsndfile-devel libtiff-devel libvdpau-devel libvorbis-devel
yum install -y epel-release

rpm -v --import
rpm -Uvh
yum install -y ffmpeg-devel

git clone
cd pHashPy
git submodule init
git submodule update

cd pHash

echo "include_directories(/usr/include/ffmpeg)" >> CMakeLists.txt
sed -i s/SHARED/STATIC/g CMakeLists.txt

mkdir build
cd build
make -j

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pHashPy, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size pHashPy-0.1.2-cp36-cp36m-manylinux2014_x86_64.whl (13.2 MB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size pHashPy-0.1.2-cp37-cp37m-manylinux2014_x86_64.whl (13.2 MB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size pHashPy-0.1.2-cp38-cp38-manylinux2014_x86_64.whl (13.2 MB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size pHashPy-0.1.2.tar.gz (1.3 MB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page