Skip to main content

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

Project description

rawblock-io

PyPI version Python License OS

CI codecov

Downloads total Downloads/month Downloads/week

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.2.0.tar.gz (23.3 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.2.0-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rawblock_io-0.2.0.tar.gz
  • Upload date:
  • Size: 23.3 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.2.0.tar.gz
Algorithm Hash digest
SHA256 7b17d9f60a7fb1586dce97dceeaacfbd52c64ecb976eeaa1e735577f24de4df9
MD5 3000ac7e45f4d8323f65c967b99edb4d
BLAKE2b-256 95af5b8a4a86bea5a21a72212f0699aef7b92ef4e2bd89b3a46664e663909fc9

See more details on using hashes here.

Provenance

The following attestation bundles were made for rawblock_io-0.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: rawblock_io-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 21.6 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c819b2525952c1f33209721a906e30367285b4551f9ddad866043cadef64118
MD5 1d6198553366fc48fbebcfe80e6161ec
BLAKE2b-256 525e09dd0f9f53ac9bd21e09ab75004aacbf58bcc001f08a9f1923d1b76dfd46

See more details on using hashes here.

Provenance

The following attestation bundles were made for rawblock_io-0.2.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