Skip to main content

A device information gatherer for Linux, macOS, and Cygwin/Windows

Project description

getdevinfo

This repository holds my new getdevinfo module. This module was originally integrated directly into the source code of Wine Autostart, DDRescue-GUI, and WxFixBoot, but has now been separated for ease of maintenance. Because it's on GitLab (https://gitlab.com/hamishmb/getdevinfo) and on PyPI (the Python Package Index) (https://pypi.org/project/getdevinfo/), and released under the GPLv3+, this means other people can use it too.

pipeline status PyPI Total Downloads on PyPI Downloads/Month on PyPI Downloads/Week on PyPI

Description of Package

A device information gatherer for Linux, macOS and Cygwin/Windows.

Working on Linux, macOS and Cygwin, this script makes use of lshw, lvdisplay, and blkid (Linux), as well as diskutil (macOS) and smartctl and blkid (Cygwin) to get a comprehensive amount of disk information. This information is available in a structured dictionary for ease of use.

NOTE: Cygwin is supported since v1.1.0, Python 2 is unsupported since v1.0.7.

Features:

Uses the operating system's built-in tools to gather lots of helpful information about disks connected to the system. This is returned as a hierarchical python dictionary. For the full details on the format, read the documentation here: https://www.hamishmb.com/html/Docs/getdevinfo.php

Dependencies:

Linux: The lshw, blkid, lvdisplay, and blockdev commands need to be installed, as well as the beautifulsoup4 (bs4) and lxml Python modules.

macOS: Nothing beyond a default install of Python 3 is needed. bs4 and lxml will still be installed if you install with the Python wheel or with pip.

Cygwin: The smartmontools and util-linux packages need to be installed, as well as the beautifulsoup4 (bs4) and lxml Python modules.

Building

Source Distribution

Run:

python setup.py sdist

Wheels

Make sure you've installed the "wheel" package:

pip3 install wheel

Universal Wheel

This is the recommended choice, though GetDevInfo no longer runs on Python 2 from version 1.0.7 onwards,

python3 setup.py bdist_wheel --universal

Pure Python Wheel

Not sure why you'd do this, but you can run:

python3 setup.py bdist_wheel

to acheive this if you want.

Distribution Packages

You can find these at https://www.launchpad.net/getdevinfo or https://www.hamishmb.com/html/downloads.php?program_name=getdevinfo.

Documentation

This can be found at https://www.hamishmb.com/support/getdevinfo.php.

Running directly from the command line

Run:

sudo python3 -m getdevinfo

Running The Tests

These have to be run as the superuser/administrator, because low-level access to hardware is required to gather information.

The process for running these is the same on both Linux and macOS. Note that prior to version 1.0.7, GetDevInfo ran on Python 2 as well.

Without Coverage Reporting

Change directory to the getdevinfo subfolder, and run:

sudo python3 ./tests.py

With Coverage Reporting

Make sure you have installed Coverage.py using pip or your package manager.

Change directory to the getdevinfo subfolder, and run:

sudo python3 -m coverage run --rcfile=../.coveragerc ./tests.py

To run the tests. Then run:

sudo python3 -m coverage report

To see the report.

Project details


Download files

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

Source Distribution

getdevinfo-2.0.0.tar.gz (47.8 kB view details)

Uploaded Source

Built Distribution

getdevinfo-2.0.0-py3-none-any.whl (57.3 kB view details)

Uploaded Python 3

File details

Details for the file getdevinfo-2.0.0.tar.gz.

File metadata

  • Download URL: getdevinfo-2.0.0.tar.gz
  • Upload date:
  • Size: 47.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for getdevinfo-2.0.0.tar.gz
Algorithm Hash digest
SHA256 4ec4f6829f4d915cfed9d352b8794a89aa01c526e9e794663c03ef6261ab6113
MD5 1bbd7c63a20a8520471ca59b91675bb3
BLAKE2b-256 3fa556fabafb1a67b3455a00f209112740466bffeaed18f8f0d74ddce25a62f1

See more details on using hashes here.

File details

Details for the file getdevinfo-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: getdevinfo-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 57.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for getdevinfo-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4ffb854536c0eae0e7f6836b5f5ce028d84d86ef7b6ca4b86d78286055ccf31
MD5 6b26cc2e1a1cdbcdc05b7959b7281bad
BLAKE2b-256 5758ca2afa825f7c0d69aad7891682f5775425176bb7b43686881b044476b092

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page