Python module to get physical drives connected to a host machine
Project description
PhyDisk (Physical Disk)
PhyDisk is an ultra lightweight python module to get all physical disks connected to a host machine.
Installation
pip install PhyDisk
Usage
Initiate - IDE
import phydisk
if __name__ == '__main__':
all_disks = phydisk.get_all_disks()
print(all_disks)
Initiate - CLI
phydisk print
Use
phydisk --helpfor usage instructions.
Source Commands
Linux
/usr/bin/lsblk -o NAME,SIZE,TYPE,MODEL,MOUNTPOINT -J
macOS
/usr/sbin/diskutil info -all
Windows
C:\\Program Files\\PowerShell\\7\\pwsh.exe -Command
Get-PhysicalDisk | ForEach-Object {
$disk = $_
$partitions = Get-Partition -DiskNumber $disk.DeviceID
$partitions | ForEach-Object {
[PSCustomObject]@{
DiskNumber = $disk.DeviceID
Partition = $_.PartitionNumber
DriveLetter = (Get-Volume -Partition $_).DriveLetter
MountPoint = (Get-Volume -Partition $_).DriveLetter
}
}
}
Linting
pre-commit will ensure linting
Requirement
python -m pip install pre-commit
Usage
pre-commit run --all-files
Pypi Package
https://pypi.org/project/PhyDisk/
License & copyright
© Vignesh Rao
Licensed under the MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file PhyDisk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: PhyDisk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08a8833df4be3aca6763ac5e4984903f5af3ff576586465a35b79e413b05e374
|
|
| MD5 |
a41a105d9c40dd5881935956706f64b0
|
|
| BLAKE2b-256 |
c39786dd305e75df05a5c8e2e99c1f86e6c6a66f5d6567291a782a4fbc1b3930
|