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

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

polars_hash-0.6.0-cp38-abi3-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.8+Windows x86-64

polars_hash-0.6.0-cp38-abi3-win32.whl (3.7 MB view details)

Uploaded CPython 3.8+Windows x86

polars_hash-0.6.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.9 MB view details)

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

polars_hash-0.6.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (5.6 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ppc64le

polars_hash-0.6.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (5.6 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ i686

polars_hash-0.6.0-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (5.0 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARMv7l

polars_hash-0.6.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.9 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

polars_hash-0.6.0-cp38-abi3-macosx_11_0_arm64.whl (4.0 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

polars_hash-0.6.0-cp38-abi3-macosx_10_12_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for polars_hash-0.6.0.tar.gz
Algorithm Hash digest
SHA256 f2b860ddb4ebb064185a7fb082eab5f930d71467d5442e2e9040e62108b292d7
MD5 53930f26df176f976d2bd00794ab837e
BLAKE2b-256 3d3500b8aa6d5e543b8e3c7e2ec0f5715cac19589bfd028b62eb68f943de6bc8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.6.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 15896e8e0c3843e8fc90e51f40aae7c6feb5187c107ad8ff332dcfd7cdf5f8a7
MD5 5ebb5ae7602dc5d3bdbbc65b29e5b0a4
BLAKE2b-256 b43a691262209166ab2fab0c5b237caace40574b88087f010d4c7ea12c97df8a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: polars_hash-0.6.0-cp38-abi3-win32.whl
  • Upload date:
  • Size: 3.7 MB
  • Tags: CPython 3.8+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.3

File hashes

Hashes for polars_hash-0.6.0-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 2758ac0f1ded1b22c6c4f997de4e24c893adf009b8f72b291f017a6dbc12ddb9
MD5 79c44c146b5cb0c352d41a6af8f88559
BLAKE2b-256 16e2d224690e4fc907c939c765f3993bc69eaef2146250b60eae9b7b5635cbb4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.6.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d1e4d19a58dd265192f3b2aee7dd34354dcae420f20d6a01111ebe21efd87ee3
MD5 c91315710c24af039e557882ae9d8820
BLAKE2b-256 bde6c4e7954327bec95c79358f2204ef93a6f25fd7a84544ee9c18edfccf55df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.6.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 7e506ced3c923444528ea45258347ffe5ddcdafe103a21e3df87871a3897b412
MD5 cdf9e0439bc838321019ec3ae1b18afe
BLAKE2b-256 b4b6d1e5e5cae6bd8aeff3bc9b4470bed75d1820a7752b53c5d9deb34eb48563

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.6.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 809a4bbd2c57dd67abe9e454e494cc0f2a5b4708adc8f99dd9c21c0db7edaef8
MD5 745841d2c5af4a4043d98615bceb4ff4
BLAKE2b-256 3f652690839d86536002a7d9346e5a654a777accb5e66e2e8d68de6591df76f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.6.0-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 fdde9db73b10891b5adc0a5911531ce4239f7aa3ee52d7470389f51028d5cafe
MD5 9f852a97582e9eaf985d50590419de71
BLAKE2b-256 6f667712a0d7fb14aed847b5261ddd7b985d9ca742df2b499b0b30c166cf120a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.6.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8ce79656a4259341849f112bc9f71d486fac9db63b1c946ac980f6f1785186c8
MD5 acd9903fdfd7f9acf41686f8a5f912fe
BLAKE2b-256 050e734319683a9f1edf9d8db240e2d0b854e9dabc39cd0deb89b32fe03adbd2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.6.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 43d979a6807e3503f8c89746ffc8883ac8e49442519c78a7c28bcdbaed260283
MD5 cc415a7e14a59a8c26841a548e6139ba
BLAKE2b-256 68377af1c0fb241900ca4b1ae07de491ae1d52d3dc2b003f711eb8f726097239

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.6.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6c3d1f9849b56d802657c69c0861b39efc8edcc9c98bfcff76e5f90b76d107c6
MD5 151c24fd4d936a63c86a04233b33e165
BLAKE2b-256 af6f09673fc17f228993421d8ebd971a1ab252ed2634f60a707972028a655ec7

See more details on using hashes here.

Supported by

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