psutil
Cross-platform Python library for retrieving process and system utilization data.
Repository Health
Technical Analysis
psutil (process and system utilities) is a cross-platform Python library for retrieving information about running processes and system utilization, including CPU, memory, disks, network, and sensors. It implements many of the capabilities offered by classic UNIX command-line tools such as ps, top, free, iotop, netstat, ifconfig, and lsof, exposing them through a single, uniform Python API.
Used for system monitoring, profiling, resource limiting, and process management, psutil works consistently across Linux, Windows, macOS, FreeBSD, OpenBSD, NetBSD, Sun Solaris, and AIX. It is among the most-downloaded packages on PyPI, with hundreds of millions of downloads per month and adoption by hundreds of thousands of GitHub repositories.
What You Get
- A uniform Python API over CPU, memory, disk, network, and sensor metrics that behaves identically across operating systems
- A Process class for inspecting and controlling individual processes by PID (name, exe, CPU/memory usage, open files, connections, children, signals)
- Compiled C extensions per platform (Linux, Windows, macOS, the BSDs, Solaris, AIX) with pure-Python fallbacks for portability
- Named-tuple return values that make results self-documenting and easy to destructure
- Broad Python support covering CPython 3.7+ and PyPy
Common Use Cases
- Building system-monitoring dashboards and agents that report CPU, memory, disk, and network utilization
- Profiling and measuring the resource footprint of a running application or benchmark
- Enumerating, inspecting, and managing (suspend, resume, terminate) running processes
- Implementing cross-platform equivalents of UNIX tools like top, ps, and netstat inside Python programs
Under The Hood
Architecture - psutil’s public surface lives in psutil/__init__.py, which re-exports a stable set of module-level functions and the Process class while delegating all real work to a per-platform backend selected at import time: _pslinux.py, _pswindows.py, _psosx.py, _psbsd.py, _pssunos.py, or _psaix.py. Each backend pairs a pure-Python module with a compiled C extension (_psutil_linux.c, _psutil_windows.c, and so on) that queries the operating system directly, and shared constants, exceptions, and helpers are centralized in _common.py, with named-tuple result types defined in _ntuples.py. This layered design keeps a single portable API in front of platform-specific system calls.
Tech Stack - The library is written in Python (CPython 3.7+ and PyPy) plus C for the native extensions, with the split roughly 62% Python and 37% C by volume. It has no runtime dependencies, keeping installs lightweight. Building from source uses setup.py and the C toolchain; development tooling is configured in pyproject.toml around ruff and black (line length 79), with a comprehensive Makefile orchestrating build, lint, and test targets.
Code Quality - Code quality is high and battle-tested. The tests/ directory holds 21 test modules including platform-specific suites (test_linux.py, test_windows.py, test_osx.py, the BSD/Solaris/AIX files), plus contract tests (test_contracts.py), memory-leak tests (test_memleaks.py), unicode handling, and type-hint checks (test_type_hints.py). Exceptions are modeled explicitly (NoSuchProcess, AccessDenied, ZombieProcess, TimeoutExpired), naming is consistent, and the project enforces a strict ruff ALL ruleset with targeted opt-outs.
API Design - The developer experience is a major strength: getting a metric is typically a single call such as psutil.cpu_percent() or psutil.virtual_memory(), and per-process inspection reads naturally through psutil.Process(pid). Return values are self-documenting named tuples, documentation on Read the Docs is thorough with copious examples, and the near-zero boilerplate plus consistent cross-platform semantics make the API easy to learn and hard to misuse.
Used by 41 apps in this directory
clarity-upscaler
AI Design Tools · Design Tools
Free open-source AI image upscaler reaching 13K resolution using Stable Diffusion, ControlNet, and Tiled Diffusion — a self-hostable alternative to Magnific.
ClearML
Automation · Devops
Auto-magical MLOps platform that tracks experiments, versions data, orchestrates pipelines, and serves models with just two lines of code.
ClickHouse
Analytics · Data Engineering · Databases
Open-source column-oriented database that delivers real-time analytical queries on petabyte-scale data with millisecond latency.
cocoindex
AI Development · Data Engineering
An incremental data indexing engine that keeps AI agent context perpetually fresh by reprocessing only what changed.
ComfyUI
AI Design Tools · AI Development
The most powerful node-based AI workflow engine for creating images, video, 3D models, and audio with full control over every generation step.
Databend
Data Engineering · Databases
Open-source enterprise data warehouse unifying analytics, vector search, full-text search, and AI agent orchestration in a single Rust-built engine on S3.
Dragonfly
Databases · Developer Tools · Devops
A modern Redis and Memcached replacement engineered for multi-core servers — delivering 25x more throughput, better cache hit rates, and up to 80% lower memory consumption with full API compatibility.
GPT Researcher
AI Assistants · Productivity
The pioneering open-source autonomous AI agent that conducts deep, multi-source research and produces citation-backed reports exceeding 2,000 words — faster and more reliably than any human researcher.
GPU Hot
Devops · Monitoring
Real-time NVIDIA GPU monitoring dashboard — self-hosted, scale from 1 to 100+ GPUs with sub-second metrics and no cloud dependency.