skillfed

psutil-home-assistant

Wrapper for psutil to allow it to be used several times in the same process.

psutil-home-assistant v0.0.1 568.5K downloads/30d#5,966 on PyPI1
Permissive license Apache License 2.0 Active released

What it is and what it does

psutil-home-assistant is a wrapper around the psutil library that addresses a fundamental limitation: psutil uses global variables to maintain state between calls, which prevents it from being instantiated multiple times safely within a single process. This wrapper creates isolated, local copies of psutil functionality, each wrapped in an object, allowing you to use psutil multiple times concurrently without state collisions.

The package is a thin adapter layer with a single runtime dependency on psutil itself. It's designed for scenarios where you need independent psutil instances—such as monitoring different system aspects simultaneously or running psutil operations in parallel—without the complications of global state interference. The implementation is straightforward and carries low installation friction.

Use it for:

  • Running multiple concurrent psutil queries in a single process without state conflicts
  • Monitoring different system metrics independently within the same application
  • Building Home Assistant integrations that need isolated psutil instances for different devices or sensors
  • Testing psutil-dependent code where multiple test cases need independent psutil state

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Wraps psutil to allow multiple independent instances in the same process by isolating global state, solving the library's inherent limitation of maintaining state through global variables.

Yes, if you need to use psutil multiple times in the same process. The package solves a real constraint of psutil with minimal overhead and low installation friction. The permissive Apache 2.0 license poses no restrictions. However, if you only use psutil once per process, this wrapper adds unnecessary indirection—use psutil directly instead.

Install

psutil-home-assistant on PyPI

pip

pip install psutil-home-assistant

uv

uv add psutil-home-assistant

poetry

poetry add psutil-home-assistant

Installing psutil-home-assistant

Before you install

Low friction installation with a single pure-Python dependency. Actively maintained as of July 2026, though the package itself has not been updated since its initial release in August 2022.

License in practice

Licensed under Apache License 2.0 (permissive), allowing use in commercial and private projects with minimal restrictions.

Quickstart

pip install psutil-home-assistant

from psutil_home_assistant import PSUtilWrapper

psutil_instance = PSUtilWrapper()
cpu_percent = psutil_instance.cpu_percent()

Requires Python 3.8 or later.

Verify before relying

  • Whether the wrapper fully isolates all psutil global state or only specific variables
  • Performance overhead of wrapping psutil instances compared to direct usage
  • Compatibility with all psutil versions or specific version constraints

Package facts

License Apache License 2.0 (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — psutil
Maintenance actively maintained — 1,450 days since the last release
Last repo commit
First released
Downloads 568,536/month — #5,966 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: psutil_home_assistant-0.0.1-py3-none-any.whl

Intended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python Modules

Tags

psutil wrapper multiple instancespsutil global state isolationpsutil local copies processpsutil concurrent usage same processpsutil stateless wrapper
psutil-wrapperstate-isolationhome-assistant

More Python Modules packages