Installation

You can install Python-Blosc2 wheels via PyPI using Pip, Conda or clone the GitHub repository.

Pip

pip install blosc2 --upgrade

Conda

conda install -c conda-forge python-blosc2

Optional features (extras)

The base install includes everything needed for compression and the array machinery. Heavier, feature-specific dependencies are kept out of it and grouped into extras that you opt into with the blosc2[extra] syntax:

Extra

Adds

tui

The b2view terminal browser (textual, textual-plotext), including its in-terminal braille plot (the p key). Required by the b2view command.

hires

The high-resolution image view in b2view (the h key), which renders a real matplotlib image in the terminal (textual-image, matplotlib). Includes tui.

parquet

The parquet-to-blosc2 converter (pyarrow); see Parquet to Blosc2 Walkthrough.

Install one or more extras by listing them in brackets (quote the argument in shells like zsh that treat brackets specially):

pip install "blosc2[tui]"             # the b2view terminal browser
pip install "blosc2[hires]"           # b2view + its high-res view (h key)
pip install "blosc2[parquet]"         # the Parquet converter
pip install "blosc2[tui,parquet]"     # several at once

Source code

git clone https://github.com/Blosc/python-blosc2/
cd python-blosc2
pip install . --group test   # install with test dependencies

That’s all. You can proceed with testing section now.

Testing

After compiling, you can quickly check that the package is sane by running the tests:

pytest  # add -v for verbose mode

Benchmarking

If curious, you may want to run a small benchmark that compares a plain NumPy array copy against compression through different compressors in your Blosc build:

PYTHONPATH=. python bench/pack_compress.py