A wrapper for the C++ Datasketches library
Project description
# Python Wrapper for Datasketches
## Installation
The release files do not include the needed python binding library ([pybind11](https://github.com/pybind/pybind11)). If building from a relase package, you must ensure that the pybind11 directory points to a local copy of pybind11.
An official pypi build is eventually planned but not yet available.
If you instead want to take a (possibly ill-advised) gamble on the current state of the master branch being useable, you can run: `pip install git+https://github.com/apache/datasketches-cpp.git`
## Developer Instructions
### Building
When cloning the source repository, you should include the pybind11 submodule with the –recursive option to the clone command: ` git clone --recursive https://github.com/apache/datasketches-cpp.git cd datasketches-cpp python -m pip install --upgrade pip setuptools wheel numpy python setup.py build `
If you cloned without –recursive, you can add the submodule post-checkout using git submodule update –init –recursive.
### Installing
Assuming you have already checked out the library and any dependent submodules, install by simply replacing the lsat line of the build command with python setup.py install.
### Unit tests
The python tests are run with tox. To ensure you have all the needed packages, from the package base directory run: ` python -m pip install --upgrade pip setuptools wheel numpy tox tox `
## Usage
Having installed the library, loading the Datasketches library in Python is simple: import datasketches.
## Available Sketch Classes
- KLL
kll_ints_sketch
kll_floats_sketch
- Frequent Items
frequent_strings_sketch
Error types are frequent_items_error_type.{NO_FALSE_NEGATIVES | NO_FALSE_POSITIVES}
- Theta
update_theta_sketch
compact_theta_sketch (cannot be instantiated directly)
theta_union
theta_intersection
theta_a_not_b
- HLL
hll_sketch
hll_union
Target HLL types are tgt_hll_type.{HLL_4 | HLL_6 | HLL_8}
- CPC
cpc_sketch
cpc_union
- VarOpt Sampling
var_opt_sketch
var_opt_union
- Vector of KLL
vector_of_kll_ints_sketches
vector_of_kll_floats_sketches
## Known Differences from C++
The Python API largely mirrors the C++ API, with a few minor exceptions: The primary known differences are that Python on modern platforms does not support unsigned integer values or numeric values with fewer than 64 bits. As a result, you may not be able to produce identical sketches from within Python as you can with Java and C++. Loading those sketches after they have been serialized from another language will work as expected.
The Vector of KLL object is currently exclusive to python, and holds an array of independent KLL sketches. This is useful for creating a set of KLL sketches over a vector and has been designed to allow input as either a vector or a matrix of multiple vectors.
We have also removed reliance on a builder class for theta sketches as Python allows named arguments to the constructor, not strictly positional arguments.
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 Distributions
Built Distributions
Hashes for whylabs_datasketches-2.2.0b1-cp310-cp310-macosx_12_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7198a56868cc293bb5ac71a90d1e35088a06c010a9cc5d5e9e62339bab20cb61 |
|
MD5 | 124a9d58bcf0a465e2054651ee3b1627 |
|
BLAKE2b-256 | 42cf99581b5f208ec76302fb998a8dc4f4100a49a2196d72ff145f5ea7ae15fc |
Hashes for whylabs_datasketches-2.2.0b1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bed8ea30be37c2f00a3cf2f446116dd3b8b9a59e8773491e005bba488e0b5608 |
|
MD5 | d160d3918e93398b9f397dabd550cb62 |
|
BLAKE2b-256 | ad057b13f696c045bec10c983110692961f9761d52045945fa54a21004c20f1a |
Hashes for whylabs_datasketches-2.2.0b1-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ada72be8dd5bb4f33d4efd2012e483df6f9e855c6b0f0bf10596e6d4ddc149c0 |
|
MD5 | 05a111ea2fa322bd843358146c8a2eda |
|
BLAKE2b-256 | 16f5230772f369e286e33f43c8cfd1312791f01a3b4ff2e4a0061324d23820b1 |
Hashes for whylabs_datasketches-2.2.0b1-cp39-cp39-macosx_12_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28212cf1aae97eaf178f72920cd83f26a0cf93f06c33ce12b3dc1a96b7fd4d5c |
|
MD5 | 66443d0cdf26254a49106651d6339caf |
|
BLAKE2b-256 | 93fb80e32fae61ea3ee676da716cdff33a57c9e7887571414b93a674ff4a530c |
Hashes for whylabs_datasketches-2.2.0b1-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fcf8d3a083eb6e3cb898f607a4a174f4edf7aab26e70a06fdd6d19af6c6c96f |
|
MD5 | ca6f3a1c0cb0be49e5f9852335f0d0e8 |
|
BLAKE2b-256 | dea50576400275a69fa0e77cc2388dbdca0ef12b9f559fe4e5e1b65bc2d52038 |
Hashes for whylabs_datasketches-2.2.0b1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 787e1d638a885179b1ff17505fee5dce5292d39eab92a8968f21a0b06c81a5ae |
|
MD5 | d613ab111e869da9c9207ca5bb36a667 |
|
BLAKE2b-256 | 329feaac711b0db3a52a9c0011cc734068ec4df93b4cc1475d23bc3ebfe26df1 |
Hashes for whylabs_datasketches-2.2.0b1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96d6b6187dfb8880479708e96e9f41e1f5437e704788235253ca883df641afea |
|
MD5 | ed99ec26274e1ab17bcb3892c9a002b7 |
|
BLAKE2b-256 | fa31e895ccb4adf7b15616e6e52fa127187dbf328ac0d67e354bac96be38403a |
Hashes for whylabs_datasketches-2.2.0b1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdde29bc2900237bc4959fdd20cb781c9343e1748ce1be012ba904c344ded3e0 |
|
MD5 | ce758dac717f8e35a876934938789e05 |
|
BLAKE2b-256 | 05fac2d835df4c313db9fa283b6f4d94d1888870ea02b2e0ba652ac61e2457de |
Hashes for whylabs_datasketches-2.2.0b1-cp38-cp38-macosx_12_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04893189ce99bd1b5ec1eb3dd04c33ebaba7a83cdfe6bd581e46ac46f86dc225 |
|
MD5 | 2f39be6bf923acd6a3aa092970eafea7 |
|
BLAKE2b-256 | 1f58c3d0e52cd343edd4f7488221ffbf3015728a1c69722409ee5716304ee54c |
Hashes for whylabs_datasketches-2.2.0b1-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | decf9b046d8b018da6c71119656604ca5002e32d66edd7efed349a00db22bf04 |
|
MD5 | 8b70d039e6408a2bfb89024b6e823dcf |
|
BLAKE2b-256 | 365d7d99160cc9e998b6632db346c31b91b4e67e50c7ce0ee3417511572079c4 |
Hashes for whylabs_datasketches-2.2.0b1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 090fa950c7d0c73c0ac1523b076e4194f04887c521b1b0cb59eb8af574e3c634 |
|
MD5 | 6b7efb385df3ef66a485dae1bc4f7398 |
|
BLAKE2b-256 | a63f848f3e3567a81ab4717029fc7063b79d437f316e5cf306a34ceadb12e504 |
Hashes for whylabs_datasketches-2.2.0b1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdbec6065d8b117d5dd0223668e615d9c8ff896a33fd834839f78d785b93bd4d |
|
MD5 | f57daa5a53136d6312c5ccec0efd5def |
|
BLAKE2b-256 | 21803cb9520d414b6c76fffb2eb7eb784b638dfc44b5ab478ea628454dae5752 |
Hashes for whylabs_datasketches-2.2.0b1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44c3e3d086567735fe2ca5b43f54d485056f84d7581356baa109b85f89be7f3a |
|
MD5 | 6c276b059273b51c7e71ee77b1745128 |
|
BLAKE2b-256 | 42186355487eabce3ac08d4bd09c7d75ee52c61618a32f9661a6f74f2c5c1b8a |
Hashes for whylabs_datasketches-2.2.0b1-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 444e43dee55d745dd20d4117c60e855c8cabe27cbebeac58b2b8f25f3564137e |
|
MD5 | 845ebe1c3ce5f2efe7f981185f09cb14 |
|
BLAKE2b-256 | 76724e9ff5e26473293ab3934344e48d4aa9df92cb030e0517bff200a8eb0735 |
Hashes for whylabs_datasketches-2.2.0b1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2345775b5671d156f2142fc7332dc4a9a3b316973fed5295399f8cf27a81327c |
|
MD5 | 681215f8a5db161e550dd2e6600eb41e |
|
BLAKE2b-256 | ba462cc5ed39f777254f25defe61296b09f58809be7ec8c766ae298476aa5b8e |
Hashes for whylabs_datasketches-2.2.0b1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b152189ae8f8fd4ce28a3f2cf42e0f396bb623c50d258a0e138e3b1e4b4ac246 |
|
MD5 | 6715c8d212226f8617274a6b201fb505 |
|
BLAKE2b-256 | 12e42ce7eeb101b916c046133a062f6a06b00722b3bb3dfdedc281991e1bf0ea |
Hashes for whylabs_datasketches-2.2.0b1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d41c662baab1ed4e4314de8db484471430723ae5c3b8a2ec84dc42c170a939e |
|
MD5 | 828ffaaf32501c1f4e83f3d92ce9471c |
|
BLAKE2b-256 | fd301497b9092574cbd60abaf040f593dc189085a10bde621931f3c168a7e9a1 |
Hashes for whylabs_datasketches-2.2.0b1-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa0536576be6cde3c06acbb3cad3cbfc56d13850c5b764e70fe4c71fe7f541b5 |
|
MD5 | 4f2a5fe2856ba510fec71224ba3ac948 |
|
BLAKE2b-256 | ec61b4ce193e2b4e6dfd392ef2467fdeebd6ea744ef5aedd297761016d2d9613 |
Hashes for whylabs_datasketches-2.2.0b1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2eecf0a2ee67480b0f4afd854e91931931dc2f7de801f6142769b76ba3f437f |
|
MD5 | 44f1ff32fd89da68498bbde831523725 |
|
BLAKE2b-256 | fea441f3d4ba6dc34aaa3da3e61989c744e70c155d51bfb95e6026240571bc96 |
Hashes for whylabs_datasketches-2.2.0b1-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 729367d3ce976975a6a986987b0287de08761d8bdedbcb37ef40c2a8ddbbfb18 |
|
MD5 | 986df2d56bb5a81637b57db774fdbd56 |
|
BLAKE2b-256 | 1f31803bd29b90dfc08c14447adaf6213cb25f02c2d5d2bfa1ab522a187f3087 |
Hashes for whylabs_datasketches-2.2.0b1-cp35-cp35m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2942e830341df19afab200eed04d9db86ee0dfbd00c061156521eb5233908b1 |
|
MD5 | 0246361eaebc2cde52c402de6a11bd96 |
|
BLAKE2b-256 | 9d6642d4d0e6c1925b6cd140c5d09f79b4fcd47259ff10ceb1c55c060a8647ea |