blkinfo
blkinfo is a python package to list information about all available or the specified block devices.
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 blkinfouv
uv add blkinfopoetry
poetry add blkinfoInstalling 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
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pylibftdiPythonic interface to FTDI USB devices via…
permissive · top 15,000 on PyPI
pylspciParses the output of the lspci command to…
copyleft · top 15,000 on PyPI
winrt-Windows.Devices.EnumerationProvides Python bindings to Windows Runtime…
permissive · top 15,000 on PyPI
usb-devicesMaps, describes, and resets USB devices on a…
permissive · top 15,000 on PyPI
uart-devicesProvides a Python interface to interact with…
permissive · top 15,000 on PyPI
binho-host-adapterControls Binho Multi-Protocol USB Host Adapters…
permissive · top 15,000 on PyPI
aioasuswrtAsync Python wrapper for querying ASUS router…
permissive · top 15,000 on PyPI
spidevProvides Python bindings to interact with SPI…
permissive · top 15,000 on PyPI
fatfs-ngfatfs-ng wraps ChaN's FatFS library to create,…
permissive · top 5,000 on PyPI
storageProvides Python classes and functions to…
unclear · top 15,000 on PyPI