Skip to main content

Fast random access to bzip2 files

Project description

indexed_bzip2

PyPI version Downloads License Build Status

This module provides an IndexedBzip2File class, which can be used to seek inside bzip2 files without having to decompress them first. It's based on an improved version of the bzip2 decoder bzcat from toybox, which was refactored and extended to be able to export an import bzip2 block offsets and seek to them. Seeking inside a block is only emulated, so IndexedBzip2File will only speed up seeking when there are more than one blocks, which should almost always be the cause for archives larger than 1 MB.

Installation

You can simply install it from PyPI:

pip install indexed_bzip3

Usage

Example 1

from indexed_bzip2 import IndexedBzip2File

file = IndexedBzip2File( "example.bz2" )

# You can now use it like a normal file
file.seek( 123 )
data = file.read( 100 )

The first call to seek will ensure that the block offset list is complete and therefore might create them first. Because of this the first call to seek might take a while.

Example 2

The creation of the list of bzip2 blocks can take a while because it has to decode the bzip2 file completely. To avoid this setup when opening a bzip2 file, the block offset list can be exported and imported.

from indexed_bzip2 import IndexedBzip2File

file = IndexedBzip2File( "example.bz2" )
blockOffsets = file.blockOffsets() # can take a while
file.close()

file2 = IndexedBzip2File( "example.bz2" )
blockOffsets = file2.setBlockOffsets( blockOffsets ) # should be fast
file2.seek( 123 )
data = file2.read( 100 )
file2.close()

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

