Utility for randomly accessing DEFLATE-compressed data
Project description
ZRAN
Random read access for gzip and zip files
Description
zran
is a Python extension that wraps the zran library, which was created by Mark Adler (the creator of zlib
). This utility allows you to create an index that allows you begin decompressing DEFLATE-compressed data (ZLIB, GZIP, or DEFLATE format) from compression block boundaries. This effectively allows you to randomly access DEFLATE-compressed data once the index is created.
Installation
In your preferred python environment:
git clone https://github.com/forrestfwilliams/zran.git
cd zran
python -m pip install .
As far as I can tell, pip installing with the --editable
command is not valid when the code needs to be compiled, so you will need to re-install the package if you make any changes.
Usage
To use zran
, you need to:
- Create an index for a compressed file
- Save this index
- Use this index to access the data on subsequent reads
To create and save the index:
import zran
with open('compressed.gz', 'rb') as f:
compressed_file = f.read()
index = zran.Index.create_index(compressed_file)
This Index
can be written to a file (index.to_file('index.dflidx')
), or directly passed to zran.deompress
:
start = 1000
length = 2000
data = zran.decompress(compressed_file, index, start, length)
That's it!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for zran-0.0.2-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c9ac74ad0f9b12841bf5b6496afe8af2ed1e399d6fece6edb80f37bd59b5f55 |
|
MD5 | a9eab0c20954ab26bcef65474f6c40ec |
|
BLAKE2b-256 | 2a726a9e18a5b829f4e33e2bc2a1d35fea2e2dc1036f7b91ded6d66aec9e117c |
Hashes for zran-0.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d24b66e51f6f805dc3dff96f0d42683b5c5787af8f82b6707e9c51a4b3d2f40 |
|
MD5 | a2c7a0fdab40b837283066f800ffe8c5 |
|
BLAKE2b-256 | 7c770514b41f7706afb942758a4f56c028942796f40844e4bc8065380d504381 |
Hashes for zran-0.0.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9fdd1c32603b366784fd011e32828195dbf81547657c4906f52d50e505a11c3 |
|
MD5 | 9563441a73d44932f835adbf4c066fc9 |
|
BLAKE2b-256 | f6aa8c9e2696c965d31be2adc372bc3ad5cf4ea70a5522fb907f1bd253ab02f8 |
Hashes for zran-0.0.2-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77332ff30ae217e041f5d0fbe64f24286e3656a4188a8641ac1c6f71f395f465 |
|
MD5 | dfe1ae7d347ffd9980b21b6acde4091c |
|
BLAKE2b-256 | 287c6caae7bde35a16ed7b99b1de54708f3230a2e91221901ddda3c65e41a9fc |
Hashes for zran-0.0.2-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86afcaa202f5fc5b0a7a487a2f89101cdd79ccba77bfe7c6b03baa656b606eb9 |
|
MD5 | 96d12293fe32ee29d39f77ffe054775a |
|
BLAKE2b-256 | 011d16c87ae818b71c1190cc3553a543f7c8567d4e397940bf1c011f616d2384 |
Hashes for zran-0.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50d076817543127683f5ef2fd7ba2f1b38c40f6bdceadf375572a61ce4aa0e30 |
|
MD5 | 85ad209e5d6bac8de78a1393a1c1a60c |
|
BLAKE2b-256 | db946b82ac6866336a66afb51931ac5f392b1e34eb1efa058d83cdd251e4bda3 |
Hashes for zran-0.0.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e931cdee73503e65e7bc902ecad265789cc6137d01bdc28b88e3516b1a8bc36e |
|
MD5 | 841ca00528ca5b9f9ac28d2b20cbb41e |
|
BLAKE2b-256 | f059934ebae9e01bc0d7a920555d27b60cd3ebad1ba9a92c3e14fa34223c3fb0 |
Hashes for zran-0.0.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c62ad67f2ab268bf2c156c38df235fcca2b0bf6b0ee3ec45e93f09239cb979c |
|
MD5 | 7ad306960e3f4b8e21d9cc31a596ffb7 |
|
BLAKE2b-256 | 3a1ebe2ab2b247d582f14bf6ca01b22402697d0962c41fc2c7542c04c197c810 |
Hashes for zran-0.0.2-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f37efcf0e622fede8f85611f3617fdc4f3b12ca18b895569da2ca2a6c218d8b0 |
|
MD5 | 02fc3522946dc470c2e838e9d81cd2dc |
|
BLAKE2b-256 | a7b6061dced60c24e5002c541c94f5c011b6f7bbb392e91ae6a136d3d90b57b9 |
Hashes for zran-0.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c14a4ee2edc1d754af5435962483f9a33eaded498aa5adc2b5be08e2c2022ed |
|
MD5 | eb698771209aa1acfdf742032b85fcdb |
|
BLAKE2b-256 | a05fa97230fd36fa949bcda8738f000a5484d3adc539fa99c3c9522a662dbcb8 |
Hashes for zran-0.0.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf82173a0602bf330f87060b9fe516c870af14674023f0ca0eadd28b1bb77c3b |
|
MD5 | 030d96cadf01078005a1b1c8b47919d7 |
|
BLAKE2b-256 | 2be9843a989840eafab0c3aa7beb518daee4a41553064f16c055e8254b8fa907 |
Hashes for zran-0.0.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65fc2a30c6930f5f656e99e442efc56e3e38b2f1ae105f66f235ad443c86a235 |
|
MD5 | 9d4d1f30c83dd1ddf0eb33c8dd7e1c9d |
|
BLAKE2b-256 | fd283282221366980b5714b1ec7f360f5e5dab82ca83f710854a99d9fc6357db |
Hashes for zran-0.0.2-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4df0d6c67f897ea6913abcc91c5042a358a031f990c8dbca2dda5737ea78c204 |
|
MD5 | d987af0d7a791a2fcc314809dce89380 |
|
BLAKE2b-256 | 42ebd9e540f8071a376038f1f1aabbfa0f387b10d38bde1e17de7b906db09ba0 |
Hashes for zran-0.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b20a8f359404cc349e7a8fd878492c7899d0c713a464463deceb192e43305ad1 |
|
MD5 | 90f347ece8b5dec679920fa9311f89c4 |
|
BLAKE2b-256 | 9aa1ffb208717e58b32bb50d3158fdfebf66d74dc1e83f5926ff169b5b134995 |
Hashes for zran-0.0.2-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aece31db6555dae6821dafabf2d454d4f3903bcd99d15a308657f49f5a4d1fce |
|
MD5 | 9fda91d4ca2e0da3b738d9bce8074baf |
|
BLAKE2b-256 | 92389b385b2fe53c36cb7740a9e94010cb51fec7c6017bb657f37466dc242fa3 |
Hashes for zran-0.0.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 650bd4143a2d63ceb8bbfb6e1e5f8ae7f32de13daba1087d3f20335febbc5491 |
|
MD5 | 99e572fedc9063bf2af685a630bcaa90 |
|
BLAKE2b-256 | 6eb03e4a27c11ee09bc6e47b2e348b51fccd89b13b3c905a213083b3ce3dd1e3 |