skillfed

polars-hash

Stable non-cryptographic and cryptographic hashing functions for Polars

polars-hash v0.9.1 413.7K downloads/30d#6,839 on PyPI93
License unclear Active released

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-hash

uv

uv add polars-hash

poetry

poetry add polars-hash

Installing 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

Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyProgramming Language :: Rust

Tags

polars hashing functionscryptographic hash polarsgeohash spatial indexfarmhash cityash polarsdataframe row hashingtime window hashingh3 spatial indexing
polars-plugingeospatial-hashingdata-integrity

More Cryptography packages