Skip to main content

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.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PhyDisk-0.1.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

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

Hashes for PhyDisk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 08a8833df4be3aca6763ac5e4984903f5af3ff576586465a35b79e413b05e374
MD5 a41a105d9c40dd5881935956706f64b0
BLAKE2b-256 c39786dd305e75df05a5c8e2e99c1f86e6c6a66f5d6567291a782a4fbc1b3930

See more details on using hashes here.

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