Fast and Redis-compatible HyperLogLog extension for Python 3
Project description
pfutil
Fast HyperLogLog extension for Python 3. The underlying binary representation is compatible with Redis.
#!python3
import redis
from pfutil import HyperLogLog
r = redis.Redis()
r.pfadd('foo', 'a', 'b', 'c')
r.pfadd('bar', 'x', 'y', 'z')
r.pfmerge('bar', 'foo')
assert r.pfcount('foo') == 3
assert r.pfcount('bar') == 6
foo = HyperLogLog.from_bytes(r.get('foo'))
bar = HyperLogLog.from_elements('x', 'y')
bar.pfadd('z')
bar.pfmerge(foo)
assert foo.pfcount() == 3
assert bar.pfcount() == 6
assert r.get('bar') == bar.to_bytes()
Install
Install from PyPI:
pip install pfutil
Install from source:
python setup.py install
License
- This
pfutilsoftware is released under the 3-Clause BSD License - The files in
src/redis/are extracted and modified from Redis 6.2.12, which is released under the 3-Clause BSD License as well.
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
pfutil-1.0.0.tar.gz
(29.7 kB
view details)
Built Distribution
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 pfutil-1.0.0.tar.gz.
File metadata
- Download URL: pfutil-1.0.0.tar.gz
- Upload date:
- Size: 29.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79c278176c560cb5d02fd2cec4219bb445e5077a837fd5b854affed31827c4cd
|
|
| MD5 |
7e12924e485c30c0cc8c7bc57186aa6e
|
|
| BLAKE2b-256 |
01466de33ad628a5e0e5fa421f1cd4c3080f6008e9ff3b67f1dcae80e77bb2c4
|
File details
Details for the file pfutil-1.0.0-cp310-cp310-macosx_10_9_universal2.whl.
File metadata
- Download URL: pfutil-1.0.0-cp310-cp310-macosx_10_9_universal2.whl
- Upload date:
- Size: 41.6 kB
- Tags: CPython 3.10, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b123d65f3f850507c87315daa47411a2e2713b2270a2d3ab80f3011a219a9163
|
|
| MD5 |
b2859f52705ea1e9eaf6193702d6f4be
|
|
| BLAKE2b-256 |
d8ff4418c1a315a6e7510684adc48f3fc9834caaaed1b78e8c916ade6ef5d4a7
|