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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.8+ Windows x86-64

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

Uploaded CPython 3.8+ Windows x86

polars_hash-0.5.2-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.2-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.2-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.2-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (4.4 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARMv7l

polars_hash-0.5.2-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.2-cp38-abi3-macosx_11_0_arm64.whl (3.1 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

polars_hash-0.5.2-cp38-abi3-macosx_10_12_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for polars_hash-0.5.2.tar.gz
Algorithm Hash digest
SHA256 c16f58739e231a4c39d5956e49340b7c3415c8ad49f4a183d529b5984f1c37d9
MD5 7578f6aac3692df1001ab1b450b67a2c
BLAKE2b-256 25ba4e36eae3a537a5b9d8ac9300a1cceb74b86f2617b907284e5adcd47a6e1c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.5.2-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a59c3337f90ec36079106f42df3162db896eeabef0049c4f96a88efdce7f199f
MD5 d94565f84af9c496022ab2f02c61bed5
BLAKE2b-256 23a83e22266bb5be3799dfe7b65b8f9231ceee965da87fe36c972618599ee955

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.5.2-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 dcd0063332cc0bb7c12a4e6691301090ab298907f49746fed8b034b2c2a4b4e7
MD5 b6eb42feb77061793b2eb2413177e89a
BLAKE2b-256 72ac0c49e366134fbff15077d2bdc30b61ab92eab7e8d6b930ea180e17c2dc5a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.5.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 20f2a6496ef3846cdf759da37add264308b025eb45859668db3c336fb6d80afe
MD5 5b524f66d0b5c9bb62f0146ff717cbaf
BLAKE2b-256 7a5adf82f964eb7673bc9bc173f2f256ea764c7ad09a1bcfb1ec279f7604a36e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.5.2-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 3bd451eb8e8785f19c7127d4f00f3c603713f9aa94aba62f30849325a0e6ba16
MD5 da2bba76e27a34532c0f95c1cc7fcf62
BLAKE2b-256 29f5ee6daa0ee8c979380ebe2b4c6eed2359eeb6e0b417a3e64e525589c46ef8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.5.2-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 56b1c89f5ab56073f02049ce6fd935b2aae29a163fb9c88fad77a0a9c1e070e4
MD5 12caca4d9504f390c9ff6d291ae60741
BLAKE2b-256 cc37b51a772af03571700aa4972ab30ced44dec2feed08b26f6e7c587c6fc150

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.5.2-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 d7420b0508066254e19ef63173299893d76d1437f9d4d39d7a745b25cf885b86
MD5 366391157642e2c2bd5ab336369d8643
BLAKE2b-256 85496da59d50906e0acf2f74aae05a721f7d347b1fe5039bd6415cfc8bc75668

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.5.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6ee13335a0d4fe2978718889f419ac966f2b4dddc3f378ca3f85b640eca25933
MD5 dd7a2ffa0cff7c9bdee2d5cd8f9197c4
BLAKE2b-256 74522600ba47c617000c624cf7578aa009e605672f5815e900398792b05b9035

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.5.2-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 79d0979f14fe8a6b9ce829cdbd2517925372185fea96fb3fe8c9b408a32299c4
MD5 e415398aed2f5d3f97e0170f24a1767c
BLAKE2b-256 ae01407ad2045bf6b5058fd08092a233542f6854718674be93bf73e7a1c64e8e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.5.2-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4d768a025bfe4e74a3bf4a3a98f2b44a32ab00494ac43ec44be37aafa445bb0a
MD5 e885922448ad1bddeef2848d6cc75064
BLAKE2b-256 c6ceef4cf9bcad7d83b5097d3d45885c026e31b2b7a0dda8f2eb7d20382a3f17

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