skillfed

blkinfo

blkinfo is a python package to list information about all available or the specified block devices.

blkinfo v0.2.0 175.4K downloads/30d#10,265 on PyPI11
Copyleft license GPLv3 Abandoned released

What it is and what it does

blkinfo is a Python library that gathers information about block devices (disks, partitions, etc.) on a Linux system. It wraps the lsblk command-line tool and supplements it by reading directly from /sys/block, /sys/devices, and /proc to collect device metadata, usage statistics, and iSCSI target details. The library was originally created to provide JSON output on older Red Hat Enterprise Linux and CentOS systems where lsblk lacked that capability.

You instantiate a BlkDiskInfo object and call get_disks() to retrieve all available block devices as structured data, optionally passing filters to narrow results by device name, size, transport type, mount status, or other attributes. The main use case is programmatic inventory of storage devices in system administration or infrastructure automation scripts.

Use it for:

  • Inventory block devices in system administration scripts without parsing lsblk text output.
  • Filter and discover iSCSI-attached storage targets by IP address and port number.
  • Collect block device usage statistics and metadata for monitoring or reporting.
  • Enumerate mounted partitions and their parent devices in automated provisioning workflows.
  • Build storage device catalogs on systems with older lsblk versions lacking JSON support.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Retrieves structured information about block devices on a system by wrapping lsblk and reading from /sys/block, /sys/devices, and /proc, with support for filtering and iSCSI metadata.

No. The package is abandoned (no updates since 2021-10-06, last commit 2023-08-06) and carries a copyleft GPLv3 license that restricts use in proprietary software. Modern Linux systems have lsblk with JSON output built-in. Install only if locked to an old Red Hat/CentOS system with no other option and your project is open-source.

Install

blkinfo on PyPI

pip

pip install blkinfo

uv

uv add blkinfo

poetry

poetry add blkinfo

Installing blkinfo

Before you install

High install friction: the package is abandoned (last commit 2023-08-06, latest release 2021-10-06) and has not been maintained for an extended period. No runtime dependencies, but depends on lsblk and /proc filesystem access, which may not be portable across all environments.

License in practice

GPLv3 copyleft license means any code that links or distributes this package must also be open-source under compatible terms. Proprietary or closed-source projects should avoid this dependency.

Quickstart

from blkinfo import BlkDiskInfo
import json

myblkd = BlkDiskInfo()
all_disks = myblkd.get_disks()
print(json.dumps(all_disks))

Requires lsblk command-line tool (util-linux package) and read access to /sys/block, /sys/devices, and /proc filesystems; Linux-only.

Verify before relying

  • Whether the package works with modern Linux kernel versions and recent util-linux releases.
  • Compatibility with Python versions beyond those tested at release (2021-10-06).
  • Whether iSCSI target discovery features still function with current iSCSI implementations.

Package facts

License GPLv3 (copyleft)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance abandoned — 1,773 days since the last release
Last repo commit
First released
Downloads 175,425/month — #10,265 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: blkinfo-0.2.0.tar.gz

Keywords: lsblk, disk, blockdevice, blockinfo, blkinfo, iscsi

Development Status :: 4 - BetaProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python Modules

Tags

block device information pythonlsblk python wrapperdisk device enumerationstorage device metadataiscsi target discoveryblock device filteringsystem disk inventory
linux-onlyabandonedcopyleft

More Python Modules packages