pyfarmhash
Google FarmHash Bindings for Python
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 pyfarmhashuv
uv add pyfarmhashpoetry
poetry add pyfarmhashInstalling 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
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
cityhashPython wrapper for Google's CityHash and…
permissive · top 15,000 on PyPI
types-pyfarmhashProvides type hints for the pyfarmhash hashing…
permissive · top 15,000 on PyPI
mmhash3mmhash3 is a Python wrapper for MurmurHash3,…
permissive · top 15,000 on PyPI
bbhashBuilds minimal perfect hash functions for…
unclear · top 15,000 on PyPI
clickhouse-cityhashProvides Python bindings to CityHash, a fast…
permissive · top 15,000 on PyPI
xxhashxxhash provides fast non-cryptographic hashing…
permissive · top 1,000 on PyPI
murmurhashProvides fast MurmurHash2 hashing through…
permissive · top 1,000 on PyPI
polars-hashPolars-hash adds cryptographic and…
unclear · top 15,000 on PyPI
mmh3mmh3 is a Python binding to MurmurHash3, a fast…
permissive · top 1,000 on PyPI
py-multihashEncodes and decodes multihash digests,…
permissive · top 15,000 on PyPI