skillfed

pyfarmhash

Google FarmHash Bindings for Python

pyfarmhash v0.4.0 644.3K downloads/30d#5,601 on PyPI39
Permissive license Active released

What it is and what it does

pyfarmhash wraps Google's FarmHash algorithm, a non-cryptographic hash function optimized for speed and distribution quality. It exposes hash64 and hash64withseed functions that take strings or bytes and return 64-bit hash values, plus fingerprint functions. The package is a thin binding layer with no runtime dependencies, making it lightweight for applications that need fast hashing for indexing, deduplication, or data structures rather than security.

The package is maintained and supports Python versions from 2.6 through 3.11. Installation requires a C++ compiler on most platforms, though Windows binary wheels are available. The API is minimal and straightforward: import the module and call the hash functions directly.

Use it for:

  • Hash table and data structure construction where speed matters more than cryptographic strength
  • Deduplication of large datasets by computing fast fingerprints of records
  • Distributed systems needing consistent, fast hashing across nodes for load balancing or sharding
  • Bloom filters and probabilistic data structures that require many hash computations per item

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides Python bindings to Google's FarmHash, a fast non-cryptographic hash function for computing 64-bit and fingerprint hashes of strings and byte sequences.

Yes, if you need fast non-cryptographic hashing and can handle the C++ compilation step. The package is actively maintained, has no known vulnerabilities, and carries a permissive license. Install friction is moderate but manageable; Windows users benefit from prebuilt wheels. Not suitable if you need cryptographic hashing or cannot compile C++ extensions in your environment.

Install

pyfarmhash on PyPI

pip

pip install pyfarmhash

uv

uv add pyfarmhash

poetry

poetry add pyfarmhash

Installing pyfarmhash

Before you install

Medium install friction due to compiled C++ extension requiring a compiler (g++ on Linux, Visual C++ on Windows). Repository is actively maintained with last commit on 2026-03-06, though the package last released 717 days ago.

License in practice

MIT license (permissive) means you can use, modify, and distribute this package freely with minimal restrictions, provided you include the license notice.

Quickstart

pip install pyfarmhash

import pyfarmhash
print(pyfarmhash.hash64('abc'))
print(pyfarmhash.hash64withseed('abc', 12345))

Requires a C++ compiler (g++ on Linux; Visual C++ on Windows) to build the extension from source. Windows binary wheels are available on PyPI for some Python versions.

Verify before relying

  • Whether prebuilt wheels are available for all advertised Python versions or only a subset
  • Current performance characteristics compared to other non-cryptographic hash libraries
  • Whether the fingerprint function bindings mentioned in the description are fully exposed in the public API

Package facts

License not declared (permissive)
Python support not specified
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance actively maintained — 717 days since the last release
Last repo commit
First released
Downloads 644,312/month — #5,601 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyfarmhash-0.4.0-cp310-cp310-win_amd64.whl

Keywords: farmhash, google

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: CProgramming Language :: PythonProgramming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

fast non-cryptographic hashingfarmhash python bindingsgoogle farmhash64-bit hash functionfingerprint hashingstring hashing library
hashingc-extension

More Software Development packages