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.3.tar.gz (18.7 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.4.3-cp38-abi3-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.8+Windows x86-64

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

Uploaded CPython 3.8+Windows x86

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

Uploaded CPython 3.8+macOS 11.0+ ARM64

polars_hash-0.4.3-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.3.tar.gz.

File metadata

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

File hashes

Hashes for polars_hash-0.4.3.tar.gz
Algorithm Hash digest
SHA256 44f143953300ef53ee0c4e4de3da139c0e62ec6d4b49c88965a03a73c5afedc3
MD5 302e745f9b98218731e2cf1de3ad74c5
BLAKE2b-256 bc255d060ad542e7d07f547e1b995743702053788a73eba7cd8c9932abaa6225

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.3-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 40c70b9a536d1951e103fc61038d9971245de724fe1f2455fce5e17829f461f9
MD5 9a2e2e9e4d387c7b68d0e3440918db6b
BLAKE2b-256 85185feaa21ce62d81c0a7ec87b75f1fa70aa0496da0b839118fb7d09d34d0d2

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for polars_hash-0.4.3-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 50e1e38c86c0471a121c987983437cb4772e796a3b5d318ac3f83e6cf59a9e9a
MD5 47154374f3b3f882a889e7d752d03083
BLAKE2b-256 c2aea356a4e5969fb692f59f3ffb442633fefe37503510098200466810b5d13d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 41050d9dc7b04538db27b1aa9d4571fe714a422ee55398d90c83212b75b526a0
MD5 85df8f23e9e33ba97e2f367dc3ff70bd
BLAKE2b-256 04cbb3fa42558c93e3d9c8e2c178d2fc960642c87a6c086bd48a227f8256662a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.3-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 5e520fa7c7b2e390c835adfdd3ae8a71e63b96b8ac1267869fbd098204b56f19
MD5 9e17df87b89cfae1920975d7a9c8e85b
BLAKE2b-256 52d62729ee7dd024e97e5999e355a2aab0fb0cea2f4a22410b54b2bc0c3ecd42

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.3-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 f39b3f363fadf4c547c2ac9e32460aab9de2fedac6f73f6d10cdbc27cb322b12
MD5 686d5359553078b77c0c560a6eb89e94
BLAKE2b-256 8888d5acadc0b8430f767a7ed2c601d76d25ca20f8268d97acf4f24cf7ac6b1c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.3-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 5a576bd285c0afc2e9f3d89c7143e5d57875792e62540314a023bbf73d51966e
MD5 d3a7e02f89ec044e58b540753c5b97c8
BLAKE2b-256 bdb577b8055971abbb81e39ad69ef214562c43bbec193e5a80e1f82033c30731

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.3-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 76cc2db381d5825de7febdbe1ad7f5b7248f8eb5313ff5204d0a7dbb73324926
MD5 63b073e3bb8adf9cefff1a8d0e2cdc3c
BLAKE2b-256 1b2468fd32bce2a6c06f5bcc99cbfdfb48578fdf35d9e0cfceac5854e94c788d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0cc25ccf3cfd8bf58fda351aee0271b2794dc1da9fe855b61fb4e616fdf07984
MD5 6ed49aa9ad75a91e9398a8a7dd3ca1f8
BLAKE2b-256 2a28eb8b63dccc45da7892441402c28e1f7ceeb42a6a614d58f969dd55890a9c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.3-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5266532d38486c7eb3473d17fb45e06d041d9309011b90129f68d65c8073562e
MD5 ebb39ae8c2a9ceba435136aa65c001b8
BLAKE2b-256 4cc8d7cc3f687756901f462830809418cd06c58e9a7b430436a833c42d9f2ff0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.3-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f741bee5cb9b63fd2d67b8359f7d71962d3daf149ba7df97ac2d59ec54e16a77
MD5 b3da77b95e6621413fa4526353f845cc
BLAKE2b-256 da01abcc7956a24dffb6b26da690e1bfab6a66939d374949b8ab5f8414977298

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