Skip to main content

PhyDisk (Physical Disk)

PhyDisk is an ultra lightweight python module to get all physical disks connected to a host machine.

Python

Platform

pypi

Pypi Pypi-format Pypi-status

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 --help for 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

pypi-module

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)

Table of built distributions (wheels) for PhyDisk 0.1.0
File Interpreter ABI Platform
PhyDisk-0.1.0-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page