{
 "kind": "tool",
 "slug": "psutil",
 "path": "tools/psutil/",
 "name": "psutil",
 "maker": null,
 "density": "profile",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Logging, monitoring and analytics",
   "tools/observability-analytics/"
  ]
 ],
 "lead": "Cross-platform library for retrieving process and system monitoring information.",
 "chips": [
  {
   "label": "Logging, monitoring and analytics",
   "path": "tools/observability-analytics/"
  },
  {
   "label": "PYPI"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "pip install psutil"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/giampaolo/psutil"
  },
  {
   "label": "Website",
   "href": "https://github.com/giampaolo/psutil"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "BSD-3-Clause",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": null,
   "note": "License from PyPI license field.",
   "src": "https://github.com/giampaolo/psutil"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 20, 2026",
   "note": "",
   "src": "https://github.com/giampaolo/psutil"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "117 projects",
   "status": "info",
   "sub": "#2 of 121 in its category",
   "note": "Dependency in 117 public GitHub projects set up for AI coding agents that we scanned (1.9%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What psutil does",
   "parts": [
    {
     "t": "prose",
     "text": "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."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "psutil popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "79",
       "of": "/ 100",
       "l": "Gid Score, #123 overall"
      },
      {
       "n": "94.6M",
       "l": "downloads a week, pypi"
      },
      {
       "n": "11.3K",
       "l": "GitHub stars"
      },
      {
       "n": "117",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How psutil is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "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%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "72 projects, 2.2%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "51 projects, 2.1%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "44 projects, 1.5%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "13 projects, 3.9%",
       "v": "OpenClaw",
       "path": "agents/openclaw/"
      },
      {
       "l": "8 projects, 1.7%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "7 projects, 2.0%",
       "v": "OpenCode",
       "path": "agents/opencode/"
      },
      {
       "l": "7 projects, 1.5%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      },
      {
       "l": "6 projects, 9.5%",
       "v": "Continue",
       "path": "agents/continue/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 63.2% of its projects",
       "v": "Pydantic",
       "path": "tools/pydantic/"
      },
      {
       "l": "In 62.4% of its projects",
       "v": "Uvicorn",
       "path": "tools/uvicorn/"
      },
      {
       "l": "In 59.8% of its projects",
       "v": "FastAPI",
       "path": "tools/fastapi/"
      },
      {
       "l": "In 53.8% of its projects",
       "v": "PyYAML",
       "path": "tools/pyyaml/"
      },
      {
       "l": "In 53.0% of its projects",
       "v": "NumPy",
       "path": "tools/numpy/"
      },
      {
       "l": "In 52.1% of its projects",
       "v": "python-dotenv",
       "path": "tools/python-dotenv/"
      },
      {
       "l": "In 52.1% of its projects",
       "v": "Requests",
       "path": "tools/requests-py/"
      },
      {
       "l": "In 43.6% of its projects",
       "v": "Pillow",
       "path": "tools/pillow/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "psutil in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Processes, CPU, disks, network and sensors in one module",
       "v": "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."
      },
      {
       "l": "Linux, Windows, macOS, three BSDs, Solaris and AIX",
       "v": "The site lists eight systems: Linux, Windows, macOS, FreeBSD, OpenBSD, NetBSD, Solaris and AIX. The README puts the three BSDs on one line."
      },
      {
       "l": "Setters on the Process object",
       "v": "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>."
      },
      {
       "l": "USS and PSS per process",
       "v": "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."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "psutil.io documents the development version",
       "v": "The main site shows the development docs. For the current release, it points to psutil.readthedocs.io/stable."
      },
      {
       "l": "Overview output is from Linux; load average is emulated on Windows",
       "v": "The API overview is shown \"on Linux\". A comment on <code>psutil.getloadavg()</code> notes that on Windows the value is emulated."
      },
      {
       "l": "Junos devices list a reduced set of functions",
       "v": "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."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Inspect one process, then list all processes"
    },
    {
     "t": "tabs",
     "label": "Example",
     "items": [
      {
       "tab": "Python",
       "code": ">>> import psutil\n>>> p = psutil.Process(7055)\n>>> p.name()\n'python3'\n>>> p.exe()\n'/usr/bin/python3'\n>>> p.cpu_percent(interval=1.0)\n12.1\n>>> p.memory_info()\npmem(rss=3164160, vms=4410163, shared=897433, text=302694, data=2422374)\n>>>\n>>> for p in psutil.process_iter(['pid', 'name']):\n...     print(p.pid, p.name())\n...\n1 systemd\n2 kthreadd\n3 ksoftirqd/0\n..."
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about psutil",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "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"
       ]
      },
      {
       "title": "Packages around it",
       "items": [
        "python-dotenv: .env file loading",
        "requests: HTTP client",
        "numpy: Numerical arrays",
        "pydantic: Data validation",
        "pyyaml: YAML parsing",
        "uvicorn: ASGI server"
       ]
      },
      {
       "title": "More in Logging, monitoring and analytics",
       "path": "tools/observability-analytics/",
       "items": [
        {
         "text": "Vercel Analytics",
         "path": "tools/vercel-analytics/"
        },
        {
         "text": "Vercel Speed Insights",
         "path": "tools/vercel-speed-insights/"
        },
        {
         "text": "Sentry for Next.js",
         "path": "tools/sentry-nextjs/"
        },
        {
         "text": "OpenTelemetry",
         "path": "tools/opentelemetry/"
        },
        {
         "text": "Pino",
         "path": "tools/pino/"
        },
        {
         "text": "structlog",
         "path": "tools/structlog/"
        },
        {
         "text": "PostHog JS",
         "path": "tools/posthog-js/"
        },
        {
         "text": "Loguru",
         "path": "tools/loguru/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "psutil",
       "me": true,
       "facts": [
        "BSD-3-Clause",
        "Gid 79",
        "94.6M/wk"
       ]
      }
     ],
     "more": "Compare psutil with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "pip install psutil"
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## psutil\n- Install with `pip install psutil`. For platform-specific details, follow https://psutil.io/install/.\n- When you read several attributes of one process, put the calls inside `with p.oneshot():`, as the docs' performance section recommends.\n- When you iterate over processes, pass an attrs list, e.g. `psutil.process_iter(['pid', 'name'])`, as the docs recommend.\n- In `process_iter()` loops, follow Juniper's sample: wrap `proc.as_dict(attrs=[...])` in `try` / `except psutil.NoSuchProcess`.\n- On Junos devices, call only the functions in Juniper's support table. It lists no sensor functions for either Junos variant.\n- The docs note that `psutil.getloadavg()` on Windows is emulated.\n- psutil.io documents the development version. Check psutil.readthedocs.io/stable for the current release.\n"
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "pypi psutil"
  ],
  [
   "Category",
   "Logging, monitoring and analytics"
  ],
  [
   "License",
   "BSD-3-Clause"
  ],
  [
   "Latest version",
   "7.2.2, January 28, 2026"
  ],
  [
   "On GitHub since",
   "May 2014"
  ],
  [
   "Gid Score",
   "78.7"
  ],
  [
   "Rank in category",
   "#2 of 121"
  ],
  [
   "GitHub",
   "giampaolo/psutil"
  ],
  [
   "Last change",
   "Nov 20, 2026"
  ]
 ],
 "good": [],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/giampaolo.png"
}