bz3 压缩解压
项目描述
✨ python-bz3 ✨
bzip3的python绑定
安装
pip install bzip3
用法
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())
- 使用
BZ3_USE_CFFIenv var 指定后端
公共职能
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: ...
项目详情
下载文件
下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。
源分布
bzip3-0.0.6.tar.gz
(179.1 kB
查看哈希)
内置发行版
bzip3-0.0.6-pp38-pypy38_pp73-win_amd64.whl
(265.5 kB
查看哈希)
bzip3-0.0.6-pp37-pypy37_pp73-win_amd64.whl
(265.6 kB
查看哈希)
bzip3-0.0.6-cp310-cp310-win_amd64.whl
(274.5 kB
查看哈希)
bzip3-0.0.6-cp39-cp39-win_amd64.whl
(275.2 kB
查看哈希)
bzip3-0.0.6-cp38-cp38-win_amd64.whl
(275.7 kB
查看哈希)
bzip3-0.0.6-cp37-cp37m-win_amd64.whl
(274.3 kB
查看哈希)
bzip3-0.0.6-cp36-cp36m-win_amd64.whl
(274.5 kB
查看哈希)
关
bzip3-0.0.6.tar.gz的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 114df18c0b2f7d6e39032d0b6a8f095be26e4500310c338021618a843b93c546 |
|
| MD5 | 0a3991fe614b9d4851d6ecb297052ac9 |
|
| 布莱克2-256 | 690c8a5e56328fc103a30316cf199ede58c4b40ad6e7e71060648b4f173502ef |
关
bzip3-0.0.6 -pp38-pypy38_pp73-win_amd64.whl 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 318d3aad14c22e6d4b59269f7446aa6dfb7c70ea1956892c28ba32be44ddaa41 |
|
| MD5 | 7b363b2255258dfe7e7188c2a7eb0b29 |
|
| 布莱克2-256 | 07dfe1ab13154b637eacc077b014ad615cf5e5ca544ff00250793bba4b1989a2 |
关
bzip3-0.0.6 -pp38-pypy38_pp73-manylinux2014_x86_64.whl 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 50dd513b8a26c0bbf681a491e6091e316cab42b650451975c27ddda4dff1f406 |
|
| MD5 | 7d153c1c3e7dcc4c28af0fd8ff0c17ed |
|
| 布莱克2-256 | 420778ec2b018437110b47a98fe6483d90a7c7b188e8aea09ebb06f53b6e81c9 |
关
bzip3-0.0.6 -pp38-pypy38_pp73-macosx_10_9_x86_64.whl 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 6f56466999f7d0f0e5d4c63a6398d01883477f6f7bfa31cba42b613b97df5412 |
|
| MD5 | bd627a20114ecf06f089669d7eb4d562 |
|
| 布莱克2-256 | 9c34352303ec7708f1b8579a6f9ab3fdccdc68c42d539e751708fc015d6d787d |
关
bzip3-0.0.6 -pp37-pypy37_pp73-win_amd64.whl 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 285d8f7abef12d8ece02c552887a7fc12863ffdf369352fdd384c3bc03d51100 |
|
| MD5 | ebc07fc984c26e5abf1183d55afb6fb1 |
|
| 布莱克2-256 | cd4dff990c5f61e7aa253c8e1e0b1ecab2080dd9ea3abe27e7ba437896455e09 |