About this site

This site is built with Sphinx, on top of its built-in basic theme. From there it has been heavily customized: the layout, navigation, search, dark mode, code blocks, mobile behavior, and many small details were rebuilt or extended specifically for these docs.

Keyboard shortcuts

Key

Action

Shift+D

Toggle dark / light mode

Ctrl+K

Open search

/

Navigate search results

Enter

Open highlighted search result

Escape

Close search / dialog

?

Show this help

Dark mode

By default the site matches your operating system’s light or dark setting. Click the icon in the top-right corner, or press Shift+D anywhere, to override it. Your choice is saved and restored on your next visit.

Light mode Dark mode

Clickable API references

Identifiers in code blocks (e.g. p = psutil.Process(), p.cpu_percent()) are clickable. Hover over one of those to see the highlight, then click to jump to the corresponding API reference doc. This is powered by sphinx-codeautolink.

Clickable API reference

Copy buttons

Every code block has a copy button in its top-right corner which appears on hover. For interactive (>>>) examples it copies just the code, leaving out the prompts and the output, so you can paste it straight into a shell.

Copy button

TOC / On this page

Wide screens show an “On this page” sidebar on the right, listing the current page’s sections. As you scroll it highlights the section you’re in, and clicking an entry jumps straight to it.

On this page outline

Back to top

On a long page, start scrolling back up and a small button will appear in the bottom-right corner. Click it to go back to the top of the page.

Back-to-top button

Reading on mobile

On a phone the navigation collapses behind the button in the top bar. Tap it to open the menu, then swipe left anywhere on the page (or tap outside it) to close it again.

Mobile sidebar

Blog

New releases and deep-dives are written up on the blog. Blog provides a RSS feed (the icon at the top of the blog page) so you can receive notifications of new blog posts from your reader.

Other internal optimizations

  • Fonts and icons are served directly from this site, not from third-party CDNs such as Google Fonts. This means the docs renders the same from all countries (e.g. mainland China). Each font includes only the glyphs used by the site, keeping page weight small.

  • Links to this site shared on social medias show rich preview cards.

  • Every page declares a canonical URL and is listed in a generated sitemap.xml, so search engines can discover and index the whole site.

  • The docs build is strict: Python code snippets are syntax-checked, and broken links or unresolved API cross-references make the build fail.

Linking from your own docs

Other Sphinx projects can cross-reference psutil’s API directly through the intersphinx extension. Add psutil to intersphinx_mapping in your conf.py:

intersphinx_mapping = {
    "psutil": ("https://psutil.readthedocs.io/latest/", None),
}

You can then reference any psutil object and it links straight here, e.g.:

See :func:`psutil.cpu_times` function.

This will automatically turn psutil.cpu_times into a link pointing to this site.