Skip to content

[UTILS] Implement b2info CLI tool for instant container inspection #716

Description

@FrancescAlted

Inspecting a .b2nd, .b2frame, .b2z, or .b2d file currently requires either launching the interactive b2view TUI or writing a custom Python script. When working in non-interactive terminal sessions, remote SSH shells without a full TTY, or automated CI pipelines, users need a fast, non-interactive CLI inspection tool (similar to h5dump -H, ncdump -h, or parquet-tools meta).

src/blosc2/info.py already implements human-readable formatting, but there is no CLI script entry point.

Suggested Work

  1. Implement src/blosc2/cli/b2info.py and register it in pyproject.toml under [project.scripts]:
    b2info = "blosc2.cli.b2info:main"
  2. Support inspecting all standard Blosc2 file formats: .b2nd, .b2z, .b2d, and .b2frame.
  3. Provide command-line options:
    • Default output: Clean summary table (container type, shape, dtype, chunks, blocks, itemsize, uncompressed size, compressed size, compression ratio, codecs, filters).
    • --json: Output full metadata and layout as JSON for shell scripts and CI.
    • --meta: Display user metadata (meta and vlmeta dictionaries).
    • --tree: For TreeStore (.b2z/.b2d), print an ASCII group hierarchy.
  4. Add unit tests under tests/test_cli_b2info.py.
  5. Add a brief guide at doc/guides/b2info.md and link it in doc/guides/index.rst.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions