psutil

Cross-platform Python library for retrieving process and system utilization data.

Library
PyPI
v7.2.2
11,309 stars
BSD 3-Clause License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
83 /100 Excellent
Development Activity 96
Maintenance 52
Community 84
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
88 /100 Excellent
Architecture 88
Code Quality 90
Innovation 88
Learning Curve 85

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

Go
87%
MIT

Hatchet

AI Development · Automation · Developer Tools

8,174

A Postgres-backed orchestration engine for background tasks, AI agents, and durable workflows that replaces Redis queues and multi-datastore durable execution platforms with a single self-hostable service.

View details
88
Repo Health
83
Technical
67
Dependency
Built with
Go 87%
Updated 1 weeks ago
Rust
56%
Other

Jan

AI Assistants

45,052

Run LLMs 100% locally with full privacy, or connect to cloud AI — your machine, your data, your control.

View details
90
Repo Health
81
Technical
65
Dependency
Built with
Rust 56%
TypeScript 40%
Updated 6 days ago
Python
51%
AGPL 3.0

Khoj

AI Assistants · Knowledge Management · Productivity

37,802

A self-hostable AI second brain that chats with your documents, searches the web, builds custom agents, and runs entirely on your own LLM.

View details
62
Repo Health
82
Technical
66
Dependency
Built with
Python 51%
TypeScript 36%
Updated 2 months ago
Python
94%
Apache 2.0

knowhere

AI Development · AI Memory · Developer Tools

3,755

Transform messy, unstructured documents into persistent, navigable memory that AI agents can actually use.

View details
83
Repo Health
75
Technical
66
Dependency
Built with
Python 94%
Updated 6 days ago
TypeScript
39%
Apache 2.0

Label Studio

AI Development · Data Engineering

28,540

Label Studio is an open-source, multi-type data labeling platform that lets teams annotate images, text, audio, video, and time series data with a configurable XML-based UI and export annotations in formats ready for any ML framework.

View details
93
Repo Health
87
Technical
64
Dependency
Built with
TypeScript 39%
JavaScript 27%
Python 25%
Updated 1 weeks ago
Python
55%
MIT

LibrePhotos

File Storage

8,111

Self-hosted photo library with AI-powered face recognition, semantic search, and automatic event albums — no cloud required.

View details
84
Repo Health
78
Technical
66
Dependency
Built with
Python 55%
TypeScript 43%
Updated 6 days ago
TypeScript
49%
Apache 2.0

LTX-Desktop

AI Design Tools · Video Editors

2,141

An open-source Electron app that runs LTX-2 text-to-video, image-to-video, and video editing models locally on your GPU, or via a cloud API when your hardware can't keep up.

View details
76
Repo Health
82
Technical
73
Dependency
Built with
TypeScript 49%
Python 46%
Updated 1 weeks ago
Python
62%
Apache 2.0

marimo

Data Engineering · Developer Tools

23,309

A reactive Python notebook that eliminates hidden state, runs reproducibly, and deploys as a web app or script — stored as pure Python, built for the AI era.

View details
90
Repo Health
91
Technical
65
Dependency
Built with
Python 62%
TypeScript 37%
Updated 6 days ago
Python
45%
GPL 3.0

MaxKB

AI Development · Knowledge Management

23,022

Build enterprise-grade AI agents with RAG, workflows & multi-modal support

View details
92
Repo Health
68
Technical
66
Dependency
Built with
Python 45%
Vue 37%
TypeScript 17%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers