https://github.com/jrd/pyreadpartitions
Read MBR and GPT partitions in python directly.
https://github.com/jrd/pyreadpartitions
disk gpt mbr
Last synced: 4 months ago
JSON representation
Read MBR and GPT partitions in python directly.
- Host: GitHub
- URL: https://github.com/jrd/pyreadpartitions
- Owner: jrd
- License: mit
- Created: 2014-06-15T20:45:09.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2022-04-07T12:09:25.000Z (about 4 years ago)
- Last Synced: 2025-11-07T03:15:50.922Z (7 months ago)
- Topics: disk, gpt, mbr
- Language: Python
- Homepage: https://pypi.org/project/pyreadpartitions
- Size: 22.5 KB
- Stars: 6
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
pyreadpartitions
================
Read MBR and GPT partitions directly in python.
Examples:
```python
from pyreadpartitions import get_disk_partitions_info
with open('/dev/sda', 'rb') as fp:
info = get_disk_partitions_info(fp)
print(info.mbr)
print(info.gpt)
```
```python
from pyreadpartitions import show_disk_partitions_info
with open('/dev/sda', 'rb') as fp:
show_disk_partitions_info(fp)
```
A console script is also available:
```sh
$ sudo cat /dev/sda | pyreadpartitions
```
or if you already have access to a file or directly to the disk:
```sh
# pyreadpartitions /dev/sda
```