Parsed data¶
Those classes are used to store the parsed data from lspci
outputs.
The Device¶
- class pylspci.device.Device(slot: Slot, cls: NameWithID, vendor: NameWithID, device: NameWithID, subsystem_vendor: Optional[NameWithID] = None, subsystem_device: Optional[NameWithID] = None, revision: Optional[int] = None, progif: Optional[int] = None, driver: Optional[str] = None, kernel_modules: List[str] = [], numa_node: Optional[int] = None, iommu_group: Optional[int] = None, physical_slot: Optional[str] = None)[source]¶
Describes a device returned by lspci.
Create new instance of Device(slot, cls, vendor, device, subsystem_vendor, subsystem_device, revision, progif, driver, kernel_modules, numa_node, iommu_group, physical_slot)
- as_dict() Dict[str, Optional[Union[int, str, Dict[str, Optional[Union[int, Dict[str, Any]]]], Dict[str, Optional[Union[int, str]]], List[str]]]] [source]¶
Serialize this device as a JSON-serializable dict.
- cls: NameWithID¶
The device’s class, with a name and/or an ID.
- device: NameWithID¶
The device’s name and/or ID.
- driver: Optional[str]¶
The device’s driver (Linux only).
- iommu_group: Optional[int]¶
IOMMU group that this device is part of (optional, Linux only).
- kernel_modules: List[str]¶
One or more kernel modules that can handle this device (Linux only).
- numa_node: Optional[int]¶
NUMA node this device is connected to (Linux only).
- physical_slot: Optional[str]¶
The device’s physical slot number (Linux only).
- progif: Optional[int]¶
The device’s programming interface number.
- revision: Optional[int]¶
The device’s revision number.
- subsystem_device: Optional[NameWithID]¶
The device’s subsystem name and/or ID, if found.
- subsystem_vendor: Optional[NameWithID]¶
The device’s subsystem vendor, if found, with a name and/or an ID.
- vendor: NameWithID¶
The device’s vendor, with a name and/or an ID.
Device fields¶
- class pylspci.fields.NameWithID(value: Optional[str])[source]¶
Describes a device, vendor or class with either a name, an hexadecimal PCI ID, or both.
- as_dict() Dict[str, Optional[Union[int, str]]] [source]¶
Serialize this name and ID as a JSON-serializable dict.
- id: Optional[int]¶
The PCI ID as a four-digit hexadecimal number.
- name: Optional[str]¶
The human-readable name associated with this ID.
- class pylspci.fields.PCIAccessParameter(value: str)[source]¶
A pcilib access method parameter, as parsed from
list_pcilib_params()
orlspci -Ohelp
, that can be modified using thepcilib_params
argument oflspci()
, orlspci -Oname=value
in the command line.- as_dict() Dict[str, Optional[str]] [source]¶
Serialize this PCI access parameter as a JSON-serializable dict.
- default: Optional[str]¶
An optional default value for the parameter.
- description: str¶
A short description of the parameter’s use.
- name: str¶
The parameter’s name.
- class pylspci.fields.Slot(value: str)[source]¶
Describes a PCI slot identifier, in the format
[DDDD:]BB:dd.f
, whereD
is the domain,B
the bus,d
the device andf
the function. The first three are hexadecimal numbers, butf
is in octal.- as_dict() Dict[str, Optional[Union[int, Dict[str, Any]]]] [source]¶
Serialize this slot as a JSON-serializable dict.
- bus: int¶
The slot’s bus, as a two-digit hexadecimal number.
- device: int¶
The slot’s device, as a two-digit hexadecimal number, up to 0x1f.
- domain: int = 0¶
The slot’s domain, as a four-digit hexadecimal number. When omitted, defaults to
0x0000
.
- function: int¶
The slot’s function, as a single octal digit.