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.
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
nullon 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
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:
ComponentInfoContains list of
GPUInfoobjects.
- 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
Lenovoon 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.
nullon all other platforms and GPUs.nullon all other platforms.
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¶
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 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
PARTIALorFAILED, 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.
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.
Every size parameter, that is of type StorageSize, will of be one of the following classes.