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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file polars_hash-0.5.6.tar.gz.
File metadata
- Download URL: polars_hash-0.5.6.tar.gz
- Upload date:
- Size: 28.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0e5c02e839dac8d4c514fb3a053f2dc33749bd5ed1cb5387c1ef34972492e38
|
|
| MD5 |
e49d39178a9b1435ae69805b701deed4
|
|
| BLAKE2b-256 |
d2651363800e877a6839398628879fcaef8623fab8abedd0e2e2eb4657282550
|
File details
Details for the file polars_hash-0.5.6-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: polars_hash-0.5.6-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 4.2 MB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f745a52054779cc1c03950a905dc7fc971698b6111e3e83e24d4edf502d9e6c
|
|
| MD5 |
a474abffad675f59e9776e30588e8348
|
|
| BLAKE2b-256 |
6a5894016e8e61f210175146e25e40a6ea8a498e94eeaa4214e5f4cb1d8458fa
|
File details
Details for the file polars_hash-0.5.6-cp38-abi3-win32.whl.
File metadata
- Download URL: polars_hash-0.5.6-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.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
004db887b202f2e9e0bc22d3b5bf0b8d3a6cc5caaa38858c564d95dc9e9ff985
|
|
| MD5 |
07c4c436cee2df0babed56df575c49ae
|
|
| BLAKE2b-256 |
94743b49440046260b34f1d91e779bf64aefe673401e30b7ec648f94eb90c82b
|
File details
Details for the file polars_hash-0.5.6-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: polars_hash-0.5.6-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 4.9 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c7980c07510e39414b6a54de5241cca18a919c0d23fee24de76b044ef17af1a
|
|
| MD5 |
ec3a74ff454db531761582f838469847
|
|
| BLAKE2b-256 |
740cceee8533b4e8b1df61a65453d0454be99954262e8678a6a726d1860f61c4
|
File details
Details for the file polars_hash-0.5.6-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.
File metadata
- Download URL: polars_hash-0.5.6-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
- Upload date:
- Size: 5.6 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ppc64le
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d612bb3f7c18bbb525d489c21fe803e89253c41fe7a8a5c08231e81ecff771f5
|
|
| MD5 |
01244067eee433a24152df8a2a3ac4e3
|
|
| BLAKE2b-256 |
f475537a7cf9bf067db271c89c5033d63445aa3a99d885ee801f77c28f2e87d2
|
File details
Details for the file polars_hash-0.5.6-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: polars_hash-0.5.6-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 5.5 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a63fbfe49f14a8fb966db00162eab7067e270d9fbc8261c4e4109c752aea9f8a
|
|
| MD5 |
b3b47a44e3e1b7a2f279b6569de32faa
|
|
| BLAKE2b-256 |
d374ceca8f33fd8b4da203ad989c1d8dff36459a0c6c50c0cdee335a19380a74
|
File details
Details for the file polars_hash-0.5.6-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.
File metadata
- Download URL: polars_hash-0.5.6-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 5.0 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aef82274bfd05b4dbca740a2a7db13d5ce9aeb678c3ffd593d61a8a3f8a2cdf8
|
|
| MD5 |
6dcde6a2d8de538066b0675da83df2e3
|
|
| BLAKE2b-256 |
193b65d234b23251fcce5bb8e3c48764fbb017d5627b20dce401e8b20009b9a6
|
File details
Details for the file polars_hash-0.5.6-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: polars_hash-0.5.6-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 4.8 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c772db0140f34ca068b01116d430caf994ef23917c31b44db68c511f208a72a7
|
|
| MD5 |
ea0fa7b79bbaae1ba310ce32177630e1
|
|
| BLAKE2b-256 |
28d1ab5e0242ec78965f9c767c6b453d2972c799125fb5aba0714cf90a58c077
|
File details
Details for the file polars_hash-0.5.6-cp38-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: polars_hash-0.5.6-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.0 MB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c70d9f1ffdabd610aeafad965fbf753fc526c84a0153e00987ee872a4d10c30
|
|
| MD5 |
330347abb5b15e5d7a772ba012290ef2
|
|
| BLAKE2b-256 |
fb0cbf1db13c707956be8acdcc56ca7440d8f0706d80f9a2a56fbedf598dc3d9
|
File details
Details for the file polars_hash-0.5.6-cp38-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: polars_hash-0.5.6-cp38-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 4.2 MB
- Tags: CPython 3.8+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92d5d7192e1b877287efd73abdf6df080f562fa3b758fae49f0cd1bcaee8817f
|
|
| MD5 |
5b9879e80020e8e1e40a4b11d466e78b
|
|
| BLAKE2b-256 |
2d967aad5784ea758dfcac1e89aeb87a9ebc81ee939a8a79f59b8d41f392ff1a
|