homeassistant-stubs
PEP 484 typing stubs for Home Assistant Core
What it is and what it does
This is an unofficial stub-only package that extracts type information from Home Assistant Core sources to enable type checking. It works by running stubgen (from mypy) against strictly typed modules in Home Assistant, then publishing the generated stubs automatically every 12 hours. The package is designed as a development dependency to be added alongside your Home Assistant custom component or AppDaemon app project.
Home Assistant maintainers do not distribute typing information with the main homeassistant package because PEP 561 requires the entire package to support type checking, but many Home Assistant components lack type hints. This stub package solves that by providing type information for core modules and components that are strictly typed, allowing mypy and other type checkers to validate your code against Home Assistant's API.
Use it for:
- Enable mypy type checking in a custom Home Assistant component before deployment
- Validate AppDaemon app code against Home Assistant API types during development
- Catch type errors in Home Assistant integrations during CI/CD before runtime
- Develop Home Assistant automations with IDE autocomplete and type hints
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides PEP 484 type stubs for Home Assistant Core, enabling static type checking of Home Assistant custom components and AppDaemon apps against strictly typed core and component modules.
Yes, if you are developing Home Assistant custom components or AppDaemon apps and want static type checking. Install as a dev dependency only. Note that requires_python is >=3.14.2, which is newer than most current Python versions—verify your project's Python version supports this before installing.
Install
homeassistant-stubs on PyPI
pip
pip install homeassistant-stubsuv
uv add homeassistant-stubspoetry
poetry add homeassistant-stubsInstalling homeassistant-stubs
Before you install
Low friction installation as a dev-only dependency. Package is actively maintained with releases every 12 hours, last commit 2026-08-08, and has been stable since first release in 2021-03-31.
License in practice
MIT license (permissive) means you can use this freely in any project, commercial or otherwise, with minimal restrictions.
Quickstart
# Add to dev dependencies
uv add --dev homeassistant-stubs
# Then use mypy to type-check your custom component
mypy my_custom_component/
Requires Python >=3.14.2, which may be newer than your current environment. Also requires homeassistant as a runtime dependency in your project.
Verify before relying
- Whether stubs cover all components needed for your specific use case, or only strictly typed core modules and some components as documented
Package facts
| License | MIT (permissive) |
| Python support | capped below the current Python release (>=3.14.2) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — homeassistant |
| Maintenance | actively maintained — 6 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 120,867/month — #12,006 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: homeassistant_stubs-2026.8.1-py3-none-any.whl
Keywords: homeassistant, pep484, typing
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
sqlalchemy2-stubsProvides PEP-484 typing stubs for SQLAlchemy…
permissive · top 5,000 on PyPI
adextExtends alarmdecoder with three Home…
permissive · top 15,000 on PyPI
pika-stubsProvides type stubs for the pika RabbitMQ…
permissive · top 15,000 on PyPI
django-filter-stubsProvides PEP-484 type stubs for django-filter…
permissive · top 15,000 on PyPI
pytest-homeassistant-custom-componentProvides pytest fixtures and testing utilities…
permissive · top 5,000 on PyPI
pyhaversionFetches the latest Home Assistant version…
permissive · top 15,000 on PyPI
types-appdirsProvides type stubs for the appdirs package to…
permissive · top 15,000 on PyPI
types-pikaProvides type stubs for the Pika RabbitMQ…
permissive · top 15,000 on PyPI
google-auth-stubsProvides type stubs for the google-auth…
permissive · top 5,000 on PyPI
pydub-stubsProvides type stubs for Pydub, enabling static…
permissive · top 15,000 on PyPI