psutil API reference
103 public APIs from psutil (giampaolo/psutil) — 12 classes, 63 functions, 28 methods. Signatures extracted by static analysis of the actual source.
Repository: giampaolo/psutil
| Kind | Count |
|---|---|
| Classes | 12 |
| Functions | 63 |
| Methods | 28 |
API list
class
.github.workflows.triage_labels.BadDecisionThe model's tool call doesn't match the schema.
func
.github.workflows.triage_labels.add_labels(number, labels)Add labels to a ticket.
func
.github.workflows.triage_labels.classify(client, title, body, files)Ask Claude which labels apply.
class
psutil.ProcessRepresents an OS process identified by a PID.
method
psutil.Process.cmdline() -> list[str]The command line this process has been called with.
method
psutil.Process.cpu_affinity(cpus:list[int] | None=None) -> list[int] | NoneGet or set process CPU affinity.
method
psutil.Process.cpu_num() -> intReturn what CPU this process is currently running on.
method
psutil.Process.cwd() -> strProcess current working directory as an absolute path.
method
psutil.Process.environ() -> dict[str, str]The environment variables of the process as a dict.
method
psutil.Process.exe() -> strThe process executable as an absolute path.
method
psutil.Process.gids() -> pgidsReturn process GIDs as a `(real, effective, saved)` named tuple.
method
psutil.Process.info() -> dictReturn pre-fetched `process_iter()` info dict.
method
psutil.Process.ionice(ioclass:int | None=None, value:int | None=None) -> pionice | ProcessIOPriority | NoneGet or set process I/O niceness (priority).
method
psutil.Process.is_running() -> boolReturn whether this process is running.
method
psutil.Process.name() -> strThe process name.
method
psutil.Process.nice(value:int | None=None) -> int | NoneGet or set process niceness (priority).
method
psutil.Process.num_threads() -> intReturn the number of threads used by this process.
method
psutil.Process.pid() -> intThe process PID.
method
psutil.Process.ppid() -> intThe process parent PID.
method
psutil.Process.rlimit(resource:int, limits:tuple[int, int] | None=None) -> tuple[int, int] | NoneGet or set process resource limits as a `(soft, hard)` tuple.
method
psutil.Process.status() -> ProcessStatus | strThe process current status as a `STATUS_` constant.
method
psutil.Process.terminal() -> str | NoneThe terminal associated with this process, if any, else None.
method
psutil.Process.uids() -> puidsReturn process UIDs as a `(real, effective, saved)` named tuple.
method
psutil.Process.username() -> strThe name of the user that owns the process.
class
psutil._common.AccessDeniedException raised when permission to perform an action is denied.
class
psutil._common.ErrorBase exception class.
class
psutil._common.ZombieProcessException raised when querying a zombie process.
func
psutil._common.bcat(fname, fallback=_DEFAULT)Same as above but opens file in binary mode.
func
psutil._common.bytes2human(n, format='%(value).1f%(symbol)s')Used by various scripts.
func
psutil._common.cache_activate(proc)Activate cache.
func
psutil._common.cache_deactivate(proc)Deactivate and clear cache.
func
psutil._common.get_procfs_path()Return updated psutil.PROCFS_PATH constant.
func
psutil._common.warn(msg)Emit a RuntimeWarning.
class
psutil._psaix.ProcessWrapper class around underlying C implementation.
func
psutil._psaix.cpu_stats()Return various CPU stats as a named tuple.
func
psutil._psaix.disk_partitions(all=False)Return system disk partitions.
func
psutil._psaix.net_connections(kind, _pid=-1)Return socket connections.
func
psutil._psaix.net_if_stats()Get NIC stats (isup, duplex, speed, mtu).
func
psutil._psaix.pid_exists(pid)Check for the existence of a unix pid.
class
psutil._psbsd.ProcessWrapper class around underlying C implementation.
method
psutil._psbsd.Process.cwd()Return process current working directory.
func
psutil._psbsd.adjust_proc_create_time(ctime)Account for system clock updates.
func
psutil._psbsd.cpu_freq()Return frequency metrics for CPUs.
func
psutil._psbsd.cpu_stats()Return various CPU stats as a named tuple.
func
psutil._psbsd.net_connections(kind)System-wide network connections.
func
psutil._psbsd.net_if_stats()Get NIC stats (isup, duplex, speed, mtu).
func
psutil._psbsd.per_cpu_times()Return system CPU times as a named tuple.
func
psutil._psbsd.sensors_battery()Return battery info.
class
psutil._pslinux.ProcessLinux process implementation.
method
psutil._pslinux.Process.cpu_num()What CPU the process is on.
func
psutil._pslinux.cpu_freq()Return frequency metrics for all CPUs.
func
psutil._pslinux.cpu_stats()Return various CPU stats as a named tuple.
func
psutil._pslinux.net_connections(kind='inet')Return system-wide open connections.
func
psutil._pslinux.net_if_stats()Get NIC stats (isup, duplex, speed, mtu).
func
psutil._pslinux.pid_exists(pid)Check for the existence of a unix PID.
func
psutil._pslinux.readlink(path)Wrapper around os.readlink().
func
psutil._pslinux.sensors_battery()Return battery information.
func
psutil._pslinux.swap_memory()Return swap memory metrics.
func
psutil._pslinux.virtual_memory()Report virtual memory stats.
class
psutil._psosx.ProcessWrapper class around underlying C implementation.
func
psutil._psosx.adjust_proc_create_time(ctime)Account for system clock updates.
func
psutil._psosx.cpu_freq()Return CPU frequency.
func
psutil._psosx.cpu_times()Return system CPU times as a named tuple.
func
psutil._psosx.net_connections(kind='inet')System-wide network connections.
func
psutil._psosx.net_if_stats()Get NIC stats (isup, duplex, speed, mtu).
func
psutil._psosx.per_cpu_times()Return system CPU times as a named tuple.
func
psutil._psosx.sensors_battery()Return battery information.
func
psutil._psosx.virtual_memory()System virtual memory as a named tuple.
func
psutil._psposix.disk_usage(path)Return disk usage associated with path.
class
psutil._pssunos.ProcessWrapper class around underlying C implementation.
func
psutil._pssunos.cpu_stats()Return various CPU stats as a named tuple.
func
psutil._pssunos.disk_partitions(all=False)Return system disk partitions.
func
psutil._pssunos.net_connections(kind, _pid=-1)Return socket connections.
func
psutil._pssunos.net_if_stats()Get NIC stats (isup, duplex, speed, mtu).
func
psutil._pssunos.pid_exists(pid)Check for the existence of a unix pid.
func
psutil._pssunos.swap_memory()Report swap memory metrics.
func
psutil._pssunos.virtual_memory()Report virtual memory metrics.
class
psutil._pswindows.ProcessWrapper class around underlying C implementation.
class
psutil._pswindows.WindowsServiceRepresents an installed Windows service.
method
psutil._pswindows.WindowsService.description() -> strService long description.
method
psutil._pswindows.WindowsService.display_name() -> strThe service display name.
method
psutil._pswindows.WindowsService.name() -> strThe service name.
method
psutil._pswindows.WindowsService.pid() -> int | NoneThe process PID, if any, else None.
method
psutil._pswindows.WindowsService.status() -> strService status as a string.
method
psutil._pswindows.WindowsService.username() -> strThe name of the user that owns this service.
func
psutil._pswindows.cpu_freq()Return CPU frequency.
func
psutil._pswindows.cpu_stats()Return CPU statistics.
func
psutil._pswindows.cpu_times()Return system CPU times as a named tuple.
func
psutil._pswindows.disk_partitions(all)Return disk partitions.
func
psutil._pswindows.disk_usage(path)Return disk usage associated with path.
func
psutil._pswindows.net_connections(kind, _pid=-1)Return socket connections.
func
psutil._pswindows.net_if_stats()Get NIC stats (isup, duplex, speed, mtu).
func
psutil._pswindows.sensors_battery()Return battery information.
func
psutil._pswindows.virtual_memory()System virtual memory as a named tuple.
func
psutil.cpu_stats() -> scpustatsReturn CPU statistics.
func
psutil.cpu_times(percpu:bool=False) -> scputimes | list[scputimes]Return system-wide CPU times as a named tuple.
func
psutil.pid_exists(pid:int) -> boolReturn True if *pid* exists in the current process list.
func
psutil.pids() -> list[int]Return a list of current running PIDs.
func
psutil.sensors_battery() -> sbattery | NoneReturn battery information.
func
psutil.sensors_fans() -> dict[str, list[sfan]]Return fans speed.
func
psutil.sensors_temperatures(fahrenheit:bool=False) -> dict[str, list[shwtemp]]Return hardware temperatures.
func
psutil.virtual_memory() -> svmemReturn statistics about system memory usage as a named tuple.
func
psutil.win_service_get(name) -> WindowsServiceGet a Windows service by *name*.
About this data
These signatures were extracted from the public source of giampaolo/psutil
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.