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.4.5.tar.gz (20.7 kB view details)

Uploaded Source

Built Distributions

polars_hash-0.4.5-cp38-abi3-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.8+ Windows x86-64

polars_hash-0.4.5-cp38-abi3-win32.whl (2.6 MB view details)

Uploaded CPython 3.8+ Windows x86

polars_hash-0.4.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.5 MB view details)

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

polars_hash-0.4.5-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (6.9 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ s390x

polars_hash-0.4.5-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (9.0 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ppc64le

polars_hash-0.4.5-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (6.7 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ i686

polars_hash-0.4.5-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (6.0 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARMv7l

polars_hash-0.4.5-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.0 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARM64

polars_hash-0.4.5-cp38-abi3-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

polars_hash-0.4.5-cp38-abi3-macosx_10_12_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for polars_hash-0.4.5.tar.gz
Algorithm Hash digest
SHA256 7670e5e2869bbfa576c0bf3726c5bfcf12cef6c2f91e661e499dd9e5696fd740
MD5 c66b8a25bae2576935bc2ab6707556eb
BLAKE2b-256 03882d5a35402d27aeece52afd6527d25a4d24f2b779539f7f3d01744cf14019

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.5-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e56c4493d798b8b04c654527ac6130f4d674b947cafdbc909945d02c4505601d
MD5 e53247173ef690989b60b851c259a40c
BLAKE2b-256 01a907d6d1b742e076d3fbb51f18c2f58d247fbd679f176718eef2420ee7878a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.5-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 a6326dc65703d62dd787163966eb6b69730b34a0e93915fc69e226ff1286e45e
MD5 a80cc57b6a3966748272932d741c69f3
BLAKE2b-256 562ffdff7071b796fe3bedd7a1c0ca07564342718ff21cc8c880099d0e89aea5

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f1811860b10e00ad80b9883e9322fcc96c96d17a3ddf46eeb5e63d88fe8af14d
MD5 79de36e89e5d73baf359d759ef1fb45b
BLAKE2b-256 b7ac06da58d0d8753154fae04561622c6e9d02c11c2404d2b3cf28caf6eae2c2

See more details on using hashes here.

Provenance

File details

Details for the file polars_hash-0.4.5-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for polars_hash-0.4.5-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 2c6ca140f0dc85d38bce3c256289278da05067a44027f79daaf12f1b8febb0d0
MD5 1f27a26fe7e2444434e625fd43460629
BLAKE2b-256 47bf0927da84aa12898fe16b4e49ac7a57e5285567a1932e7e42e885b062845a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.5-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 9068f2f64d6d105f8f94dd5196ed18b7b8cd52fdd8243e370675d3ae26e7eb67
MD5 63fed629898f2b5c183bbdc14645168a
BLAKE2b-256 4498a779d292be7f88be12ee10e1ba30be230dacb443d5a565c385d5ac190e63

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.5-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 5e26eaef456ab42e0baeb24560851227f6b3563183037984b67b0bbd53b1bd86
MD5 d200a4a347c1bdb0cbd5c46fd5bd44ad
BLAKE2b-256 71c31c44e47601b531b06fd30ddab735c6a493d9ed496299a9f044578bf81d81

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.5-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 96e0c0aa4adc9cb214e24fc56a2e0918da86976466c3a3472c3207afbd5dd3de
MD5 4d64237fcec0ad06a8720f66ed4011cc
BLAKE2b-256 d37cf90c51cdefa0c6d1e136f0898fd959ab501d414762f3b08cde84e06c7488

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.5-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4ff8cee1098e86c937e79b8ff29a8908ca0122607c93437c3956aea0016aaee8
MD5 464bcea2b66269559d16d07ec42faea0
BLAKE2b-256 6cda3aec7bdd82064b04c25a283423132c60459820a37d2219ed35913b918805

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.5-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b3abc5fdaea8cea44835808b8c338bba1b7564ada74110d6d8ebd887dce04f8c
MD5 2d5828392fb003578fc2adab24303a58
BLAKE2b-256 21502844d42c6126cb8bb749ccf7c76e0406c5ae492d00c10423c5c7a968498b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.5-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1c2e13ba3ae828d149bb91541ddd70161253ff26d8b40a942241ea0a9a9fef53
MD5 74a95403b731b80750ce0179e7e4a365
BLAKE2b-256 f3644b1b8aee154c48ae950f1db8ffa767d3afc781ddc0057e8416155f96996f

See more details on using hashes here.

Provenance

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