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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.8+ Windows x86-64

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

Uploaded CPython 3.8+ Windows x86

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

Uploaded CPython 3.8+ macOS 11.0+ ARM64

polars_hash-0.4.4-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.4.tar.gz.

File metadata

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

File hashes

Hashes for polars_hash-0.4.4.tar.gz
Algorithm Hash digest
SHA256 44065a37d2aa741fc2cd6fc2e1733864e918a9446cee6d59a02fbff865928ccd
MD5 607c71e8d68320454e2080f448676074
BLAKE2b-256 8259a00ff41f886888b18a20b91f969ae773dcd88f7d1fc4d4384bfa81afb361

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.4-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f54550afc846e8b3c99c39d6e8592ba0a32052f2a14808795dabc4d23a61a92f
MD5 d0124e46aab897637add8f34e4315e69
BLAKE2b-256 2ddd469060b12dd0e4ea784dd2ca1425e929bd028c82f81907773e98338ab909

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.4-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 a0563e209c825b6b0b110a9f9dfa8bc86f69d64a8b668a5e2081e7c2e4182248
MD5 e5d60bbea547c2f017cea7b784ca1e82
BLAKE2b-256 7d050ca87f60e1bec26757e7722b2f4e5c6d84372bd93712d711778707937c02

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e405b49de67a6550755817449be5ef7726832a800b034bfecf483b534c1e1ef1
MD5 1f92c24f316d2b3aca01c2fc41f7a484
BLAKE2b-256 478f964ef3d55f750d2adc5d15291269364e54fba5ecac6b73f09ef718e6411f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.4-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 c6e6f035017100348bfa2ee90a45f386beb5199876f788446a1fc70826d0073a
MD5 11237afd81c619bcb606b3c19ed73fe2
BLAKE2b-256 d6297a582ab3fe92542f724be22b67eeef94ec82af997b078cd06dd6ce91ad3e

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.4-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 0a2a12d1d7124a7dca28f5aaf4696cd7f847c7168e31fbb0e83d1c11f90be79d
MD5 9fd9d46720adc6147f9e1da1f35950d7
BLAKE2b-256 c1195f3a93c11326305b4f2d0f7e9e6a484db47a9634019b19eb564b2aed3e42

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.4-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 bee8f2639dd9a65e9f23fc09ca6572175a428327b368c8ffa0e5f1c66b2bf2b4
MD5 2999f83157dfbaf51cdf9ae360dd8454
BLAKE2b-256 63f0f1e0d6dda56ee0be9ca7b62b830d9677d2c316730b3d05a7a35b3b8d4c91

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.4-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 59f175a224b67984b515fb61c379aa62d84e944582c07666c0cf2c0d134d207f
MD5 d7edd28d3ce22131f8523c8aa9301307
BLAKE2b-256 f4d1c41a337447a7bb866597054357a48515d2cb724b1ba3a2427eedbde8320b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.4-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 da856078ea2d9fa18541f10631f688aa6e8fbe75d060752e65e82b42df23a9c4
MD5 9b2566270a4f854637a060afbfa58dde
BLAKE2b-256 78764d8e0f8b54e3715df8e69fbeaef148bd266617430aadc7b4a4c780e6f311

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.4-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a9b9fe742ec978213499df42023b748e29bc7f8db683c1d98f8369910f3531f1
MD5 3be55df2603370ff9b2c37c78aeeb7fa
BLAKE2b-256 bd469a097797a6b6afc68ba568faf01a53f8a90974e132668cd3ed4f1c4d1bdd

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for polars_hash-0.4.4-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0c4737c9c0c742a8087e63b2156f4a48c9a5197cec33cf232e0ccd7e46815437
MD5 1845976e0a6ccfbe8b64ad5b78690337
BLAKE2b-256 7e15f7a4a6540f15a4f8c496e94a1401bab5ff023c618214ec2ba0b45d475b35

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