compress and decompress
Project description
✨ pydensity ✨
The python binding for density
安装
pip install pydensity
使用
- encode
import pydensity
origin = b"121212121212121"
size = pydensity.decompress_safe_size(len(origin))
data = pydensity.compress(origin, pydensity.Algorithm.lion)
print(pydensity.decompress(data, size))
公开函数
from typing import Any
import enum
class Algorithm(enum.Enum):
chameleon: Any
cheetah: Any
lion: Any
def format_state(state) -> str: ...
def major_version(): ...
def minor_version(): ...
def revision_version(): ...
def get_dictionary_size(algorithm: Algorithm): ...
def compress_safe_size(input_size: int): ...
def decompress_safe_size(input_size: int): ...
class Compressor:
c_state: Any
context: Any
def __init__(self, algorithm: Algorithm, custom_dictionary: bool) -> None: ...
@property
def state(self): ...
def compress(self, data: bytes) -> bytes: ...
def __del__(self) -> None: ...
class DeCompressor:
c_state: Any
context: Any
def __init__(self, data: bytes, custom_dictionary: bool) -> None: ...
@property
def state(self): ...
def decompress(self, data: bytes, decompress_safe_size: int) -> bytes: ...
def __del__(self) -> None: ...
def compress(data: bytes, algorithm: Algorithm) -> bytes: ...
def compress_into(data: bytes, out: bytearray, algorithm: Algorithm) -> int: ...
def decompress(data: bytes, decompress_safe_size: int) -> bytes: ...
def decompress_into(data: bytes, out: bytearray) -> int: ...
本机编译
python -m pip install setuptools wheel cython cffi
git clone https://github.com/synodriver/pydensity
cd pydensity
git submodule update --init --recursive
python setup.py bdist_wheel --use-cython --use-cffi
后端选择
默认由py实现决定,在cpython上自动选择cython后端,在pypy上自动选择cffi后端,使用DENSITY_USE_CFFI
环境变量可以强制选择cffi
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
pydensity-0.1.0.tar.gz
(133.2 kB
view hashes)
Built Distributions
Close
Hashes for pydensity-0.1.0-pp38-pypy38_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2bc8baa1199d7bf9c41b60982426a2199ccab81fe12df055beb78039be07cbc |
|
MD5 | 73c46d463c115a41cc55607f4b981099 |
|
BLAKE2b-256 | 7072acc61da0245788b7a49a5403cb7788f99d6d40f1aee34e489217aea3141c |
Close
Hashes for pydensity-0.1.0-pp38-pypy38_pp73-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75e4ad8595b87bf4050fb9f294073f29deb00223118acee58894699284527eb4 |
|
MD5 | 56cd98e1303cecf24a818b96d82133bd |
|
BLAKE2b-256 | cdeb410bd67f50d618f87b1b41f9bf964a9cef602e3e475f6a2ce4baf5131ee1 |
Close
Hashes for pydensity-0.1.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbb4f616cf01fb2fc6f778ced34696abc59d4c8f6c0fbbd759af5914076d8039 |
|
MD5 | 90fa58d18aff2ca744ef5c10219f6f09 |
|
BLAKE2b-256 | 53f89df9fc0bacf9e13054b25efa4488ba4e4af8cbba8b50207140868e373802 |
Close
Hashes for pydensity-0.1.0-pp37-pypy37_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f040d9f3167617d45a21e9ae6dc145da538715bb91d0f405f79538ee2f1bec5 |
|
MD5 | 9241df1684bb55576488169b6972ffe1 |
|
BLAKE2b-256 | db35ac45160fca09edac529631f8a80a9f9effeb52b666eb307dfaceb7363c18 |
Close
Hashes for pydensity-0.1.0-pp37-pypy37_pp73-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1907a8dca8711433085587895333619a3e695506c4e0f7fd2550543e57fff9f8 |
|
MD5 | 777508821c40a1f7705f17534c847355 |
|
BLAKE2b-256 | 3cf9ac9327cf3ab6db3c5b056e46820de265fd04d3dd24c883c1a184a7c890c9 |
Close
Hashes for pydensity-0.1.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e107be9c56fb468addf18c78b8ac081f3240633ac13174743f83c814d243404 |
|
MD5 | 43e38dc2004a851abcc1c62b3c4a0ace |
|
BLAKE2b-256 | dda1b69ad3ecefa668fd54aa4ef40c19b64df953c22cde4723105ec2f6dfddb5 |
Close
Hashes for pydensity-0.1.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cc6866087c47ff1fddd314a0f617b0b804ea88452be625e5aa48ae94652950d |
|
MD5 | 1b6310b537df8bd484f67b390154133e |
|
BLAKE2b-256 | afa50508db70fe9e929539b43bf64e9bd86bd20be2e47bb26189f9a9e2d9e0e3 |
Close
Hashes for pydensity-0.1.0-cp310-cp310-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cd2e22f5fe4f4a066a7439318c231463cd73809c69f6cc7c801ac30c3959761 |
|
MD5 | fcf7873dfbfcc3bbce327dd95f111d04 |
|
BLAKE2b-256 | e14012785ab27303539f8fa4b1852b832ec0d8905882fd94a858469a547da5dc |
Close
Hashes for pydensity-0.1.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa2738526fc84cc4128f71b72cb60ab70a9bcc6f5cdfe3068ad94f3456c9432d |
|
MD5 | 2f89542b8baaa9a778322e5ec76ca4af |
|
BLAKE2b-256 | f236626765bc6b67d6a736363e3929b7aa74203f6aae9c848f244ca6b33caf79 |
Close
Hashes for pydensity-0.1.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1294cb8d879d91dde652d083176c0c67f92700336d25fd91f083730412c48118 |
|
MD5 | 616a7ef7b1df276f857ab050314c45ee |
|
BLAKE2b-256 | 170625b4f3f16b1526bc381c269d6015cb582b98797fac780d1d3139d05aafd2 |
Close
Hashes for pydensity-0.1.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ff9d6f43cbae8c90657ff79747ffd083de228e5593cf00a53bb8b4a22b7562d |
|
MD5 | 4bf0c6e4f4a5e1c8b1f37d952202fd65 |
|
BLAKE2b-256 | f84d29464f49da2a410cd0a69a69c1f49ca511900b1b8bafd085489831488f57 |
Close
Hashes for pydensity-0.1.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da5bfce20568c7d2cebedf020ef614b4535e5117306220ac9eacf76821293464 |
|
MD5 | 06ef6d76c67febed690e616d5324b66e |
|
BLAKE2b-256 | afdc6ef6939c3085ecd12cdbd7093bec7dd3d2c1bddb265c9b72fd6919748ab3 |
Close
Hashes for pydensity-0.1.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d411e190be239438781a57e0f2149ea6210a3fafcceb3d5aaf76b8163887acb |
|
MD5 | 5b6ef964facc0c91bf1289c1526865d2 |
|
BLAKE2b-256 | 3df371487441a7f588c6f9c1ea2906fa29788af2aac179f1b5da2f6f4ed37bb0 |
Close
Hashes for pydensity-0.1.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bbfb54ddba531986a935c241b533db96fcd312cf8c7e8d056cb1f79ce854314 |
|
MD5 | de618175e8b879efc940d379368d8f7a |
|
BLAKE2b-256 | 334b6fb33f6c61e9322f82cbc6635ec70bafcb195972d13422a391c3b33e8443 |
Close
Hashes for pydensity-0.1.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dd4cc764ac58089ed2c0c4f74e73133e4329b8b1071f137e5250b9b32d25cab |
|
MD5 | 87edc900c719302303ce0250a1c2f7a1 |
|
BLAKE2b-256 | 12f8503d8dca52a58df1a55cbd46f4e7d4403e7bf470994d3a07f7e8fa297fb3 |
Close
Hashes for pydensity-0.1.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6d0d03af90c3f79b2b0c85f3ab7269f76ed3f703949f59bee1d45f52231c939 |
|
MD5 | 1c3150ae7d3f6b48628fbbde74566a0b |
|
BLAKE2b-256 | c4c1507d76c8986159358eab8eeae149629eea6293c08fd2953c3264732c695a |
Close
Hashes for pydensity-0.1.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 815b604750660fc63875c97ded6431a47e7964abb0eb47ccd1e2148c5e7bb93f |
|
MD5 | 43bb6e82735ff558d56a402ba648cdb9 |
|
BLAKE2b-256 | c62d25236e4b7d4cffcadebeeac2ee8aa5e3aa74611863a8dded1c1a84fca7f0 |
Close
Hashes for pydensity-0.1.0-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c01b60ef63910d897ffadfed19b0be7348accdbe5bf82b8de8a6521d17fed81 |
|
MD5 | bc4cf4f03e782bd16530330c34e83765 |
|
BLAKE2b-256 | 73c45dffdb3f7611338cd96356494f359b8eb33e218a7b7aaab35f4bc5b580f8 |
Close
Hashes for pydensity-0.1.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c49431c2b6da4b11dcb0e389cfe11b55659748d911ee09cc5b1b1efaee40a237 |
|
MD5 | 097dbc206eb979cd4ab40da58f824c3d |
|
BLAKE2b-256 | ead16f659453918b2bb63e2c2d065a59360e4785539f8ae48ee299c488233080 |
Close
Hashes for pydensity-0.1.0-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b0ef24740f9badc7d97c50e28b17dbf2ef885a0700964476924113a82013a22 |
|
MD5 | 8c3e58b71b8be18190f74da81881725f |
|
BLAKE2b-256 | 153741e9f2bb333cc851bf72d4eeb779a498cedf364996e2282fe2b8d8b82f20 |
Close
Hashes for pydensity-0.1.0-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12576fe4b816b665cf640eaaaad341f72469818746094123e466a5924f4fd798 |
|
MD5 | 311d6acde56c0e6a2f71a56a09e44d8f |
|
BLAKE2b-256 | a86a516935457867906de72b1c87e979885238e219253808b70944c2752bdb71 |