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
Metadata
Release files for PhyDisk 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| PhyDisk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for PhyDisk-0.1.0-py3-none-any.whl |
Release files / PhyDisk-0.1.0-py3-none-any.whl
| Download URL | PhyDisk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
08a8833df4be3aca6763ac5e4984903f5af3ff576586465a35b79e413b05e374
|
|
BLAKE2b-256 checksum How to use checksums |
c39786dd305e75df05a5c8e2e99c1f86e6c6a66f5d6567291a782a4fbc1b3930
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.14
|
Security for PhyDisk 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.