Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

psutil

Cross-platform library for retrieving process and system monitoring information.

Logging, monitoring and analyticsPYPI

GitHubWebsite

1. License

License from PyPI license field.

github.com/giampaolo/psutil

From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error

What psutil does

psutil covers the ground of a shelf of Unix commands (ps, top, free, iotop, netstat, ifconfig, lsof) from one Python module, and its Process object can set priorities, CPU affinity and resource limits as well as read them.

psutil popularity

79 / 100
Gid Score, #123 overall
94.6M
downloads a week, pypi
11.3K
GitHub stars
117
agent projects use it
psutil: downloads per weekPyPI, psutil 94,040,911
psutil: GitHub starsgiampaolo/psutil 11,333

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How psutil is used

  • psutil is a dependency in 117 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (7.2% of the 1,623 Python ones), #2 of 121 in logging, monitoring and analytics.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 1,137; those are left out of every share on this page.
  • Projects that use it most often also use Pydantic (63.2%), Uvicorn (62.4%), FastAPI (59.8%).
  • It is more common in projects set up for Continue (9.5%) than for GitHub Copilot (1.5%).

By coding agent

72 projects, 2.2%
51 projects, 2.1%
44 projects, 1.5%
13 projects, 3.9%
8 projects, 1.7%
7 projects, 2.0%
7 projects, 1.5%
6 projects, 9.5%

Often used with

In 63.2% of its projects
In 62.4% of its projects
In 59.8% of its projects
In 53.8% of its projects
In 53.0% of its projects
In 52.1% of its projects
In 52.1% of its projects
In 43.6% of its projects

psutil in practice

Strengths

Processes, CPU, disks, network and sensors in one module

The site groups the API into CPU, Memory, Disks, Network, Sensors and Processes, and all six come from the same <code>import psutil</code>. The project positions this as covering much of what <code>ps</code>, <code>top</code>, <code>netstat</code> and <code>lsof</code> do.

Linux, Windows, macOS, three BSDs, Solaris and AIX

The site lists eight systems: Linux, Windows, macOS, FreeBSD, OpenBSD, NetBSD, Solaris and AIX. The README puts the three BSDs on one line.

Setters on the Process object

The API overview shows a <code>Process</code> setting its nice value, CPU affinity and IO priority. It also sets resource limits, for example <code>p.rlimit(psutil.RLIMIT_NOFILE, (5, 5))</code>.

USS and PSS per process

Besides RSS and VMS from <code>memory_info()</code>, <code>p.memory_footprint()</code> returns USS, PSS and swap. The docs annotate it as the "real" USS memory usage.

Watch out for

psutil.io documents the development version

The main site shows the development docs. For the current release, it points to psutil.readthedocs.io/stable.

Overview output is from Linux; load average is emulated on Windows

The API overview is shown "on Linux". A comment on <code>psutil.getloadavg()</code> notes that on Windows the value is emulated.

Junos devices list a reduced set of functions

Juniper's table lists which psutil functions are supported on Junos OS with upgraded FreeBSD and on Junos OS Evolved. The Sensors row shows a dash in both columns.

Inspect one process, then list all processes

>>> import psutil
>>> p = psutil.Process(7055)
>>> p.name()
'python3'
>>> p.exe()
'/usr/bin/python3'
>>> p.cpu_percent(interval=1.0)
12.1
>>> p.memory_info()
pmem(rss=3164160, vms=4410163, shared=897433, text=302694, data=2422374)
>>>
>>> for p in psutil.process_iter(['pid', 'name']):
...     print(p.pid, p.name())
...
1 systemd
2 kthreadd
3 ksoftirqd/0
...

More about psutil

Funding
  • GitHub Sponsors: https://github.com/giampaolo
  • Tidelift: https://tidelift.com/funding/github/pypi/psutil
  • Open Collective: https://opencollective.com/psutil
  • Own page: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A9ZS7PKKRM3S8
  • 8 GitHub sponsors

See all

Packages around it
  • python-dotenv: .env file loading
  • requests: HTTP client
  • numpy: Numerical arrays
  • pydantic: Data validation
  • pyyaml: YAML parsing
  • uvicorn: ASGI server
More in Logging, monitoring and analytics

Alternatives

psutil This page

BSD-3-ClauseGid 7994.6M/wk

Compare psutil with another tool

Get started

Install it.

pip install psutil

Rules for your agent

Paste into AGENTS.md or CLAUDE.md
## psutil
- Install with `pip install psutil`. For platform-specific details, follow https://psutil.io/install/.
- When you read several attributes of one process, put the calls inside `with p.oneshot():`, as the docs' performance section recommends.
- When you iterate over processes, pass an attrs list, e.g. `psutil.process_iter(['pid', 'name'])`, as the docs recommend.
- In `process_iter()` loops, follow Juniper's sample: wrap `proc.as_dict(attrs=[...])` in `try` / `except psutil.NoSuchProcess`.
- On Junos devices, call only the functions in Juniper's support table. It lists no sensor functions for either Junos variant.
- The docs note that `psutil.getloadavg()` on Windows is emulated.
- psutil.io documents the development version. Check psutil.readthedocs.io/stable for the current release.