Skip to main content

Package to get basic system information including CPU count, HT/SMT status, RAM and disk. Not doing anything special. Just uses psutil and py-cpuinfo

Project description

HMx Labs sysinfo

Platform / OS agnostic (hopefully!) way to get basic information such as disk size, RAM, CPU count, SMT Status

Really nothing clever, just uses psutil and py-cpuinfo under the cover but fairly handy for some of our use cases

Install by running

python3 -m pip install --upgrade hmxlabs.sysinfo

Can be run from the command line as

python3 -m hmxlabs.sysinfo [--file] [--filename]

Default behaviour is to output to stdout. Using the --file switch will output to the default filename of sysinfo.jsonand an alternative filename can be specified with --filename

Can be used from python as:

from hmxlabs.sysinfo import sysinfo

results = sysinfo.get_sysinfo()

The output results in something like:

{
    "arch": "X86_64",
    "smt_on": false,
    "core_count": 4,
    "cpu_count": 4,
    "cpu_vendor": "GenuineIntel",
    "cpu_model": "Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz",
    "cpu_frequency": 2400000000,
    "cpu_frequency_actual": 2400000000,
    "cpu_freq_min": 0.0,
    "cpu_freq_max": 0.0,
    "installed_memory": 8199159808,
    "l3_cache_size": 16777216,
    "l2_cache_size": 1048576,
    "l1_data_cache_size": 131072,
    "l1_instruction_cache_size": 131072,
    "l2_cache_line_size": 256,
    "l2_cache_associativity": 6,
    "cpu_flags": [
        "3dnowprefetch",
        "abm",
        "adx",
        "aes",
        "apic",
        "arat",
        "arch_capabilities",
        "arch_perfmon",
        "avx",
        "avx2",
        "bmi1",
        "bmi2",
        "clflush",
        "clflushopt",
        "cmov",
        "constant_tsc",
        "cpuid",
        "cpuid_fault",
        "cx16",
        "cx8",
        "de",
        "erms",
        "f16c",
        "flush_l1d",
        "fma",
        "fpu",
        "fsgsbase",
        "fxsr",
        "hypervisor",
        "ibpb",
        "ibrs",
        "ibrs_enhanced",
        "invpcid",
        "invpcid_single",
        "lahf_lm",
        "lm",
        "mca",
        "mce",
        "md_clear",
        "mmx",
        "movbe",
        "msr",
        "mtrr",
        "nonstop_tsc",
        "nopl",
        "nx",
        "osxsave",
        "pae",
        "pat",
        "pcid",
        "pclmulqdq",
        "pdpe1gb",
        "pge",
        "pni",
        "popcnt",
        "pse",
        "pse36",
        "rdrand",
        "rdrnd",
        "rdseed",
        "rdtscp",
        "sep",
        "smap",
        "smep",
        "ss",
        "ssbd",
        "sse",
        "sse2",
        "sse4_1",
        "sse4_2",
        "ssse3",
        "stibp",
        "syscall",
        "tsc",
        "tsc_adjust",
        "tsc_deadline_timer",
        "tsc_known_freq",
        "tsc_reliable",
        "tscdeadline",
        "vme",
        "x2apic",
        "xgetbv1",
        "xsave",
        "xsavec",
        "xsaveopt",
        "xsaves",
        "xtopology"
    ],
    "disks": [
        {
            "device": "/dev/sda2",
            "mount_point": "/",
            "size": 115127644160,
            "used": 52791611392,
            "free": 56440627200,
            "percent_used": 48.3
        },
        {
            "device": "/dev/sda1",
            "mount_point": "/boot/efi",
            "size": 535805952,
            "used": 5492736,
            "free": 530313216,
            "percent_used": 1.0
        }
    ]
}

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

hmxlabs.sysinfo-1.0.6.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

hmxlabs.sysinfo-1.0.6-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file hmxlabs.sysinfo-1.0.6.tar.gz.

File metadata

  • Download URL: hmxlabs.sysinfo-1.0.6.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for hmxlabs.sysinfo-1.0.6.tar.gz
Algorithm Hash digest
SHA256 8f07408f7acb63c63edc56bf2e40320980d04f078929b0cb1b9594149b08e3d2
MD5 398532c78b487d440ac66622b8cb50b2
BLAKE2b-256 a3b62a4e69fc6bc74b62e17428d328a060e3c2b7328523b1bb9e9190979ca8ef

See more details on using hashes here.

File details

Details for the file hmxlabs.sysinfo-1.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for hmxlabs.sysinfo-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 bffcc8de0b3abff22bfb3da6df063f97e45ca3da29851822f22b62a50ec62be5
MD5 347ecf127e404ae58b2f848bc74f6186
BLAKE2b-256 e993d457a886ad0322890e8152f0d5af05d033235c09f09faeffc8759a1ddecb

See more details on using hashes here.

Supported by

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