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.1.tar.gz
(133.2 kB
view hashes)
Built Distributions
Close
Hashes for pydensity-0.1.1-pp310-pypy310_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3963fb2204cc4ec6e85b0ccd427723029617fa05e7e7096f49b111b10269600b |
|
MD5 | 208284ef935633903d37fab5ce9b61d4 |
|
BLAKE2b-256 | 5ca2ba79a4c74e485a2338690a2e0482dfae7d4e085039e5c85de9843ecf135a |
Close
Hashes for pydensity-0.1.1-pp310-pypy310_pp73-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba1c6fe0d393489d26704f2013ef365c3a80983ee15ac2dc0485ff68d8e2948c |
|
MD5 | 312e51186dcb44195d3fb3d2e6d7593e |
|
BLAKE2b-256 | 12c1c1b811412b82e34139fa5b562d30e051b11f6ed47705cf31544101fa11f3 |
Close
Hashes for pydensity-0.1.1-pp310-pypy310_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4b8e1aa74a8368bf7f0acd454aa56ec4e95d3d897166918d8b2a85f24210f00 |
|
MD5 | 9742c2678485dddd4190bcd236c39fff |
|
BLAKE2b-256 | db92bd93e5c96e9080ca3972bffc71edd4622c674704f09187279eb9dcf97508 |
Close
Hashes for pydensity-0.1.1-pp39-pypy39_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f262fa4393b75e7e72c8c5f89c3d6f33828247faf7bc4ab4872ba76655df1c6 |
|
MD5 | d809bf8219195a741aa6adf41b3aa80a |
|
BLAKE2b-256 | 8bad96bd14179ba27e5d64ccce8ce9bb0b56bbcb9188dd17afcd464801117070 |
Close
Hashes for pydensity-0.1.1-pp39-pypy39_pp73-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 650adf4e02fcf49028f183302ff0c9c832dd0e0e949ecafb1d014f8d9451f193 |
|
MD5 | 5d8b35b67c450abdbcee507683816f2f |
|
BLAKE2b-256 | ea052f1f97df6b0ab26dc79c14c19b24609490f34c7db2a08932b2aeb8387911 |
Close
Hashes for pydensity-0.1.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f1d3a792f1d37161f4a1d44e139b96454d97638b952d2a7905793016450b262 |
|
MD5 | 1ad7fce255b3969ae1f9db7dc6f1375c |
|
BLAKE2b-256 | 284e61cf266870be990cd5c8b2b85e121417aa7bbb2e373679c488f128f0f919 |
Close
Hashes for pydensity-0.1.1-pp38-pypy38_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70d3df889e7ba52de7f5b2a8616a29deaaf0b7b23604f01a1619961104933d6e |
|
MD5 | 67fea9ed3ba94fc60fea4d80862b1971 |
|
BLAKE2b-256 | 8b1dce9b87836ebf44add92a263bf0bb5e71710878d0975a6d43f4c083ff1aa5 |
Close
Hashes for pydensity-0.1.1-pp38-pypy38_pp73-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9411dd02d01013197206b85136734b22f40b5ac06abe0a990ccea8913181340b |
|
MD5 | 28dc7670d1e63e151ca888a1805642b4 |
|
BLAKE2b-256 | a4d2a56d1c217cce73d955f0840f41c19b8fbf592d891a4fd20d6894f40323e7 |
Close
Hashes for pydensity-0.1.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 663103d2c44fdb564d77dbfe1d712637cec7eafd9c2cd00081bea8ef3583939f |
|
MD5 | c03090a0d84cbc16fea54c4b32e9e68a |
|
BLAKE2b-256 | 5387e6e8d3d59f5b3de026cd6916345d1789232e53b8b61c6fddbfb781aaf7bf |
Close
Hashes for pydensity-0.1.1-pp37-pypy37_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54176a15f5e82953a8f02ecbb9aef95db92cd733f4387303db4ddac68e7c1922 |
|
MD5 | 0e2c6af67aba8f197633152dafebc065 |
|
BLAKE2b-256 | f238a3741db03a21b452dfba3ed2dd660a4f9e217445b506dbb22fafca20d217 |
Close
Hashes for pydensity-0.1.1-pp37-pypy37_pp73-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4195fdde01ee9afef94dc9531831b08e38bf725e6459ab73b3a33dd829444400 |
|
MD5 | 640a6dc9790d8f1f10aee4815ee38354 |
|
BLAKE2b-256 | b4afc76ae1b1bc488c18105d94a2dd90e63aea07974d4ad0ad0704f9cdb0a850 |
Close
Hashes for pydensity-0.1.1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bdaf43ebfe97fdfaf56a7e0fbed95d339e2be4dc1911093441507d16a843bbe |
|
MD5 | 071133547668ad38bfb5b06f084e4aa7 |
|
BLAKE2b-256 | b84bb2c03b3ccb627bf75f5428cef6da815704943193fa3d1893993c587fd29f |
Close
Hashes for pydensity-0.1.1-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0360a18ad1d1a6fd2dd6cabe49c433504ea972858a6a3e29de70dd72b950fb63 |
|
MD5 | 884f94a3ba5437c7679be14697d5fae9 |
|
BLAKE2b-256 | af9d8055fd5237cf4a7a9f72a50de5213b98ccc17a4aaa95af410b7efcfc7c9c |
Close
Hashes for pydensity-0.1.1-cp312-cp312-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32da0fe61ca0d7ec06161bdce8c2a213b0ba5a21eeb455d01ddc4a88e73cc6c8 |
|
MD5 | 42b1608cfd8414a8ac77feaad1eab3f6 |
|
BLAKE2b-256 | 331086934ee2bc724132473d0c4c006fdcf1e3b585722eaaa08fa698deb59660 |
Close
Hashes for pydensity-0.1.1-cp312-cp312-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 653e5b7b437287aed07c36c1bf912cdd41d514f7343b7e1ddb00fb78ed27b8dc |
|
MD5 | a51764d1d8345a441c78f75d4c041b1d |
|
BLAKE2b-256 | a54cbeb73e77e3c96bd74c15f810cf9d7475f230c8b16ee66e4894f1b0bc31e2 |
Close
Hashes for pydensity-0.1.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87effe3a0a417a8013e166e2199eaa77ac8221cfd2bf0f76be2438181b79c9eb |
|
MD5 | 07df610b0bf0d03d169dd7453668eb03 |
|
BLAKE2b-256 | a95e0ce4b8bfcca128fca37aec5cabf5744b882309e6746433908ef6e8229aaf |
Close
Hashes for pydensity-0.1.1-cp311-cp311-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 227b8b169a29072f86116411178f3cb4ca3cd67ca696d4d35fce45685ae3c105 |
|
MD5 | 7e571025ac14f1fd280df2cec3be5855 |
|
BLAKE2b-256 | 64cb2538942aee887615f474ee07e77172897f52cdd7f8cc9bbd5cf2c388b68f |
Close
Hashes for pydensity-0.1.1-cp311-cp311-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18b0f3d1bf00bbc29da10740e6110f8cb32a11eadf23889d0ac8b8ba6c397ca6 |
|
MD5 | 4c0e55ec85886dc472598751b4d74897 |
|
BLAKE2b-256 | aae6c5d3db34e557ccb519bb7ff655ec4a4494c1553587ce8a8bfc8b85783742 |
Close
Hashes for pydensity-0.1.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b21ea6a0389caea6fe932affc2cc1a04d7718075bfe1e2305fcba870668190e |
|
MD5 | 36ea444500ae4d7af4f3a4111419b60b |
|
BLAKE2b-256 | ea1110ced67986664741dc0ae02561baa024ccbbfb2cfbb5d41a9c860f63c29b |
Close
Hashes for pydensity-0.1.1-cp310-cp310-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61d107f99565a519bb3e19bb7cd5390dc75c8da1f6f0b0cfcca1fa8249efaeb1 |
|
MD5 | f952d37b663a9effcbbf549856bdcc60 |
|
BLAKE2b-256 | 859b11c7d02ecfcbb635aee6880a3779914f71f38648d3426e0469467feb64c9 |
Close
Hashes for pydensity-0.1.1-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 650b4ec7b2688305b2678b7f327ce56de10f5713ccceba754af5e8af1873ca80 |
|
MD5 | dd1ff7df6955890252f616d065749558 |
|
BLAKE2b-256 | e03e3a35d8dbb745c2535a8349a5a3e0711ae144c07000249464bf978229c58d |
Close
Hashes for pydensity-0.1.1-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f40e3bca0672119ffe5815608df2e1aa89662de45ef04d98b6b11196e6abc56 |
|
MD5 | 89570612abe1f2865904b503552d84a4 |
|
BLAKE2b-256 | 921eef96ea1b0b8764d590f9598a3a60939a1e09b102fd975a51d7648d6106b8 |
Close
Hashes for pydensity-0.1.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5544cbd1f446d8025f48bba0bc465296a2d735f0896560a6bc630aaf4e45ff57 |
|
MD5 | 15d91329650a4db356a051595e541ea2 |
|
BLAKE2b-256 | 23b82d429bc6499af5201a3b10bb04cfbb6e00cd370fcb84461ffbda0deb2986 |
Close
Hashes for pydensity-0.1.1-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6793c1c70167734f1ebaf14294f67fc2f27f2309f3c4dc6bff559754836d6d8d |
|
MD5 | dd929bee711bae7ff1b06bdcff78245d |
|
BLAKE2b-256 | caaf02287ba9034c515c499904efdc9f105f3c263860b81ecaed8ebf48673fce |
Close
Hashes for pydensity-0.1.1-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 236c0d906acaa7616cf9141c4a2843bbecf0f5b106d33d4e94a37aa5c69e3a04 |
|
MD5 | d26d5224924e0b3dc686d78c04c718e5 |
|
BLAKE2b-256 | 779d48c93bcf285d4a1e1ce8c1819a0c148af96ff6b1e4c1001317f87073d412 |
Close
Hashes for pydensity-0.1.1-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30947cb2cdf00e3a8c084d0912cbc0d8f9e89af95a2c8c69f57626156197ea86 |
|
MD5 | 6f7dd874a757873a2dcb91889a8a6835 |
|
BLAKE2b-256 | f748a349d74a00681e84174bf4565f435908cdc22b9e1e581ab2c74fa9b56ad7 |
Close
Hashes for pydensity-0.1.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da590981eea5deb35eb38fd90aca809d1719ddf25d05df2615edee418f50b667 |
|
MD5 | 78bc9feeb91bbc1dcd2fc021b6a4b364 |
|
BLAKE2b-256 | 9a65be64681faff78fde13680faf39d9caf74c7128ea7ae9e9ae60af9005d42a |
Close
Hashes for pydensity-0.1.1-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f96e57505b10cde45477523d0ccf9fb2b7c69da817b5f44b07f7a36f05fd71b0 |
|
MD5 | c988e280bf5a5dd8cd37f883ce936530 |
|
BLAKE2b-256 | 6b3c8903c8b8c831445bc1952a3bb47d3ec7bddf819f8592849b3f60a1c61256 |
Close
Hashes for pydensity-0.1.1-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e48df6d51e619834d817a5a4a82ac8e04b96860b3353e4709b45d53366efa657 |
|
MD5 | 659fa33e1fc494c1d25082d86a8e58c2 |
|
BLAKE2b-256 | ff8a90fa271d08d471eb3df697dcbac2693d68af23d5cba90f45928bb1befd9f |
Close
Hashes for pydensity-0.1.1-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0ff7e669e8f9b671a8e46f0e7a2a05e92d36abb6029a2997bbf6d504542520f |
|
MD5 | 45a958ca8b1dea18f735a61114b828cf |
|
BLAKE2b-256 | 6a36f50511c37af6afb52dabeb16e42768ea822dda1a69c0a31fe9e2f7ff1182 |
Close
Hashes for pydensity-0.1.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d080b7c8247879e5354ef49c6b3f9de7be8ebcc6e7207e9e8e120670cb9b6d8 |
|
MD5 | 20c55619ddff37f01f7e17e35b091708 |
|
BLAKE2b-256 | d1dca229f760a009b2e5b8b844114014b676a3e37c10dee964fc8e83bf063ef3 |
Close
Hashes for pydensity-0.1.1-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6f8d01a2f61ae6d4f9411e06f0ceaacab76f62ad26757ac0bb76351d77ae03e |
|
MD5 | 6235c09958c70bee71e3610146c1c854 |
|
BLAKE2b-256 | a1066c149b0b8dd12d20def55cad31795ffab8937e84f9c187d94af5cb40d7cc |
Close
Hashes for pydensity-0.1.1-cp37-cp37m-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a96b44721b136eaf62089198b9659d2b5c7e378ababb3edd3ca992c35d7910b3 |
|
MD5 | bd508cc81a64b8b20f920e823ddc3966 |
|
BLAKE2b-256 | 838e646a6d2e1321cf1ab3f09dec73b68a608e55de87406891be611bf617e79a |
Close
Hashes for pydensity-0.1.1-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 765acc87fc157c78b29c4329bdeab15e5102b4987462a0e822291ef0ad11b73c |
|
MD5 | d633656ef6db5f6a56109892f02aa218 |
|
BLAKE2b-256 | fc362c1b7cfd2ce99a396361ec713e6d7e4cb4facf8cb06c8c3fe80de4d6a257 |
Close
Hashes for pydensity-0.1.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0639b24dfe1d604fa03459818dc1d89125b73aba4e4da3c02fd2ae69ca67ac5 |
|
MD5 | 4143fdb52869bfd04b38258d66c18b0a |
|
BLAKE2b-256 | d0206a8f9bd1ba80a5f973a0d281325db4a889526973ee2223ab76de1fad4c3a |
Close
Hashes for pydensity-0.1.1-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab02ccb62a203f61e2613ed937278d1159e575fb726ad3a6d59a18b6b36b2835 |
|
MD5 | f92f95634e0d61040a5bb4f7ed3f5424 |
|
BLAKE2b-256 | c21f26cd87a0e5df91c6b59896bf272dc92a5bbce7e802a7454085fa716e8bb6 |
Close
Hashes for pydensity-0.1.1-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dfa24f162209d44741415e33808b03f02316cb99bd923cb8c84f79baa9a94ad |
|
MD5 | 6af4ca7407e871b47a82aedc6d29f476 |
|
BLAKE2b-256 | 1973a5c5f0dbc278f4522a39f519b754d0fcdc2d6fa3e614939cb6d6688a76d6 |