Skip to main content

pdqhash-python

These are Python bindings to the PDQ perceptual hash released by Facebook. Note that the bindings are provided under the MIT license but the PDQ source code is licensed separately under its own license (see the ThreatExchange/hashing/pdq folder).

Installation

pip install pdqhash

Usage

import pdqhash

image = cv2.imread(os.path.join('tests', 'images', image_name))
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
hash_vector, quality = pdqhash.compute(image)

# Get all the rotations and flips in one pass.
# hash_vectors is a list of vectors in the following order
# - Original
# - Rotated 90 degrees
# - Rotated 180 degrees
# - Rotated 270 degrees
# - Flipped vertically
# - Flipped horizontally
# - Rotated 90 degrees and flipped vertically
# - Rotated 90 degrees and flipped horizontally
hash_vectors, quality = pdqhash.compute_dihedral(image)

# Get the floating point values of the hash.
hash_vector_float, quality = pdqhash.compute_float(image)

Contributing

  • Set up local development using make init (you need to have pipenv installed)
  • Run tests using make test
  • Run tests in Docker using make docker_test

Metadata

Release files for pdqhash 0.2.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pdqhash 0.2.8
File Size Uploaded Provenance Actions
pdqhash-0.2.8.tar.gz 696.7 kB Without provenance Details for pdqhash-0.2.8.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pdqhash 0.2.8
File Actions
pdqhash-0.2.8-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for pdqhash-0.2.8-cp313-cp313-win_amd64.whl
pdqhash-0.2.8-cp313-cp313-macosx_10_13_universal2.whl CPython 3.13 CPython 3.13 macOS 10.13+ universal2 (ARM64, x86-64) Details for pdqhash-0.2.8-cp313-cp313-macosx_10_13_universal2.whl
pdqhash-0.2.8-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for pdqhash-0.2.8-cp312-cp312-win_amd64.whl
pdqhash-0.2.8-cp312-cp312-macosx_10_13_universal2.whl CPython 3.12 CPython 3.12 macOS 10.13+ universal2 (ARM64, x86-64) Details for pdqhash-0.2.8-cp312-cp312-macosx_10_13_universal2.whl
pdqhash-0.2.8-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for pdqhash-0.2.8-cp311-cp311-win_amd64.whl
pdqhash-0.2.8-cp311-cp311-macosx_10_9_universal2.whl CPython 3.11 CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) Details for pdqhash-0.2.8-cp311-cp311-macosx_10_9_universal2.whl
pdqhash-0.2.8-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for pdqhash-0.2.8-cp310-cp310-win_amd64.whl
pdqhash-0.2.8-cp310-cp310-macosx_10_9_universal2.whl CPython 3.10 CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) Details for pdqhash-0.2.8-cp310-cp310-macosx_10_9_universal2.whl

Total release size: 1.3 MB

Release files / pdqhash-0.2.8.tar.gz

Download URL pdqhash-0.2.8.tar.gz
Size 696.7 kB
Tags Source
SHA-256 checksum
How to use checksums
eb9a9de36745937ce3e481a02ce933fe907c84e0b1748c9dfea52c12ca5c1e35
BLAKE2b-256 checksum
How to use checksums
9883258f070fbe134c2bd6f20dc0a9b142842ff35bc1369a98e7df30b496177b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / pdqhash-0.2.8-cp313-cp313-win_amd64.whl

Download URL pdqhash-0.2.8-cp313-cp313-win_amd64.whl
Size 42.6 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
b3f892a767708eb63a7b3498e23582a34890a0f2a31833d28fd16c355e1f0d4d
BLAKE2b-256 checksum
How to use checksums
6cfcc67fb57a2769c24ef7bbe65cee4b579edc3d1370024216215787af57a5a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / pdqhash-0.2.8-cp313-cp313-macosx_10_13_universal2.whl

Download URL pdqhash-0.2.8-cp313-cp313-macosx_10_13_universal2.whl
Size 107.2 kB
Tags CPython 3.13 macOS 10.13+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
e7f50d8382a8850917a77232e00bc649b63db8e018423e6175842a226b01fad8
BLAKE2b-256 checksum
How to use checksums
1a849f84cb99db5d558ac0d81f6f71dc9ac8c0483a2b539ca19c63d7e3b5bec8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / pdqhash-0.2.8-cp312-cp312-win_amd64.whl

Download URL pdqhash-0.2.8-cp312-cp312-win_amd64.whl
Size 43.4 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
fe082d83432583eaf7938fade50ec14e2ecc597b648dbca3419703b7a36f07f0
BLAKE2b-256 checksum
How to use checksums
28e980bd1f68066f6ce4ae06cfdc48fe4ca454d6868b16de878cdb8fed434b04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / pdqhash-0.2.8-cp312-cp312-macosx_10_13_universal2.whl

Download URL pdqhash-0.2.8-cp312-cp312-macosx_10_13_universal2.whl
Size 108.5 kB
Tags CPython 3.12 macOS 10.13+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
13f106595b566677b0a125d96c6910fd1f1bbf2e86aae3a36ca8e0ed67ded02c
BLAKE2b-256 checksum
How to use checksums
ce768411975e8d0b5b4d7aeeedfff55101074c96d7b842377e9eb2f02181f0ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / pdqhash-0.2.8-cp311-cp311-win_amd64.whl

Download URL pdqhash-0.2.8-cp311-cp311-win_amd64.whl
Size 43.7 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
a7b3a626413bad245e3cdd815a4d644a68736982c4b9eb130b52d74dcb48f8e5
BLAKE2b-256 checksum
How to use checksums
56490257d03b2c369e196b042c8873db6a81be9c83659b29dc08dcf5533950df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / pdqhash-0.2.8-cp311-cp311-macosx_10_9_universal2.whl

Download URL pdqhash-0.2.8-cp311-cp311-macosx_10_9_universal2.whl
Size 108.3 kB
Tags CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
5459e57ae2c432429bc2ee1077cd2973a0c24d491f54777d5b4bf249bef35f48
BLAKE2b-256 checksum
How to use checksums
8fd793d9a4086118140c9679f6cce782ba1cdec48c722ca04dd620bbca980f94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / pdqhash-0.2.8-cp310-cp310-win_amd64.whl

Download URL pdqhash-0.2.8-cp310-cp310-win_amd64.whl
Size 43.6 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
fa49dfeb82b1549318bd3743ae112e4a1feb3dfeb8a6bb859d7f0cbdc5b7c0be
BLAKE2b-256 checksum
How to use checksums
3f2cfe50e4c4524bb29360d1330965ca9578a4344d3c3614148d953b7fd09f12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / pdqhash-0.2.8-cp310-cp310-macosx_10_9_universal2.whl

Download URL pdqhash-0.2.8-cp310-cp310-macosx_10_9_universal2.whl
Size 107.5 kB
Tags CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
01e615089a7a22067627e97c383e371d6db363aca9587f4080a6e43cb6228fff
BLAKE2b-256 checksum
How to use checksums
4d437b73c0e6169ba9e2ff1a6d6f3de6657a2b006a988f2e5d18a1789d0c8bbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Security for pdqhash 0.2.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page