bz3 compress and decompress
Reason this release was yanked:
wrong cffi backend
Project description
✨ python-bz3 ✨
The python binding for bzip3
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") as f:
f.write("test data")
with bz3.open("test.bz3", "rt", encoding="utf-8") as f:
print(f.read())
- use
BZ3_USE_CFFI
env var to specify a backend
Public functions
from typing import IO, Optional
def compress_file(input: IO, output: IO, block_size: int) -> None: ...
def decompress_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 = ...) -> 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 = ...) -> BZ3File: ...
def compress(data: bytes, block_size: int = ...) -> bytes: ...
def decompress(data: bytes) -> bytes: ...
def libversion() -> str: ... # Get bzip3 version
def bound(int) -> str: ... # 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 Distribution
bzip3-0.0.7.tar.gz
(187.6 kB
view hashes)
Built Distributions
bzip3-0.0.7-cp311-cp311-win_amd64.whl
(285.9 kB
view hashes)
bzip3-0.0.7-cp310-cp310-win_amd64.whl
(287.0 kB
view hashes)
bzip3-0.0.7-cp39-cp39-win_amd64.whl
(287.8 kB
view hashes)
bzip3-0.0.7-cp38-cp38-win_amd64.whl
(288.2 kB
view hashes)
bzip3-0.0.7-cp37-cp37m-win_amd64.whl
(286.8 kB
view hashes)
Close
Hashes for bzip3-0.0.7-pp38-pypy38_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d90097b6d73ed5c9accd27e405bf760c1a673a3c11a48f5395cbfb3e418a03c |
|
MD5 | 8d2b935a8e27011e45fae6f52fdb8fce |
|
BLAKE2b-256 | a80f77e5f790856148aeaeac1190daaf5f4fec863d598ac3f0a5eff5a0643a95 |
Close
Hashes for bzip3-0.0.7-pp38-pypy38_pp73-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 417385832da188422346855deaac8a14a92fed31a595bec4e4eb52d8baa0fc07 |
|
MD5 | caf0e552e20d90302f56294713e7086e |
|
BLAKE2b-256 | 3cee289adb47cc0d62cfb70893c72c4163bb09e93f3d70d758ae55e5e447abae |
Close
Hashes for bzip3-0.0.7-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 136e0c4ea75bce5e3a903427d95e8ca8a85ae83227fd64fc359bf790200f3309 |
|
MD5 | afe8d67dddc25b6242fd1e330118f226 |
|
BLAKE2b-256 | 0bea566435fcb236feb84cddddcb89874e1a15231aaeaee4de125f52419f1586 |
Close
Hashes for bzip3-0.0.7-pp37-pypy37_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8c6d6c213c97974feff0d1fe205a07815bc97dc225198d42f6f2239b3d97cc1 |
|
MD5 | eb4e23ba40224b005eb3dae8893b7195 |
|
BLAKE2b-256 | d7644b26b6748f91e541ddfcb329a55a889682047a3ee4bdda0ea16b2a5fb4e0 |
Close
Hashes for bzip3-0.0.7-pp37-pypy37_pp73-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a451bf5e54e1c0e27b38c4a430f3bee4bc26158c7fed3eb553eb3de39d807a0f |
|
MD5 | 3dbc286e7e5b16ce61b503ec4e9634e7 |
|
BLAKE2b-256 | e84211d4a9d91c8319b504ff4143ad0abcbfbcd9f9defe2b7dc068480bc9d0fc |
Close
Hashes for bzip3-0.0.7-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a9776ae4f86972e12c98cf74b012b6bd634cbac479eafbc1d00674f3613eedc |
|
MD5 | 534e3850ddc070f9b8e2bcb69f43e20c |
|
BLAKE2b-256 | 18f46975365bd944167cf113d851fe93e7dc9334df14ade6a0c379878c0292c1 |
Close
Hashes for bzip3-0.0.7-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 159289708d6c137933e0c93d0af847511727aa5c50cc9ec3c5a63cf8541f4e7d |
|
MD5 | f835cc441b9d5f469e18f644d9526762 |
|
BLAKE2b-256 | 523c550dcd8c9c20dabd7124f9f5b8023f1a18f78b6316a3da7b236925a24f15 |
Close
Hashes for bzip3-0.0.7-cp311-cp311-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77b83d7291671edec5f6f32960bb2bdef39804f73a55178e9e87034ad3784992 |
|
MD5 | 767512166aafcd876ea5a8e25b877418 |
|
BLAKE2b-256 | ea949a95d9a8d7dc8b67c0a421b8661b39d3bc59d27f36e92debcf039baf110b |
Close
Hashes for bzip3-0.0.7-cp311-cp311-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20aab473e7b3a025453c29ca2d8926f39e929f5dc1dc40b8aeb5f1d7296d0c0f |
|
MD5 | d46a513c6e98ff80eb15f07d2764ed67 |
|
BLAKE2b-256 | 7d9b79b02822d89a5034519587510ee9c29427039bf76914a6a0fb3b57235c74 |
Close
Hashes for bzip3-0.0.7-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f1d413be345b42ec452bf103d2747a47bc33bc84574a42304dc5bdd709f982b |
|
MD5 | c36270d7ff93b7b5d6e79d8968828648 |
|
BLAKE2b-256 | a8cbdb477d5cb7140001f2a50b2a98868193d66720e7e5ce2ffad38731821d86 |
Close
Hashes for bzip3-0.0.7-cp310-cp310-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6037d7b7b9888b30dab72e3ae489a6bdc5c3a6e9f4807411cd15236bc8935a22 |
|
MD5 | c80166c2a9585bb92c20abb743ab3b6d |
|
BLAKE2b-256 | a0761c3a1acfd58a2ce4f4b6dc5e59635cdafd82201f05a728cad30d47e51a58 |
Close
Hashes for bzip3-0.0.7-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d515c81684e507761bf9b655017b5ec9338c1852ccfc1c3a7ec7a0ea8d767da |
|
MD5 | cdf3f80d248f5939afd025db6d23a43d |
|
BLAKE2b-256 | 90b787c6d8f80bdad659e73c357d0e774d4e786fc862187c54a1bac70a42116d |
Close
Hashes for bzip3-0.0.7-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9e2cbb76dbae1c3cda041141845c5628d800012d40fff8c3151b398c608b53f |
|
MD5 | ef583d31369de7b532c24faa6beee919 |
|
BLAKE2b-256 | 6857089d6e64d03f0ab72df3faf217626e53811d2e50d59f38b82668dc14e713 |
Close
Hashes for bzip3-0.0.7-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9bca3ba15cfdd1f12e76bab5ed4353358a6f51db935a242c9c556c3643c3afe |
|
MD5 | 881f491b4c1802b3ef1f6ae2c4a06bfa |
|
BLAKE2b-256 | 108784fd0015b36f593c2e6406e61ce8c0dca93e5a336ba216ac205530c2200d |
Close
Hashes for bzip3-0.0.7-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc210c85663810373c6dd280be054920cfe11bb9850c5f908d089bee0b2c67ad |
|
MD5 | 7486491a435f440e4be9706f2e76d295 |
|
BLAKE2b-256 | 88f5f0136b85b0267010e990c1469a711af9d2be540b076086e169ae7a97603a |
Close
Hashes for bzip3-0.0.7-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0d4e70f9f954c11587b2a3098c51ebef1601d66e62549975d539e35790aa632 |
|
MD5 | 2283f12ec8d46233055203365a4c0cd9 |
|
BLAKE2b-256 | 2594ec193a81302196c9c6c5b1c0adb7bf606cd0bfb38c169d469f488e8b925e |
Close
Hashes for bzip3-0.0.7-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ee47b9c1479b8b06e44e3faab98ac98d02219f20e597c1523f5085ea402d73e |
|
MD5 | 2e6dba36660241568c310b14949413db |
|
BLAKE2b-256 | f1612e71286b875a10dd2d7938152b2c17a3c1bb8e605cb71b1f93c4a5dad9a0 |
Close
Hashes for bzip3-0.0.7-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e33f82b94947c4c2572b5f9b5731818d2cb242c13f985e603decd9ab05c5eb0 |
|
MD5 | 299aac005c856b557eefccbe78485804 |
|
BLAKE2b-256 | da181b2566cada044288621e0266559f85d991774f0a9b9d1309331348daa7a6 |
Close
Hashes for bzip3-0.0.7-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa9560fb90de30936225994123644182727c46becdd3664d7e475cd1588afb3a |
|
MD5 | 5346208bf01e690b3233c9dc9cef89a8 |
|
BLAKE2b-256 | 2fece0c8fb1e94dd1c0909d5ab039facceecb0ef6e62bf468964d9c6b0c04f77 |
Close
Hashes for bzip3-0.0.7-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cabaefdaa19fef017bf0bc0f09335c5c376e9b2b6f7e8e1fb2913484268ccc8 |
|
MD5 | 7abaaa98af0856c621d6e69aba63ef47 |
|
BLAKE2b-256 | ce2d11dcce6e2cbf8a524178369c9e1fd67c8526e8e800f7a584d259553518ec |
Close
Hashes for bzip3-0.0.7-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09bf42a60310147c5124c988b0ffdf56e1700bcba3d01c3b5db7ce5e2efa4d9f |
|
MD5 | b49a4c80e7bdf177ed18382edaec7e9c |
|
BLAKE2b-256 | 18476435a97877468230880bd4f11f95a003e5403f7538ec5edcb8ccc3cea446 |