Metadata-Version: 2.4
Name: rawblock-io
Version: 0.1.0
Summary: Raw block device I/O with automatic strategy fallback and cross-platform device/mount resolution
Author-email: Michael Banucu <michael.banucu@googlemail.com>
License: GPL-3.0-only
Project-URL: Homepage, https://github.com/MBanucu/rawblock-io
Project-URL: Repository, https://github.com/MBanucu/rawblock-io
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: System :: Filesystems
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# rawblock-io

Raw block device I/O with automatic strategy fallback and cross-platform
device/mount point resolution.

## Features

- **Pluggable I/O strategies** — tries direct access first, falls back
  through loop-device backing file to `sudo dd`
- **`DirectIOStrategy`** — `os.pread`/`os.pwrite` on regular files and
  accessible block devices
- **`BackingFileStrategy`** — resolves loop-device backing files (`/sys/block`,
  `losetup`, or `hdiutil` on macOS)
- **`DDStrategy`** — `sudo dd` fallback for physical block devices
- **`resolve_device`** — find the underlying block device for any file path
  (Linux `/proc/partitions` + `/sys/dev/block`, macOS `hdiutil`)
- **`resolve_mount_point`** — find the mount point for any file path
  (Linux `findmnt`, macOS `df`)

## Quick start

```python
from rawblock_io import RawBlockIO, resolve_device

io = RawBlockIO()
device = resolve_device('/some/file')
data = io.read(device, 0, 512)  # read first sector
```

## License

GPL-3.0-only
