Skip to main content

Python bindings for the pHash (perceptual hashing) library.

Project description

pHashPy

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.

Features

Working:

  • Video hashing
  • Image hashing (dct & mh)

Missing:

  • Audio
  • Text

Usage

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 quay.io/pypa/manylinux2014_x86_64):

cd

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 http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
yum install -y ffmpeg-devel

git clone https://github.com/dries007/pHashPy.git
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
cmake3 .. -DCMAKE_BUILD_TYPE=Release -DWITH_VIDEO_HASH=1 -DWITH_AUDIO_HASH=1
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.

Source Distribution

pHashPy-0.1.2.tar.gz (1.3 MB view details)

Uploaded Source

Built Distributions

pHashPy-0.1.2-cp38-cp38-manylinux2014_x86_64.whl (13.2 MB view details)

Uploaded CPython 3.8

pHashPy-0.1.2-cp37-cp37m-manylinux2014_x86_64.whl (13.2 MB view details)

Uploaded CPython 3.7m

pHashPy-0.1.2-cp36-cp36m-manylinux2014_x86_64.whl (13.2 MB view details)

Uploaded CPython 3.6m

File details

Details for the file pHashPy-0.1.2.tar.gz.

File metadata

  • Download URL: pHashPy-0.1.2.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for pHashPy-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9a292f213daf5b9fecd13e600c7e21bc088c1f6255ad4261fc424eab9c3ced6e
MD5 ac30fd8c50c67b818c263d682eed0af9
BLAKE2b-256 7fc0c4e328cf393faf757d8e27e234b83ab6caf3362f0a05b5ebf591a70bc4e4

See more details on using hashes here.

File details

Details for the file pHashPy-0.1.2-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

  • Download URL: pHashPy-0.1.2-cp38-cp38-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 13.2 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for pHashPy-0.1.2-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ed0465f304c433105902c2a1e40ac25719c548b298efbe304f752f118ab88d1d
MD5 44d9292ef4e4352d7079ff5a26e0eee9
BLAKE2b-256 9bf39a1a0d959b0f18948470540acf799664c3fdf2255f8fca0319d9736575bf

See more details on using hashes here.

File details

Details for the file pHashPy-0.1.2-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: pHashPy-0.1.2-cp37-cp37m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 13.2 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for pHashPy-0.1.2-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 16107f4e1b41a27d3c0b848f5546ca5d1bcb880981572b43c96b32a8289b9230
MD5 dd637c19c16ee03a51e3ba7d4979759d
BLAKE2b-256 b6a3edf36b738fb153b2daed54fbfe9b25ac11db00825ee56eb2e9402553d3e4

See more details on using hashes here.

File details

Details for the file pHashPy-0.1.2-cp36-cp36m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: pHashPy-0.1.2-cp36-cp36m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 13.2 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for pHashPy-0.1.2-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 44bbb9be6293fa0508feab085f926e62863f080a2e174c8ad05dab206663a337
MD5 6d3993304ad84d6d91d238806b3e9471
BLAKE2b-256 484555e0eaa587e75cacb48ef45996203c3325d6b0fdcf1ed9144dcb9959d042

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page