{"id":24254,"library":"polars-hash","title":"polars-hash","description":"A Python library providing stable non-cryptographic and cryptographic hashing functions for Polars DataFrames. Version 0.5.6 supports algorithms like xxhash, murmurhash3, farmhash, SHA3 SHAKE128, UUID5, and H3 spatial index. It integrates directly into Polars expressions via `hash_` prefix. Maintained, with frequent releases.","status":"active","version":"0.5.6","language":"python","source_language":"en","source_url":"https://github.com/ion-elgreco/polars-hash","tags":["hashing","polars","dataframe","xxhash","murmurhash","farmhash","uuid5","sha3"],"install":[{"cmd":"pip install polars-hash","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core dependency; library provides Polars expressions.","package":"polars","optional":false}],"imports":[{"note":"No direct import of hash functions; use `polars_hash.hash_xxh3(...)`.","wrong":"","symbol":"hash_xxh3","correct":"import polars_hash"},{"note":"Access via `polars_hash.hash_murmurhash3(...)`.","wrong":"","symbol":"hash_murmurhash3","correct":"import polars_hash"},{"note":"Access via `polars_hash.hash_farmhash(...)`.","wrong":"","symbol":"hash_farmhash","correct":"import polars_hash"}],"quickstart":{"code":"import polars as pl\nimport polars_hash\n\ndf = pl.DataFrame({'text': ['hello', 'world']})\ndf_with_hash = df.with_columns(\n    polars_hash.hash_xxh3('text').alias('hash_xxh3'),\n    polars_hash.hash_murmurhash3('text').alias('hash_murmur')\n)\nprint(df_with_hash)","lang":"python","description":"Create a Polars DataFrame and add XXH3 and MurmurHash3 hash columns."},"warnings":[{"fix":"Upgrade Polars to >=1.32.0, or pin polars-hash to <0.5.0.","message":"Version 0.5.0 bumped Polars dependency to >=1.32.0. Older code using Polars <1.32.0 will fail to import.","severity":"breaking","affected_versions":">=0.5.0"},{"fix":"Upgrade to >=0.4.9 and remove any use of `polars.type_aliases`.","message":"Prior to 0.4.9, the library used `polars.type_aliases` which is deprecated. Old custom serialisation or alias-dependent code may break.","severity":"deprecated","affected_versions":"<0.4.9"},{"fix":"Cast results explicitly: `.cast(pl.UInt64)` or `.cast(pl.Utf8)` as needed.","message":"Hash functions return columns of type `UInt64` for non-cryptographic hashes and `Utf8` for cryptographic/special hashes (e.g., UUID5, SHA3). Mixing may cause type errors in expressions.","severity":"gotcha","affected_versions":"all"},{"fix":"Provide a valid namespace: `polars_hash.hash_uuid5('namespace_uuid', 'text')`.","message":"The `hash_uuid5` function requires a namespace UUID as first argument; omitting it will raise a `TypeError`.","severity":"gotcha","affected_versions":">=0.5.6"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Upgrade to >=0.5.2: `pip install polars-hash>=0.5.2`.","cause":"Older version of polars-hash does not include xxh3 (added in 0.5.2).","error":"AttributeError: module 'polars_hash' has no attribute 'hash_xxh3'"},{"fix":"Use `polars_hash.hash_xxh3(...)` directly without importing the function. Correct usage: `import polars_hash; polars_hash.hash_xxh3(...)`.","cause":"Trying to import individual functions incorrectly. The library does not export function names at package level.","error":"ImportError: cannot import name 'hash_xxh3' from 'polars_hash'"},{"fix":"Provide a UUID string: `polars_hash.hash_uuid5('6ba7b810-9dad-11d1-80b4-00c04fd430c8', 'text')`.","cause":"hash_uuid5 requires a namespace UUID as first argument.","error":"TypeError: hash_uuid5() missing 1 required positional argument: 'namespace_uuid'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}