bz3 compress and decompress
Project description
✨ python-bz3 ✨
The python binding for bzip3 with parallel support
install
pip install bzip3
Usage
from bz3 import compress_file, decompress_file, test_file, compress, decompress
import bz3
with open("test_inp.txt", "rb") as inp, open("compressed.bz3", "wb") as out:
compress_file(inp, out, 1000 * 1000)
with open("compressed.bz3", "rb") as inp:
test_file(inp, True)
with open("compressed.bz3", "rb") as inp, open("output.txt", "wb") as out:
decompress_file(inp, out)
print(decompress(compress(b"12121")))
with bz3.open("test.bz3", "wt", encoding="utf-8", num_threads=4) as f:
f.write("test data")
with bz3.open("test.bz3", "rt", encoding="utf-8", num_threads=4) as f:
print(f.read())
- use
BZ3_USE_CFFI
env var to specify a backend num_threads
is only available on cython backend which have openmp support
Public functions
from typing import IO, Optional, Union
def compress_file(input: IO, output: IO, block_size: int) -> None: ...
def decompress_file(input: IO, output: IO) -> None: ...
def recover_file(input: IO, output: IO) -> None: ...
def test_file(input: IO, should_raise: bool = ...) -> bool: ...
class BZ3File:
def __init__(self, filename, mode: str = ..., block_size: int = ..., num_threads: int = ..., ignore_error: bool = False) -> None: ...
def close(self) -> None: ...
@property
def closed(self): ...
def fileno(self): ...
def seekable(self): ...
def readable(self): ...
def writable(self): ...
def peek(self, n: int = ...): ...
def read(self, size: int = ...): ...
def read1(self, size: int = ...): ...
def readinto(self, b): ...
def readline(self, size: int = ...): ...
def readlines(self, size: int = ...): ...
def write(self, data): ...
def writelines(self, seq): ...
def seek(self, offset, whence=...): ...
def tell(self): ...
def open(filename, mode: str = ..., block_size: int = ..., encoding: str = ..., errors: str = ..., newline: str = ..., num_threads: int = 1, ignore_error: bool = False) -> BZ3File: ...
def compress(data: bytes, block_size: int = ..., num_threads: int = 1) -> bytes: ...
def decompress(data: bytes, num_threads: int = 1) -> bytes: ...
def libversion() -> str: ... # Get bzip3 version
def bound(inp: int) -> int: ... # Return the recommended size of the output buffer for the compression functions.
# High-level api
# Compress a block of data into out buffer, zerocopy, both parameters accept objects which implements buffer-protocol.
# out must be writabel, size of out must be at least equal to bound(len(inp))
def compress_into(inp: Union[bytes, bytearray], out: bytearray) -> int: ...
# Decompress a block of data into out buffer, zerocopy
def decompress_into(inp: Union[bytes, bytearray], out: bytearray) -> int: ...
- Note, high-level api won't work with low-level api, see this
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
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
bzip3-0.1.5-cp312-cp312-win_amd64.whl
(392.6 kB
view hashes)
bzip3-0.1.5-cp312-cp312-win32.whl
(367.8 kB
view hashes)
bzip3-0.1.5-cp311-cp311-win_amd64.whl
(390.6 kB
view hashes)
bzip3-0.1.5-cp311-cp311-win32.whl
(365.1 kB
view hashes)
bzip3-0.1.5-cp310-cp310-win_amd64.whl
(390.6 kB
view hashes)
bzip3-0.1.5-cp310-cp310-win32.whl
(365.2 kB
view hashes)
bzip3-0.1.5-cp39-cp39-win_amd64.whl
(391.4 kB
view hashes)
bzip3-0.1.5-cp39-cp39-win32.whl
(365.8 kB
view hashes)
bzip3-0.1.5-cp38-cp38-win_amd64.whl
(391.6 kB
view hashes)
bzip3-0.1.5-cp38-cp38-win32.whl
(365.9 kB
view hashes)
Close
Hashes for bzip3-0.1.5-pp310-pypy310_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5da5215da0c5e03e554303dffc14dcb799f8927267edb41c273a6ec51b7344c |
|
MD5 | f2f3c4f32a3c742f801dac582de4e0a7 |
|
BLAKE2b-256 | 5ba5d75b220b142d144bbe8435316c10726d8912d768dc1ea66faeceb8e8597e |
Close
Hashes for bzip3-0.1.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a061d5ea9974c00d43d34459f52a2ac7e0382afede576ed2bf62816922fc77f2 |
|
MD5 | 97aad50cd6fee6a4d2b3d4c4839180b3 |
|
BLAKE2b-256 | 58617fa4e72b6db7238d6cf731234dcdb84d41401788f58047192a943360fb15 |
Close
Hashes for bzip3-0.1.5-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29c8a1bbe2cbc26896666ad7eb6c571dfb7bf00b5dcc97ad036643f442914715 |
|
MD5 | ba4f2ea64aa2c2f6e1ec5613de269baf |
|
BLAKE2b-256 | cc04b7b604b553b03c334afbc8e21db3f55859a977051bff544761bb2a1b2c0f |
Close
Hashes for bzip3-0.1.5-pp39-pypy39_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14b196d36d6444cd1692d6a62e6e3654cb7a5102325a7f7a73b051dc7ea90833 |
|
MD5 | c0214fae873f243911d95167edb32667 |
|
BLAKE2b-256 | 3a62b4c57008e3d93f653735cff50c8c3eeb431302cd97e98e5c15dcba4b9e21 |
Close
Hashes for bzip3-0.1.5-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce3384b1fe978eb32d7f99a2deb979f89476161f0882a504a38604da9329d44b |
|
MD5 | 81f520dcd279ed211c7c160f7c155f5a |
|
BLAKE2b-256 | ace05051f5d16e2b77add0156deba25f2550f09e4511022dadacdc84298eb995 |
Close
Hashes for bzip3-0.1.5-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f846b3ba1f4d5cc5fa0a9bea086aa6b13506804b78bc1a17ccda64a7c1003f7c |
|
MD5 | 2ab9527e868992c82c5fc90b650d8795 |
|
BLAKE2b-256 | 201c6662b0f47699334c0a360ba4f2d3d73d3f286693965dec51df4c3707ab93 |
Close
Hashes for bzip3-0.1.5-pp38-pypy38_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e15b43cd7fdf520c938a57b767ff44be505892c54958b7a96d2cb30ca0c34957 |
|
MD5 | c52901d398d0b3c9732b7590532e98a6 |
|
BLAKE2b-256 | 9188a73460c57d7b540788436152f9453a4ea4ec4aab6cf39f1bb3cf9c464068 |
Close
Hashes for bzip3-0.1.5-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 827462b08a47091474debd4d35db28d0d1494deaf0db161ebd48c40ca4d9676b |
|
MD5 | e9bfd4ac1cce9da4a2c34cae38381df3 |
|
BLAKE2b-256 | 3f2d51ad90f667ecc62c39e2a7b7597228be8a52d1bca9f1398f278de60a46ab |
Close
Hashes for bzip3-0.1.5-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24a804cf6403da6eea6117a93291629a3346b7be1bf20478dc9c4149e7e4d1b3 |
|
MD5 | 7a883935262e1e6f104c2fbdc31bcf8a |
|
BLAKE2b-256 | bb488d2779d8fc3192c098db2517d4631dbdf9068ab976738a50caf14b7821cc |
Close
Hashes for bzip3-0.1.5-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f81be71cd88e9822ff955325dbb39c25f852b0646b25fdbcf79a871103cd3d1 |
|
MD5 | cd851fcd837232c54a1d44886de7d1b0 |
|
BLAKE2b-256 | d39c1267b183d4953bd043e78e2f902550cad1ae22a309fc11a06849d8ff771a |
Close
Hashes for bzip3-0.1.5-cp312-cp312-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09589742ba10542e10d0d3859ec3e76b8b022c6081dae39cb4b937590971dc42 |
|
MD5 | 968d2b72292f2e99f8a41d1da2139d0f |
|
BLAKE2b-256 | e3ebe031fdc053fd9acc9d05d8a6690351a862fdfdc6fb38c95e280baf94438a |
Close
Hashes for bzip3-0.1.5-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54932f648f5c5d75dd0c3a08aca14d71b6333547fd81f38972cf971450b857fe |
|
MD5 | 897fc0e20153412ec95a44c176511355 |
|
BLAKE2b-256 | df43db852dfec7d94b526386f39d8f00acefb431916277148268a6c438a7f9bb |
Close
Hashes for bzip3-0.1.5-cp312-cp312-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdc8c16d8aebc893633b3b7bde9d6ca292dbaf47a3f6df2866e5a3b3102d9585 |
|
MD5 | 231eb7d3a81409fe95b5ff783b51509a |
|
BLAKE2b-256 | e229a91afbc5bc0b3352f656219b595d866c3b3c2f43384bee2d2df444f7fcb9 |
Close
Hashes for bzip3-0.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80ef3110a3c790acf68b01b4cf901d27fc3aa728047ddde2e4a4c6e7f0bc7f96 |
|
MD5 | 5f194ccf18a4fc0be916da0863cdaf34 |
|
BLAKE2b-256 | e45bcf30e37fac17fadb058788ddbef4e595a365f759c99a30fc7d2cf447eac0 |
Close
Hashes for bzip3-0.1.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10f9ea41610a16ac4c0af590ba8ab60a36df85f8b98f6ae51bdbb4262a5c0c7a |
|
MD5 | 94bc37b305aca1bb47dbad61feff180e |
|
BLAKE2b-256 | d5877a53c16685dbf7a1477e5db8df218053700316d965838a68de53e6038363 |
Close
Hashes for bzip3-0.1.5-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb701051600237bbe0a5cf0189ccac4e842126ac706d527ef0aa861cf3f14835 |
|
MD5 | d7d33e3946effc39342ba48921390096 |
|
BLAKE2b-256 | 72aa6ba60b027efb3ff7c0f5413f17a44ee3202844d9bdcaba7f154cabd1bc96 |
Close
Hashes for bzip3-0.1.5-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f1980f251201e68a78bf28786cbf0eaddc87bb1b57e995b5526c14a2d5d6e9f |
|
MD5 | 9bf47efd2e4d8dc83852e390a2fb9292 |
|
BLAKE2b-256 | 9148d08de6b1252f30d3565c883524272334f32f058a42a17fa0be71dd7ef312 |
Close
Hashes for bzip3-0.1.5-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0a36fc900753c4f62e99f2aacff4eed9b5ae485af72a380c3a99d19651c4895 |
|
MD5 | 432ca29e7a5ce5414107d75baf7e7be1 |
|
BLAKE2b-256 | 6a0cb361592d061b636984c235b30481d749d5b26e0f86ce445295f832c3470e |
Close
Hashes for bzip3-0.1.5-cp311-cp311-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6322062cc31958c98d7a8a6d2b2d926451ac3efa046a8583a4af0d5802ec303 |
|
MD5 | 33b56081bd78eabf28e99b9fe2a2176c |
|
BLAKE2b-256 | ec79b5a54b5944e3e106f8b267329ee99e386f2198cbab096685fc3af48990f2 |
Close
Hashes for bzip3-0.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b23242ff86a85a1c31779c511d9a142ebd46d70d9d0d8cb3b612ea65fd21834f |
|
MD5 | 56c3081a8a371df510bfcdbfc857dfa9 |
|
BLAKE2b-256 | 534c7d8509ae99080383ddb717ba13c8ea01cb47bccf347a6defc263e2cb13a1 |
Close
Hashes for bzip3-0.1.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f7111ee6488d27b181aaaf872e8e4fdaa9a08a5c3078bb6e85d3bc8f2e13c3c |
|
MD5 | f8748d784f2c5a5faa2d8222afc0a459 |
|
BLAKE2b-256 | 0fdba72af86f7c3f63ecbbb472cc711862b1356a2a1c6d22a5ba45c5ce762f5d |
Close
Hashes for bzip3-0.1.5-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f6666a277c86cfe87c6c2bb4b9f320199d61a99a54812ace452f5f54a78d308 |
|
MD5 | b2f79c321a7c9a7a87d4bb64ffc4e41e |
|
BLAKE2b-256 | bc60877e694389f89820a53e657be38af69f86120cd7ea510de545a76d0bc6fc |
Close
Hashes for bzip3-0.1.5-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a9bf02203a0ad0f00d57772bb8b33252991807fa7d0516aa7a648aa015f898b |
|
MD5 | a74090670b97fb2cd74c6b4dba14c523 |
|
BLAKE2b-256 | 95b1ac570958834374a22403da259d0e06655c8af3fddeaaedf74d5c173c399b |
Close
Hashes for bzip3-0.1.5-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50655fae5ef515be0169fb6d4f81a3ae64d6a07302323bf82e4c82e00a571d08 |
|
MD5 | 15fe5524dfc95ffca4fb04d271b9991b |
|
BLAKE2b-256 | fcbdca782423913b917975d9e06f4bfe7e2c92eaa677a9d4a6e28bea50b26a77 |
Close
Hashes for bzip3-0.1.5-cp310-cp310-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef4c0b59e0bd11d256fa749868119349adeacd172fa2922916f11579ebbdd89f |
|
MD5 | 7cca8efab4aaf81766ba25e0ab7218ad |
|
BLAKE2b-256 | eb88f3e478d72dcd3416b9f009eb47e9e7974e0f6f5fe1a332e34035eb437395 |
Close
Hashes for bzip3-0.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3ff0ac218bafae171100b8f8c13cdfa536f0601b33db39a91e3aeec54efe07f |
|
MD5 | aded37115dcbbac80ddac34098fa136b |
|
BLAKE2b-256 | 74a04ee102e0085e175e72ff441f32a407132046a94e4a42d4ffc1cbcbc6d188 |
Close
Hashes for bzip3-0.1.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df1bc67e39cc1e2111a846880232e81e89b18a7f2ca5e46c138040da50f0c830 |
|
MD5 | c41087f6e5f6b1b10f3ef450669443f9 |
|
BLAKE2b-256 | 3e10b410d6a3f8586efb933d99977880729b06a3148ef87a197dd5e0b628337d |
Close
Hashes for bzip3-0.1.5-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a31e0d0ce1455981523a95aec7f8ee765d6f570bfebd5ff53c7e86efe6fbe0a0 |
|
MD5 | 57552b610c18df6d43e4ef3d896109c5 |
|
BLAKE2b-256 | 10a77dcc271a3741e419a521a1898a7c0d89d419f512fae5ed87abf37be4f2a8 |
Close
Hashes for bzip3-0.1.5-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70e138dddde48f857c4e79447582372c2c377d15c0fb27d66c2b8e61720f5c9d |
|
MD5 | 88f4e28639aa50b4e035215bc7c35288 |
|
BLAKE2b-256 | 97acdb7e0056ad46e75be82b2ecd319cb827705108d5209cf56ef7756eb3440c |
Close
Hashes for bzip3-0.1.5-cp39-cp39-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91cdca8b09f30c1ece62298acdd82dd3a126543f24481466ea404ab0e113f3d3 |
|
MD5 | 9368debcf4f57361c3ad74c3f1e6d0be |
|
BLAKE2b-256 | c28012c614b8f50aaff6199a2efd5e428815948af5a28f0282ce15cbc2d2d587 |
Close
Hashes for bzip3-0.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40853949f1fd9d3df7c59a5b1270dd84b9eebb060ebdca4bf81fc257cb7c4b8b |
|
MD5 | d82c88aedf5a4c67690cc65e0db62c18 |
|
BLAKE2b-256 | e3c87f5f26bf3a3744b2737002e91b067a7f6a83a004251e2e2636d02b48f1d6 |
Close
Hashes for bzip3-0.1.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b3a7654a16bec80e855b849fc82593aa814fbde7336fb08041a02f01324c3b1 |
|
MD5 | 0a6a344b761dbaa7a430c1d69d60011e |
|
BLAKE2b-256 | fab74f13250a3742cc22b0c4757c748f83f0245f186407eeafea80d209d99548 |
Close
Hashes for bzip3-0.1.5-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 640c7bf52bf79d307f99ad31071fdaa7c3d0eb27cb98d83587845c97c655aaa3 |
|
MD5 | eefedb530bc5fe976ef2d25ffeceec52 |
|
BLAKE2b-256 | 6cef05559e2aabb54c363cab2d11b6ef24df5e8d1dbcbb669b1c58f10d449d69 |
Close
Hashes for bzip3-0.1.5-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae45d809bfe2344b65cb61625269146c769b61bff73521a65e87b186d2497500 |
|
MD5 | 7fbed97bb645c59c795fcc34d6e2ff38 |
|
BLAKE2b-256 | b020fb81150f48c1d4d43833926c4e3ff1f6c2acc227ecc23f2165c68e33ee8d |
Close
Hashes for bzip3-0.1.5-cp38-cp38-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed6f38d1a0988846161092692e5b19a17adc286470d7c3499affc98c182c6cf0 |
|
MD5 | c7b3d7504b516c7de5a5ba81fc834772 |
|
BLAKE2b-256 | 68c54bea520649599b941dad7e56a8554474d41fe4db7f68a019f05106f7f220 |
Close
Hashes for bzip3-0.1.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00f99be300eddae2db783bb0bfe404e9b5be9ebf06b6e3f8e8e879e17540bcd8 |
|
MD5 | 9a0ee2febe4b902916055f7e23c18f98 |
|
BLAKE2b-256 | a58421a74cad3da9c5a543b9d36aff2606e712fb1a0199ef3d8c0ccf817ed618 |
Close
Hashes for bzip3-0.1.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fb3edde764dfa0401e7066cf851150899fa50d5dad1bc78d2efce9bb9811e50 |
|
MD5 | 35ead6cbbf25cde1b752e8c9c05fa582 |
|
BLAKE2b-256 | 7049be593d67d8a95bbb4a84193a59b83d2dd3d4775cc56e8e4add623df23bda |