Linux system information library
Project description
sysutil-lib
- Linux system information library
Importation
import sysutil
Data structures
ProcessorUsage
class ProcessorUsage:
total: float
user: float
nice: float
system: float
idle: float
iowait: float
interrupt: float
soft_interrupt: float
- data structure which encloses the different parameters relative to processor usage
CpuUsage
class CpuUsage:
average: ProcessorUsage
processors: [ProcessorUsage]
- contains the average CPU usage, and the specific usage for each processor
CpuInfo
class CpuInfo:
modelName: str
cores: int
threads: int
dies: int
governors: [str]
maxFrequencyMHz: float
clockBoost: bool
architecture: str
byteOrder: str
- contains base information relative to the CPU
SchedulerPolicy
class SchedulerPolicy:
name: str
scalingGovernor: str
scalingDriver: str
minimumScalingMHz: float
maximumScalingMHz: float
- contains scheduler information relative to a processor in your system
RamSize
class RamSize:
gb: float
gib: float
- contains total ram size, both in GB (1000^3 bytes) and GiB (1024^3 bytes)
NetworkRate
class NetworkRate:
download: float
upload: float
- contains total upload and download network rate (in bytes)
TemperatureSensor
class TemperatureSensor:
label: str
temperature: float
- contains sensor name (label) and the recorded temperature
Battery
class Battery:
capacity: int
status: str
- contains capacity and status of battery
VramSize
class VramSize:
gb: float
gib: float
- contains total gpu's vram size, both in GB (1000^3 bytes) and GiB (1024^3 bytes)
RouteType
class RouteType:
TCP = 'tcp'
TCP6 = 'tcp6'
UDP = 'udp'
UDP6 = 'udp6'
NetworkRoute
class NetworkRoute:
routeType: str
localAddress: str
localPort: int
remoteAddress: str
remotePort: int
- represents a network route
CPU
class CPU:
info: CpuInfo
averageUsage: ProcessorUsage
perProcessorUsage: [ProcessorUsage]
schedulerPolicies: [SchedulerPolicy]
- encloses all cpu data available in the library
Methods
cpu = CPU()
- standard constructor
cpu = CPU()
cpu.update()
update()
method updates usages and scheduler status
Clocksource
class ClockSource:
current: str
available: [str]
- contains current clock source and the available ones
Bios
class Bios:
vendor: str
release: str
version: str
date: str
- contains information relative to the installed bios
Motherboard
class Motherboard:
name: str
vendor: str
version: str
bios: Bios
- contains information relative to the motherboard and the installed bios
GpuMetrics
class GpuMetrics:
temperatureEdge: int
temperatureHotspot: int
temperatureMem: int
temperatureVrgfx: int
temperatureVrsoc: int
temperatureVrmem: int
averageSocketPower: int
averageGfxclkFrequency: int
averageSockclkFrequency: int
averageUclkFrequency: int
currentGfxclk: int
currentSockclk: int
throttleStatus: int
currentFanSpeed: int
pcieLinkWidth: int
pcieLinkSpeed: int
- encloses gpu metrics parameters
Functions
def cpuUsage() -> CpuUsage
- returns the cpu usage, both average and processor-wise, all the values are percentage
def cpuFrequency() -> float
- returns CPU frequency in MHz
def ramUsage() -> float
- returns ram usage percentage
def networkRate() -> NetworkRate
- returns network rate (download and upload), expressed in bytes
def temperatureSensors() -> [TemperatureSensor]
- returns every temperature sensor in
TemperatureSensor
format
def cpuInfo() -> CpuInfo
- returns the cpu base information, enclosed in the
CpuInfo
data structure
def ramSize() -> RamSize
- returns ram size as specified in the
RamSize
data structure
def schedulerInfo() -> [SchedulerPolicy]
- returns scheduler information for each processor
def gpuUsage() -> float
- returns gpu usage percentage
- yet tested only on AMD 7000 series GPUs, returns
None
in case it's not capable to retrieve information
def batteryInfo() -> Battery
- returns battery status and capacity
def vramSize() -> VramSize
- returns vram size as specified in the
VramSize
data structure
def vramUsage() -> float
- returns vram usage percentage
def networkRoutes() -> [NetworkRoute]
- returns a list containing each internal network route
def clockSource() -> ClockSource
- returns the currently active clock source and the different ones available, enclosed in
ClockSource
struct
def biosInfo() -> Bios
- returns information about the currently installed BIOS
def motherboardInfo() -> Motherboard
- returns information about the motherboard
def gpuMetrics() -> GpuMetrics
- returns metrics parameters from the amdgpu driver
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sysutil-lib-0.2.6.tar.gz
(19.5 kB
view hashes)
Built Distribution
Close
Hashes for sysutil_lib-0.2.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad77f045714d7b43f69fd068b4a6e4c89f036207f09499f879e3c270097510b7 |
|
MD5 | 7df250c4d7d8f65e05889f65bfe74f51 |
|
BLAKE2b-256 | 2fe2695578c6db43cfe749f8694a79ede91ed1f1fe0b686eb61c384ef6717f7c |