Skip to main content

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
        }
    ]
}

Release files for hmxlabs.sysinfo 1.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hmxlabs.sysinfo 1.0.9
File Size Uploaded
hmxlabs_sysinfo-1.0.9.tar.gz 5.3 kB Details

Built distribution (wheel)

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

Total release size: 10.7 kB

Release files / hmxlabs_sysinfo-1.0.9.tar.gz

Download URL hmxlabs_sysinfo-1.0.9.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
95afff9a8356b10880241c9ab22f79c173aa105eb412606dab3debecf5024abd
BLAKE2b-256 checksum
How to use checksums
2973da661394c3258e2827b9a064d11948de8685b9417776f62c16232be0e941
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.11

Release files / hmxlabs.sysinfo-1.0.9-py3-none-any.whl

Download URL hmxlabs.sysinfo-1.0.9-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f22570e321b5ad24dd7749275834ea13f413207bf50c538ab38df9eaa99ec21
BLAKE2b-256 checksum
How to use checksums
4e2b3815df6ed514845a746930aed680855f43649855484843264da203af7b21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.11

Release history Release notifications | RSS feed

This release

1.0.9 This release

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

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