Skip to main content

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

Project description

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
  • DirectIOStrategyos.pread/os.pwrite on regular files and accessible block devices
  • BackingFileStrategy — resolves loop-device backing files (/sys/block, losetup, or hdiutil on macOS)
  • DDStrategysudo 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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rawblock_io-0.1.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rawblock_io-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file rawblock_io-0.1.0.tar.gz.

File metadata

  • Download URL: rawblock_io-0.1.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rawblock_io-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a68b5a019d4d29d92e39504d6f057660d2d62307d7a7d429d03647ce42b1c7e1
MD5 8ba144fd701197ce2de55f321c09848d
BLAKE2b-256 5336236a931fc47e8314343506e30baa94c3dc04826b1ebc9ddbb8999411330c

See more details on using hashes here.

Provenance

The following attestation bundles were made for rawblock_io-0.1.0.tar.gz:

Publisher: publish.yml on MBanucu/rawblock-io

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rawblock_io-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rawblock_io-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rawblock_io-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04f39d4b0fde44a66c7a608fe7abe4e9ef3f40c1fe4f9f2d778ee8800a994066
MD5 78499c82fd63806cf5366fea845e9552
BLAKE2b-256 8de5d684224c53d4bf843e455925d8df3adc9cd641baca83f3a95d31c00ebef3

See more details on using hashes here.

Provenance

The following attestation bundles were made for rawblock_io-0.1.0-py3-none-any.whl:

Publisher: publish.yml on MBanucu/rawblock-io

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page