Models

PySysInfo exposes Pydantic models for each hardware subsystem plus shared helpers for capacity units and discovery status.

Component Models

The Model for each component, such as CPU and GPU are subclasses of the ComponentInfo class.

class ComponentInfo
status: Status

All the following models include the status property, even though it is not shown explicitly.

CPU

the information retrieved about the CPU is stored as the following class.

pydantic model CPUInfo

Bases: ComponentInfo

field name: str | None = None

This is the CPU’s name

field architecture: str | None = None

x86, ARM, etc.

field bitness: int | None = None

Denotes whether the CPU is 32 or 64 bit. Independent of whether the OS is 32 or 64 bit.

field arch_version: str | None = None

ARM Version. Will be null on x86 CPUs.

field vendor: str | None = None

Manufacturer of the CPU. Intel, for example.

field sse_flags: List[str] [Optional]

SSE flags supported by the CPU.

field cores: int | None = None

The number of physical cores present on the CPU

field threads: int | None = None

The number of logical threads supported by the CPU

field status: Status [Optional]

GPU

Since there may be multiple GPUs present, the output for fetch_graphics_info() is a GraphicsInfo object, with the modules property containing a list of GPUInfo objects.


pydantic model GraphicsInfo

Bases: ComponentInfo

Contains list of GPUInfo objects.

field modules: List[GPUInfo] [Optional]

List of GPU modules present in the system.

field status: Status [Optional]

pydantic model GPUInfo

Information for one GPU is stored here

field name: str | None = None
field vendor_id: str | None = None

This is the hexadecimal number that identifies the manufacturer of the GPU. Format: 0x10DE - Nvidia

field device_id: str | None = None

This is the hexadecimal number that identifies the GPU model. Format: 0xPQRS

field manufacturer: str | None = None

GPU vendor. NVIDIA, for example.

field subsystem_manufacturer: str | None = None

The manufacturer of the GPU. For example, it may be Lenovo on a Thinkpad.

field subsystem_model: str | None = None

The model name given by the subsystem manufacturer.

field acpi_path: str | None = None

ACPI device path, e.g. \\_SB.PC00.RP05.PXSX.

field pci_path: str | None = None

PCI path from the firmware tree, e.g. PciRoot(0x0)/Pci(0x1C,0x5)/Pci(0x0,0x0).

field pcie_width: int | None = None

Number of lanes that the GPU occupies on the PCIe bus.

field pcie_gen: int | None = None

PCIe generation supported by the GPU.

field vram: StorageSize | None = None

Total VRAM available on the GPU.

field apple_gpu_info: AppleExtendedGPUInfo | None = None

Only for Apple Silicon GPUs. null on all other platforms and GPUs. null on all other platforms.


pydantic model AppleExtendedGPUInfo

Contains extra information about Apple Silicon GPUs.

field gpu_core_count: int | None = None

Number of GPU cores.

field performance_shader_count: int | None = None

Number of GPU Performance Shaders

field gpu_gen: int | None = None

GPU Generation


Memory

When fetch_memory_info() is queried, a MemoryInfo object is returned.

Similar to GPUs, the details of all RAM devices are stored as a list of MemoryModuleInfo objects, in the modules property.

The RAM slot is stored in the slot property, as a MemoryModuleSlot object.


pydantic model MemoryInfo
field modules: List[MemoryModuleInfo] [Optional]

pydantic model MemoryModuleInfo
field manufacturer: str | None = None

Hynix/Micron, etc.

field part_number: str | None = None

Manufacturer-assigned part number

field type: str | None = None

DDR4/DDR5/etc.

field capacity: StorageSize | None = None
field frequency_mhz: int | None = None
field slot: MemoryModuleSlot | None = None
field supports_ecc: bool | None = None

Error-Correcting Code (ECC) support.

field ecc_type: str | None = None

pydantic model MemoryModuleSlot
field channel: str = ''
field bank: str = ''

Storage

When fetch_memory_info() is queried, a StorageInfo object is returned.

Like GPU and RAM devices, Storage devices are stored as a list of DiskInfo objects in the modules property.


pydantic model StorageInfo
field modules: List[DiskInfo] [Optional]

pydantic model DiskInfo
field model: str | None = None

Device Name

field manufacturer: str | None = None
field identifier: str | None = None

Unique identifier assigned by the OS - disk0/sda, etc.

field location: str | None = None

Internal/External

field connector: str | None = None

PCIe/SCSI/etc.

field type: str | None = None

HDD/SSD/eMMC/SD/etc.

field vendor_id: str | None = None

Note: For eMMC Storage devices in Linux, this ID is the JEDEC Standard Manufacturer’s Identification Code.

field device_id: str | None = None
field size: StorageSize | None = None

Status Models

Every component’s ComponentInfo subclass has a status property, which contains information on the errors encountered while retrieving data.

This property will be of the Status class.


pydantic model Status

Describes the status of an individual component. If the status is PARTIAL or FAILED, there may be messages that describe the error(s).

field type: StatusType [Optional]
field messages: List[str] [Optional]

The type property of the status indicates whether there were errors during the discovery process.

This is an Enum, with three possible values.

class StatusType

Types of statuses possible.

SUCCESS = 'success'

There were no errors encountered.

PARTIAL = 'partial'

There were errors encountered, but only some parts of the data could not be retrieved.

FAILED = 'failed'

Fatal error occurred, no data could be retrieved.

Size Models

Capacities, such as the size of a RAM module, or the storage capacity of a Storage Disk, is expressed as one of the subclasses of the StorageSize class.

pydantic model StorageSize
field capacity: int [Required]
field unit: str [Required]

Every size parameter, that is of type StorageSize, will of be one of the following classes.


pydantic model Kilobyte
field capacity: int = 0
field unit: str = 'KB'

pydantic model Megabyte
field capacity: int = 0
field unit: str = 'MB'

pydantic model Gigabyte
field capacity: int = 0
field unit: str = 'GB'