psutil-home-assistant
Wrapper for psutil to allow it to be used several times in the same process.
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-assistantuv
uv add psutil-home-assistantpoetry
poetry add psutil-home-assistantInstalling 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
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
xlocalProvides execution-local storage that scopes…
unclear · top 15,000 on PyPI
psutilpsutil retrieves real-time information about…
permissive · top 1,000 on PyPI
synchronicityWraps async functions, generators, and classes…
permissive · top 1,000 on PyPI
adguardhomeAsynchronous Python client library for…
permissive · top 15,000 on PyPI
async-lruAn LRU cache decorator for async functions that…
permissive · top 1,000 on PyPI
lockfileProvides a platform-independent file locking…
permissive · top 1,000 on PyPI
redlock-pyImplements Redis-based distributed locks using…
permissive · top 15,000 on PyPI
singleton-decoratorProvides a decorator that enforces singleton…
copyleft · top 15,000 on PyPI
mozsystemmonitorMonitors system resource usage by wrapping…
copyleft · top 15,000 on PyPI
lokyLoky provides a reusable ProcessPoolExecutor…
permissive · top 5,000 on PyPI