{"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,"search_vec":"'0.5.6':20 'algorithm':22 'cryptograph':11,13 'datafram':18,49 'direct':36 'express':39 'farmhash':26,52 'frequent':45 'function':15 'h3':31 'hash':3,14,41,47 'index':33 'integr':35 'librari':6 'like':23 'maintain':43 'murmurhash':51 'murmurhash3':25 'non':10 'non-cryptograph':9 'polar':2,17,38,48 'polars-hash':1 'prefix':42 'provid':7 'python':5 'releas':46 'sha3':27,54 'shake128':28 'spatial':32 'stabl':8 'support':21 'uuid5':29,53 'version':19 'via':40 'xxhash':24,50","created_at":"2026-05-01T08:12:06.426131+00:00","updated_at":"2026-05-01T08:12:06.426131+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.6.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/ion-elgreco/polars-hash","docs":null,"changelog":null,"pypi":"https://pypi.org/project/polars-hash/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}