Skip to main content

Stable non-cryptographic and cryptographic hashing functions for Polars

Project description

This plugin provides stable hashing functionality across different polars versions.

Examples

Cryptographic Hashers

import polars
import polars_hash as plh

df = pl.DataFrame({
    "foo":["hello_world"]
})

result = df.select(plh.col('foo').chash.sha256())

print(result)

┌──────────────────────────────────────────────────────────────────┐
 foo                                                              
 ---                                                              
 str                                                              
╞══════════════════════════════════════════════════════════════════╡
 35072c1ae546350e0bfa7ab11d49dc6f129e72ccd57ec7eb671225bbd197c8f1 
└──────────────────────────────────────────────────────────────────┘

Non-cryptographic Hashers

df = pl.DataFrame({
    "foo":["hello_world"]
})

result = df.select(plh.col('foo').nchash.wyhash())
print(result)
┌──────────────────────┐
 foo                  
 ---                  
 u64                  
╞══════════════════════╡
 16737367591072095403 
└──────────────────────┘

Geo Hashers

df = pl.DataFrame(
    {"coord": [{"longitude": -120.6623, "latitude": 35.3003}]},
    schema={
        "coord": pl.Struct(
            [pl.Field("longitude", pl.Float64), pl.Field("latitude", pl.Float64)]
        ),
    },
)

df.with_columns(
    plh.col('coord').geohash.from_coords().alias('geohash')
)
shape: (1, 2)
┌─────────────────────┬────────────┐
 coord                geohash    
 ---                  ---        
 struct[2]            str        
╞═════════════════════╪════════════╡
 {-120.6623,35.3003}  9q60y60rhs 
└─────────────────────┴────────────┘


pl.select(pl.lit('9q60y60rhs').geohash.to_coords().alias('coordinates'))
shape: (1, 1)
┌───────────────────────┐
 coordinates           
 ---                   
 struct[2]             
╞═══════════════════════╡
 {-120.6623,35.300298} 
└───────────────────────┘

Create hash from multiple columns

df = pl.DataFrame({
    "foo":["hello_world"],
    "bar": ["today"]
})

result = df.select(plh.concat_str('foo','bar').chash.sha256())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polars_hash-0.5.1.tar.gz (33.1 kB view details)

Uploaded Source

Built Distributions

polars_hash-0.5.1-cp38-abi3-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.8+ Windows x86-64

polars_hash-0.5.1-cp38-abi3-win32.whl (3.5 MB view details)

Uploaded CPython 3.8+ Windows x86

polars_hash-0.5.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ x86-64

polars_hash-0.5.1-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (4.7 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ppc64le

polars_hash-0.5.1-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (4.8 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ i686

polars_hash-0.5.1-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (4.3 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARMv7l

polars_hash-0.5.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.1 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARM64

polars_hash-0.5.1-cp38-abi3-macosx_11_0_arm64.whl (3.1 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

polars_hash-0.5.1-cp38-abi3-macosx_10_12_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

File details

Details for the file polars_hash-0.5.1.tar.gz.

File metadata

  • Download URL: polars_hash-0.5.1.tar.gz
  • Upload date:
  • Size: 33.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.7.5

File hashes

Hashes for polars_hash-0.5.1.tar.gz
Algorithm Hash digest
SHA256 126419548711867f1cc63b2c2682cb224d262ecce48461ed11dd1f3b32e16cbf
MD5 bb978fbf14361e8fbae42e183707680d
BLAKE2b-256 17563d5c64bc08b7834a3fa0e48d843fae6afa1b370269cbed2cddc19e013b40

See more details on using hashes here.

File details

Details for the file polars_hash-0.5.1-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for polars_hash-0.5.1-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 cd6180f4e2192b26951c5ad4766266bf06f1fac63aecbe3ee981add9a271e692
MD5 f410659335e898c74a2f1dffbf0b93c1
BLAKE2b-256 1254712102d4d7045287d96b5c3968c560cd6385b82741edffe2b7541c1e7bba

See more details on using hashes here.

File details

Details for the file polars_hash-0.5.1-cp38-abi3-win32.whl.

File metadata

File hashes

Hashes for polars_hash-0.5.1-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 9c98efd2be233b481b3cf7160db60637f4000b6126b0b704e2d9faead83ded1d
MD5 b6f26d1e7ef1f8e8e6f06fbe49a5ee02
BLAKE2b-256 96d57c8796be3f102ec230c6bc0e9518bec2dc58c8a846bc87541a8414cdb81a

See more details on using hashes here.

File details

Details for the file polars_hash-0.5.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for polars_hash-0.5.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e723b3337be9622e5c7769b47fd36419bf2558a71f4090821fee8c96ac499137
MD5 3541715ffc72c2a3e1eddf2a715c8e18
BLAKE2b-256 467c8bf79217b8921b19c292acf572b186725ff32e6a281844c1353b62605375

See more details on using hashes here.

File details

Details for the file polars_hash-0.5.1-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for polars_hash-0.5.1-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 2ac37c6a2916ab3ed635a292f6ab3a5852fabb021b6c13b5dab8c683079086aa
MD5 4512b5d9a2a3db96d882e851a94fef32
BLAKE2b-256 2e0925e35c481c07fa1f9a5f6a93857ed74b90e815aaa1e36760b201b9c9c6d2

See more details on using hashes here.

File details

Details for the file polars_hash-0.5.1-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for polars_hash-0.5.1-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 c3cc724a73478100ba2f7d4ef060521f1709a4449160eec4f63292c33aab1dde
MD5 424e411ee31f178551b2df641ff538da
BLAKE2b-256 4bb5fe475ad094a4dcb967f332317542e2aee7ef7e310c3c2bcd23c63be0ce57

See more details on using hashes here.

File details

Details for the file polars_hash-0.5.1-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for polars_hash-0.5.1-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 f0814f8b54c4eb052b2306bf97da11ec87d2bb67fd2b1c40d520d6cabf4de1e5
MD5 381148fada2dacf2a0e3e39701c168a7
BLAKE2b-256 0089c896868332393af7feed5acfaabe32a852dd959e8552cda8a268ed33feda

See more details on using hashes here.

File details

Details for the file polars_hash-0.5.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for polars_hash-0.5.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d15f61d25cadc95680092a60c5643d57e30f607bb4bdd928d0bffff6ab0b763f
MD5 be015d23a74ce04d6c83976e7c27ec7c
BLAKE2b-256 8503261897878b9440b05ebc2cd7b19b9658871fee1ab12273c7dd4add6f7dab

See more details on using hashes here.

File details

Details for the file polars_hash-0.5.1-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for polars_hash-0.5.1-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c3fecf65d130d0770fcb694408a1f045dc5ce75aa2e98d0b4163ad683579542d
MD5 71fe32c68ae85a75322ba1388025e099
BLAKE2b-256 f5fb8276e6dc7bd918ed17f4ac353a3bdb92f01890add75912d9ad511343e44e

See more details on using hashes here.

File details

Details for the file polars_hash-0.5.1-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for polars_hash-0.5.1-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2d686e7a1f9e725904651a4c2d0ad8f8cb45c1ff1d73aa7811977026c8fb142f
MD5 618bef95e7d8ca475aaafe1cf270e505
BLAKE2b-256 63258a8d0978709249a3d8262d5a68a0ab136bbc0e974090f8b0fa722828f77b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page