indexed_bzip2-0.1.0-cp38-cp38-manylinux2010_x86_64.whl (390.0 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

indexed_bzip2-0.1.0-cp38-cp38-manylinux1_x86_64.whl (292.9 kB view details)

Uploaded CPython 3.8

indexed_bzip2-0.1.0-cp38-cp38-manylinux1_i686.whl (277.1 kB view details)

Uploaded CPython 3.8

indexed_bzip2-0.1.0-cp37-cp37m-manylinux2010_x86_64.whl (372.7 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

indexed_bzip2-0.1.0-cp37-cp37m-manylinux1_x86_64.whl (295.4 kB view details)

Uploaded CPython 3.7m

indexed_bzip2-0.1.0-cp37-cp37m-manylinux1_i686.whl (280.2 kB view details)

Uploaded CPython 3.7m

indexed_bzip2-0.1.0-cp36-cp36m-manylinux2010_x86_64.whl (373.0 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.12+ x86-64

indexed_bzip2-0.1.0-cp36-cp36m-manylinux1_x86_64.whl (296.3 kB view details)

Uploaded CPython 3.6m

indexed_bzip2-0.1.0-cp36-cp36m-manylinux1_i686.whl (281.9 kB view details)

Uploaded CPython 3.6m

indexed_bzip2-0.1.0-cp35-cp35m-manylinux2010_x86_64.whl (370.1 kB view details)

Uploaded CPython 3.5mmanylinux: glibc 2.12+ x86-64

indexed_bzip2-0.1.0-cp35-cp35m-manylinux1_x86_64.whl (293.3 kB view details)

Uploaded CPython 3.5m

indexed_bzip2-0.1.0-cp35-cp35m-manylinux1_i686.whl (279.6 kB view details)

Uploaded CPython 3.5m

indexed_bzip2-0.1.0-cp34-cp34m-manylinux2010_x86_64.whl (371.6 kB view details)

Uploaded CPython 3.4mmanylinux: glibc 2.12+ x86-64

indexed_bzip2-0.1.0-cp34-cp34m-manylinux1_x86_64.whl (289.1 kB view details)

Uploaded CPython 3.4m

indexed_bzip2-0.1.0-cp34-cp34m-manylinux1_i686.whl (278.6 kB view details)

Uploaded CPython 3.4m

File details

Details for the file indexed_bzip2-0.1.0-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: indexed_bzip2-0.1.0-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 390.0 kB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.5.6

File hashes

Hashes for indexed_bzip2-0.1.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 35107b59984412b13885a11fd8207a67c5e8536579e8ba3630a8ef39116f9748
MD5 52502f890c801809a2be849ebaf07fef
BLAKE2b-256 f96d7be8bf2f04187a4d61ca687f6ec56caace65de06a596780cd4a80fad766e

See more details on using hashes here.

File details

Details for the file indexed_bzip2-0.1.0-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: indexed_bzip2-0.1.0-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 292.9 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.5.6

File hashes

Hashes for indexed_bzip2-0.1.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7faabcd028755d50085d8a005a0cff964ea76e3447d401f1acdc24cce642d61c
MD5 5e05cb1cf7f2b146534cb1c0e434608b
BLAKE2b-256 2ec746ed042876cabc094bdbed240a9ca6e95115930525a6d271218f580cc57a

See more details on using hashes here.

File details

Details for the file indexed_bzip2-0.1.0-cp38-cp38-manylinux1_i686.whl.

File metadata

  • Download URL: indexed_bzip2-0.1.0-cp38-cp38-manylinux1_i686.whl
  • Upload date:
  • Size: 277.1 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.5.6

File hashes

Hashes for indexed_bzip2-0.1.0-cp38-cp38-manylinux1_i686.whl
Algorithm Hash digest
SHA256 4a245fec77ab9f5e954f1b2f82600cf5cc0d8730ef8d1fd66ecc4d756a962f83
MD5 7aa2ca2cc454a7ff80b386af5d397721
BLAKE2b-256 edee94200520add5888b7735bc4942eab885d89be924858ed0e176101d4fab67

See more details on using hashes here.

File details

Details for the file indexed_bzip2-0.1.0-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: indexed_bzip2-0.1.0-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 372.7 kB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.5.6

File hashes

Hashes for indexed_bzip2-0.1.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 4364f482f9e0e70144a03f5d1425818e5bb9cc2d45d87389faf5fb8e90b645f3
MD5 a6060e548049d6f2abbbad0b9b65db3b
BLAKE2b-256 971411b1106b1ca87380aff157db3202f8bd267cb7836bacd380f550413b1f07

See more details on using hashes here.

File details

Details for the file indexed_bzip2-0.1.0-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: indexed_bzip2-0.1.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 295.4 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.5.6

File hashes

Hashes for indexed_bzip2-0.1.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 284dc040867d18ce42ad001e322a72b1c693df91814a509ce23d92052fa121bb
MD5 63f5454274d98d90ac67d4393b98c8b2
BLAKE2b-256 fbd107af052aa87f9c36ed2a07b0930b6c18e75cf8bbf6b82556b189eba5bbe5

See more details on using hashes here.

File details

Details for the file indexed_bzip2-0.1.0-cp37-cp37m-manylinux1_i686.whl.

File metadata

  • Download URL: indexed_bzip2-0.1.0-cp37-cp37m-manylinux1_i686.whl
  • Upload date:
  • Size: 280.2 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.5.6

File hashes

Hashes for indexed_bzip2-0.1.0-cp37-cp37m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 6c09b118674b9fecf9283645448c9c46328b9c4dcb8afc72ddae0f6cbfb347f5
MD5 b869e8bdecf0e721fa46609cb914f643
BLAKE2b-256 a8abaf48c0d329ee1016a4dcf27361f398fae835973e723cfd6b8598395cb59b

See more details on using hashes here.

File details

Details for the file indexed_bzip2-0.1.0-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: indexed_bzip2-0.1.0-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 373.0 kB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.5.6

File hashes

Hashes for indexed_bzip2-0.1.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 26fc2f3be18172b3ac7416c5b69596e054ee02467d2a87711d6f3b6bb0107679
MD5 df5ebc2b371b5fcf21a63a65b6271039
BLAKE2b-256 b2acbca97853e7188fee83dfa6b249a27f42e6617fa864fcb996b5148def5a61

See more details on using hashes here.

File details

Details for the file indexed_bzip2-0.1.0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: indexed_bzip2-0.1.0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 296.3 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.5.6

File hashes

Hashes for indexed_bzip2-0.1.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 417c6dde2a9e0fe9e64bf64c7f519aabef4a28ce68113a9124369211b6300028
MD5 f23eab0689ecb67339750efe79cca2f8
BLAKE2b-256 df5022e2a2a94ef35170f7090226e3ed7390098183f463c208870438414c3cc0

See more details on using hashes here.

File details

Details for the file indexed_bzip2-0.1.0-cp36-cp36m-manylinux1_i686.whl.

File metadata

  • Download URL: indexed_bzip2-0.1.0-cp36-cp36m-manylinux1_i686.whl
  • Upload date:
  • Size: 281.9 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.5.6

File hashes

Hashes for indexed_bzip2-0.1.0-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 a4e18c7367b7cf1dadfbaa4deb8a0102d91c5a57a894b251b56887a0717cfcfe
MD5 cd29e58b5ea01b126fcb38aa2e3c1b70
BLAKE2b-256 47262a95b7c84e8d833e2d8aa082660ed48ae151c843e73694fb1d622d88bc53

See more details on using hashes here.

File details

Details for the file indexed_bzip2-0.1.0-cp35-cp35m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: indexed_bzip2-0.1.0-cp35-cp35m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 370.1 kB
  • Tags: CPython 3.5m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.5.6

File hashes

Hashes for indexed_bzip2-0.1.0-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 4eed839214976627c777e69f6abdfbe04f249a482640c15d499bb777dd3be796
MD5 f406ff13cd17102bf1f3a2d3183f66d4
BLAKE2b-256 32c10ae239922bb4aec31667150c973fabce5d35f0b16988578657c7ebcf4d5f

See more details on using hashes here.

File details

Details for the file indexed_bzip2-0.1.0-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: indexed_bzip2-0.1.0-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 293.3 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.5.6

File hashes

Hashes for indexed_bzip2-0.1.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e9c4d4c7687cafef32d162aa3d1fa08b646764d14c23ba239aff08a9dc2eac29
MD5 ff6c9f11cdc3f886ed3a33938a76a480
BLAKE2b-256 0a3c780448dad25ede18749b66d0d9e518c5a44a99dfe600443b08b2b41135db

See more details on using hashes here.

File details

Details for the file indexed_bzip2-0.1.0-cp35-cp35m-manylinux1_i686.whl.

File metadata

  • Download URL: indexed_bzip2-0.1.0-cp35-cp35m-manylinux1_i686.whl
  • Upload date:
  • Size: 279.6 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.5.6

File hashes

Hashes for indexed_bzip2-0.1.0-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 f7276d1fe8b6b7477161f9b963a77ace9b8b5862dcf415827a6e8524eacf49f6
MD5 3654de073a61c740cb198e36744e1b7e
BLAKE2b-256 a52007a53cc6ca1f1af95590a66850f161ec3db70856124c9e9fce7fffbeae00

See more details on using hashes here.

File details

Details for the file indexed_bzip2-0.1.0-cp34-cp34m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: indexed_bzip2-0.1.0-cp34-cp34m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 371.6 kB
  • Tags: CPython 3.4m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.5.6

File hashes

Hashes for indexed_bzip2-0.1.0-cp34-cp34m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 262e764809d571eff52c24753cf6ee87dbf4bc393e76467186e83e0b4e0025d0
MD5 1b90e2775857ed669c0cd08fe5473844
BLAKE2b-256 9ed39b413bdbf2462644c4a2364d28bae6219b50dca5798c563098ea5c00c562

See more details on using hashes here.

File details

Details for the file indexed_bzip2-0.1.0-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

  • Download URL: indexed_bzip2-0.1.0-cp34-cp34m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 289.1 kB
  • Tags: CPython 3.4m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.5.6

File hashes

Hashes for indexed_bzip2-0.1.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 06dbf604811153ed8cd1aa2b082de89a2ee8e0a8b6dcb2992019f3efd59ef7af
MD5 8c4f99ffea7aa086f9337087302f78fd
BLAKE2b-256 2b83f3618e061a98a9eb50935d66ac228652e71b730a79ef15b314b4bfc91267

See more details on using hashes here.

File details

Details for the file indexed_bzip2-0.1.0-cp34-cp34m-manylinux1_i686.whl.

File metadata

  • Download URL: indexed_bzip2-0.1.0-cp34-cp34m-manylinux1_i686.whl
  • Upload date:
  • Size: 278.6 kB
  • Tags: CPython 3.4m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.5.6

File hashes

Hashes for indexed_bzip2-0.1.0-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 36f6c713b680641d2eeb2e5e560620fb6f53769317657388d85de28bd0e7fe0a
MD5 a060980dce3c858cba1de2970e728179
BLAKE2b-256 7c5b9c23ea5403dc5f2082b39d727b26133a30a045a7766f5e9463fe1fb04ad7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page