polars-hash
Stable non-cryptographic and cryptographic hashing functions for Polars
What it is and what it does
Polars-hash is a Rust-backed Polars plugin that extends DataFrames with a comprehensive set of hashing operations. It provides cryptographic hashers (SHA256), fast non-cryptographic hashers (FarmHash, CityHash, WyHash, GxHash), geospatial hashing (geohash and H3 spatial indexing), and time-window hashing that bins timestamps into variable-precision sliding windows. The plugin is designed to maintain stable hashing across different Polars versions, so the same input always produces the same hash output.
You use it by importing polars_hash alongside Polars and calling hash methods on column expressions—either on individual columns, concatenated strings, or entire rows. The row-hashing mode is particularly useful because it produces a unique hash for each row regardless of column type or storage format, treating semantic values rather than raw bytes. The plugin handles struct types for geographic coordinates and supports precision control for time-based hashing.
Use it for:
- Hash entire DataFrame rows to create unique identifiers for deduplication or join operations across heterogeneous column types
- Compute geohashes or H3 spatial indices from latitude/longitude pairs for geographic clustering or spatial queries
- Generate SHA256 hashes of string columns for cryptographic integrity checks or secure data linkage
- Bin timestamps into variable-precision time windows so rows falling in the same window share a hash for temporal aggregation
- Apply fast non-cryptographic hashes (FarmHash, WyHash) to columns for bucketing or partitioning in data pipelines
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Polars-hash adds cryptographic and non-cryptographic hashing functions to Polars DataFrames, including SHA256, FarmHash, CityHash, GxHash, geohashing, H3 spatial indexing, and time-window hashing.
Yes, if you need hashing operations in Polars workflows. The package is actively maintained, has no known vulnerabilities, and offers a broad range of hashing algorithms not built into Polars itself. However, verify the license terms before use in proprietary contexts, and confirm that the AES-instruction requirement for GxHash does not conflict with your deployment targets.
Install
polars-hash on PyPI
pip
pip install polars-hashuv
uv add polars-hashpoetry
poetry add polars-hashInstalling polars-hash
Before you install
Medium install friction due to compiled wheels for multiple platforms (x86_64, ARM, i686, Windows). Requires Python 3.10+. Active maintenance with recent release (11 days ago) and 93 repository stars.
License in practice
License treatment is unclear—no SPDX identifier or raw license text provided. Verify the license terms before use in proprietary or restricted contexts.
Quickstart
import polars as pl
import polars_hash as plh
df = pl.DataFrame({"foo": ["hello_world"]})
result = df.select(plh.col('foo').chash.sha256())
Requires Python 3.10 or later. GxHash expressions require a CPU with AES instructions; no software fallback available.
Verify before relying
- Whether the unclear license permits commercial or proprietary use without restriction
- Performance characteristics and memory overhead compared to native Polars operations
- Stability guarantees across future Polars versions beyond what 'stable hashing' claims
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — polars |
| Maintenance | actively maintained — 11 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 413,668/month — #6,839 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: polars_hash-0.9.1-cp310-abi3-macosx_10_12_x86_64.whl; polars_hash-0.9.1-cp310-abi3-macosx_11_0_arm64.whl; polars_hash-0.9.1-cp310-abi3-manylinux_2_12_i686.manylinux2010_i686.whl; polars_hash-0.9.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; polars_hash-0.9.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; polars_hash-0.9.1-cp310-abi3-win32.whl; polars_hash-0.9.1-cp310-abi3-win_amd64.whl
Tags
More Cryptography packages
Certifi provides Mozilla's curated collection…
copyleft · top 100 on PyPI
cryptographycryptography provides cryptographic recipes and…
permissive · top 100 on PyPI
rsaPure-Python RSA encryption, decryption,…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
azure-identityProvides Microsoft Entra ID token-based…
unclear · top 1,000 on PyPI
PyNaClPyNaCl provides Python bindings to libsodium…
permissive · top 1,000 on PyPI
dict-hashGenerates consistent hashes for Python…
permissive · top 15,000 on PyPI
polars-dsPolars-ds adds data science and machine…
permissive · top 15,000 on PyPI
cityhashPython wrapper for Google's CityHash and…
permissive · top 15,000 on PyPI
pyfarmhashProvides Python bindings to Google's FarmHash,…
permissive · top 15,000 on PyPI
pygeohashEncodes latitude/longitude coordinates to…
permissive · top 5,000 on PyPI
polarsPolars is a DataFrame query engine written in…
permissive · top 1,000 on PyPI
polars-lts-cpupolars-lts-cpu is a CPU-optimized DataFrame…
permissive · top 15,000 on PyPI
polars-runtime-compatPolars-runtime-compat provides binary wheels…
permissive · top 15,000 on PyPI
polars-olsPolars OLS provides Rust-optimized linear…
unclear · top 15,000 on PyPI
borsh-constructImplements the Borsh binary serialization…
permissive · top 15,000 on PyPI