Skip to main content

Comprehensive and concise system information querying tool.

Project description

Comprehensive and concise system information querying tool.

package version from PyPI build status from GitHub test coverage from Codecov grade from Codacy license

The goal is to gather all relevant:

  • hardware information (processors, accelerators, memory, networks, drives)

  • static operating system information (name, version, hostname)

  • runtime information (environment, libraries, system load, etc.)

and provide them in a concise form that’s both machine- and human-readable.

Another important goal is to also be fail-safe, even with unexpected hardware configurations, low-level tool errors and deal with incomplete information.

You can use system-query as a library and as a command-line tool.

Motiviation

Where am I running?

One of the main motivations for creating system-query is to assist with answering the question “what is the actual hardware and software configuration of the system I’m using?” regardless of the official specification.

How to rerun this experiment?

The system-query was also created to assist with the computational experiment reproducibility and verification of results. Only if you know exactly where you ran your experiment, you can reason about its results and be able to reproduce them.

Using

Installing system-query doesn’t enable all the features by default. Some of the query functions will work only on some systems. To attempt installation with all features enables, run pip3 install system-query[all]. If something brakes, you can narrow down the features by typing a feature scope instead of all. You can choose from cpu, gpu, hdd, ram and swap. E.g. pip3 install system-query[gpu]. You can also select more than one feature at the same time, e.g. pip3 install system-query[cpu,hdd,ram].

As library

In [1]: from system_query import query_cpu
        query_cpu()

Out[1]: {'brand': 'Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz',
         'clock': 1771.0370000000003,
         'clock_max': 3900.0,
         'clock_min': 1600.0,
         'logical_cores': 8,
         'physical_cores': 4}

More examples in examples.ipynb.

system_query.query_all()

This will launch all below functions and assemble results into a dictionary.

system_query.query_cpu()

To be able to see details like cache size, clock speed and core counts, install Python packages pint and psutil.

system_query.query_gpu()

To be able to see GPUs in the system, make sure you have CUDA installed and install Python package pycuda.

system_query.query_hdd()

To be able to see HDDs in the system, make sure you have libudev installed and install Python package pyudev.

system_query.query_ram()

To be able to see amount of memory, install Python package psutil.

system_query.query_software()

This will attempt to gather version information of various common programs, assuming their executables are in system path.

system_query.query_swap()

To be able to see amount of swap space, install Python package psutil.

As command-line tool

For example:

$ python3 -m system_query
{'cpu': {'brand': 'Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz',
         'clock': 1725.031125,
         'clock_max': 3900.0,
         'clock_min': 1600.0,
         'logical_cores': 8,
         'physical_cores': 4},
 'gpus': [],
 'host': 'TestMachine',
 'os': 'Linux-4.4.0-109-generic-x86_64-with-debian-stretch-sid',
 'ram': {'total': 33701269504},
 'swap': 0}

Usage information:

$ python3 -m system_query -h
usage: system_query [-h] [-s {all,cpu,gpu,ram}] [-f {raw,json}] [-t TARGET]
                    [--version]

Comprehensive and concise system information tool. Query a given hardware
and/or softawre scope of your system and get results in human- and machine-
readable formats.

optional arguments:
  -h, --help            show this help message and exit
  -s {all,cpu,gpu,ram}, --scope {all,cpu,gpu,ram}
                        Scope of the query (default: all)
  -f {raw,json}, --format {raw,json}
                        Format of the results of the query. (default: raw)
  -t TARGET, --target TARGET
                        File path where to write the results of the query.
                        Special values: "stdout" and "stderr" to write to
                        stdout and stderr, respectively. (default: stdout)
  --version             show program's version number and exit

Requirements

Python version 3.8 or later.

Python libraries as specified in requirements.txt. Recommended (but optional) packages are listed in requirements_optional.txt.

Building and running tests additionally requires packages listed in requirements_test.txt.

Tested on Linux, OS X and Windows.

Additionally, for all features to work you should have the following libraries installed in your system:

  • CUDA

  • libudev

Contributors

Aleksandr Drozd

Emil Vatai

Mateusz Bysiek

For licensing information, please see LICENSE and NOTICE.

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

system-query-0.3.0.dev0.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

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

system_query-0.3.0.dev0-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file system-query-0.3.0.dev0.tar.gz.

File metadata

  • Download URL: system-query-0.3.0.dev0.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for system-query-0.3.0.dev0.tar.gz
Algorithm Hash digest
SHA256 dbda0e3291b88b1519bd4601b66227aa697d879d82ddaf5edd00b2a74a0edfc3
MD5 78bf0692b6cfdd1d5c90cbd565a53c65
BLAKE2b-256 91e84236e49f89d907422ad76f52f13de9093896e26b592486b206df8d65416e

See more details on using hashes here.

File details

Details for the file system_query-0.3.0.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for system_query-0.3.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 b5f91d194811872e591129cea79647002227832448b9cfb3ddf0954de0901d3f
MD5 1bbf3135e16cc32e56792c263f79de48
BLAKE2b-256 eb8c11343b2fe33b248759d5a31c6ef64c40c4596d1794a0825a85283121cf28

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