blkinfo is a Python package designed to retrieve and list detailed information about all available block devices on a system, or a specified block device. It provides a programmatic interface to access system-level block device data, typically parsing information found in `/sys/class/block`. The current version is 0.2.0, and releases are infrequent, reflecting its stable and specific functionality.
pip install blkinfoVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to instantiate `BlkInfo` and use its primary methods `get_all_blkdev_info()` to retrieve information for all block devices and `get_blkdev_info()` for a specific device. It includes a check for `/dev/sda` and basic error handling, as permissions are often required.
Ensure your application runs in a Linux environment where `/sys/class/block` and device files are available.
Execute your Python script with root privileges (e.g., `sudo python your_script.py`) or ensure the user has appropriate read permissions on `/dev/` and `/sys/class/block`.
Always validate the structure of the returned dictionary against the current version's expected output or handle potentially missing/reordered keys gracefully.
No dependency data recorded yet.