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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.8+ Windows x86-64

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

Uploaded CPython 3.8+ Windows x86

polars_hash-0.4.6-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.6-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.6-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.6-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.6-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (5.9 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARMv7l

polars_hash-0.4.6-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.6-cp38-abi3-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

polars_hash-0.4.6-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.6.tar.gz.

File metadata

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

File hashes

Hashes for polars_hash-0.4.6.tar.gz
Algorithm Hash digest
SHA256 9f1ca2ed32ca803da1253c0fbacab71c2d42e7876891a7415210c57ead57f8f0
MD5 65d5cb3b91cf388431e826e13070cb25
BLAKE2b-256 a654b1a712a6790ecddc9e02ecd21dea0154decf705a0e5000172203d5711fe1

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.6-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a72e2cec9dc768a2469cafcda86e9bafe8eccb607bf248479583de8a323a065a
MD5 544fc363047cee77f6713e18a9f21408
BLAKE2b-256 01d210aab2ce773b45b549bafd2efc51b0e72d73b6c7fe5670a6d4661c9db37a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.6-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 4b767d0e4b3e5ac6e4182cb0c72c6472efa9805ab87f791dec66eda1aeef0c66
MD5 431ab2057cc9f74cca37e1d06da20aa0
BLAKE2b-256 fee11886c8b6e744cc31513be1a5584fd3553c1a75663b2f8087475f80e9d098

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.6-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f62d67f02b80a7d3a6bb74d1dc4578ae3e01455b2944b2ede078c82277f7572a
MD5 68eeeaa7925cde06e0d8af2831ae5e79
BLAKE2b-256 899ae46095e7bbabd25e1dbfd9747ee7ce06e0b4af4cfc82b3cea01fbc5861ea

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.6-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 9defe08c7966bc980a3492a2f9a87808a941f9f5ecf7e0b0cbf4e606276288d5
MD5 c1dd2799372d5045bc72c09a425b04a2
BLAKE2b-256 8b2034b52a88cff4e211df0d4afa17bd2f4f3d8c22a1b3ab2cea4a88e9a8618a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.6-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 a1c6d2a7f4207a8e4ab45c8a535744c393900e2f85e6a46f3e6a92ac82609d39
MD5 844852f5e784f766933b96b17bdd3517
BLAKE2b-256 deb5669441b880bb509e15a36876244e529a126fdda616771f9a4a4d8dd057fa

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.6-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 eb064d0528bb894c46678231a1666fc07219f79d345d358f25f304ce07d53399
MD5 895d1696bf3c8083de1989af7327cf24
BLAKE2b-256 28846014adc61731d52e19f4c7a9d0661f14ec0fa53bc66ce2161db1e9d0beed

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.6-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 2bd965adb054b888a5071351a482653094d786e85d6b14ad15d4db9e9968f6b0
MD5 d28a54371e819f217f91db5a9622da31
BLAKE2b-256 d9abccb71174506ee044db1a3e140c3fe08e69fa8ab945048a15d904293d8284

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.6-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9ab676f5e79326a07c532248e7a7d84e3d5703d4ce7e899c8cb4d440c5574e6c
MD5 0cfcc90ad0f85c49f11807089e5d9a61
BLAKE2b-256 6185e8f9f619d3a78f8e7c2748df889fb7403a826ac5c18c40535f6f55fbcb2b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.6-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 15fdc569badd1b85cb3750d405db841d861a4d06c7291c8def0d36fa48c8564b
MD5 4737c49ad199aaaf353d8953d9033f60
BLAKE2b-256 eaed36c2ac816274ca6d4504e816110e011c6e00f18d57dc127b342467c1f68d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.6-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1ed6cfaa966222619e6439c740777863132513118c7094ccb053df024b99b334
MD5 085ffb34e8c1bbe910c25905d2d8a3c8
BLAKE2b-256 d1a0033499f5472bf123a80fb49a38d4b72e1a27119f536177d8d078c0444ca4

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