HAP-python
HomeKit Accessory Protocol implementation in python
Decision gist · record as of 2026-08-14
Yes, if you want to add HomeKit support to a Python project on a local network. The library is stable and production-ready, with low install friction and permissive licensing. The aging maintenance status (354 days since last release) is a minor concern for new features but not a blocker for existing functionality. Requires system-level Avahi/Bonjour setup and Python 3.9+.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Avahi/Bonjour system library; on Raspberry Pi install libavahi-compat-libdnssd-dev first.
- Minimum Python 3.9.
- Low install friction with a pure-wheel distribution.
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 permissive license allows commercial and private use with minimal restrictions, making it safe for both hobby and production smart home projects.
last release 2025-08-25 (354 days) · last repo commit 2025-09-09 · 669 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 88,777 downloads/mo, #13,706 on PyPI
Alternatives
Verify before relying
pip3 install HAP-python[QRCode]
from pyhap.accessory import Accessory, Category
class MyAccessory(Accessory):
category = Category.SENSOR
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
service = self.add_preload_service('TemperatureSensor')
self.temp = service.get_characteristic('CurrentTemperature')- Whether camera streaming works reliably with modern ffmpeg versions and various platforms
- Current state of Home Assistant integration and whether it remains actively maintained
- Performance and stability under high accessory counts or frequent state changes
- Specific port and network configuration requirements for AccessoryDriver setup
What it is and what it does
HAP-python is a Python implementation of Apple's HomeKit Accessory Protocol that lets you turn any Python-capable device into a HomeKit-compatible smart home accessory. You define accessories by subclassing Accessory, add services like TemperatureSensor or Lightbulb with their characteristics, and let the AccessoryDriver handle the HAP server, local network advertising via mDNS, and secure pairing. The library supports asyncio for concurrent operations and includes out-of-the-box definitions for Apple-defined services.
The package is built on six core dependencies: async_timeout for timeout handling, cryptography and chacha20poly1305-reuseable for secure pairing, orjson for efficient JSON serialization, zeroconf for mDNS advertising, and h11 for HTTP/1.1 protocol handling. It's designed to run on resource-constrained devices like Raspberry Pi but works on any platform with Python 3.9+. Once running, your accessory appears in the Home app, can be controlled via the Home app UI, and responds to Siri voice commands.
Use it for
- Build a temperature or humidity sensor that reports readings to the Home app periodically
- Create a smart light or switch that can be toggled from the Home app or controlled by Siri
- Stream video from a camera accessory to HomeKit clients with negotiated resolution and audio
- Run multiple accessories in a single process using asyncio for concurrent state management
- Integrate existing IoT devices or GPIO-based hardware into HomeKit without a separate bridge
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you want to add HomeKit support to a Python project on a local network.
The library is stable and production-ready, with low install friction and permissive licensing. The aging maintenance status (354 days since last release) is a minor concern for new features but not a blocker for existing functionality. Requires system-level Avahi/Bonjour setup and Python 3.9+.
Install
hap-python on PyPI
Before you install
Low install friction with a pure-wheel distribution. Maintenance is aging—last release was 354 days ago—but the project remains active with recent commits and stable production status. Requires Avahi/Bonjour system library (libavahi-compat-libdnssd-dev on Raspberry Pi).
Requires Avahi/Bonjour system library; on Raspberry Pi install libavahi-compat-libdnssd-dev first. Minimum Python 3.9.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions, making it safe for both hobby and production smart home projects.
Quickstart
pip3 install HAP-python[QRCode]
from pyhap.accessory import Accessory, Category
class MyAccessory(Accessory):
category = Category.SENSOR
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
service = self.add_preload_service('TemperatureSensor')
self.temp = service.get_characteristic('CurrentTemperature')
Verify before relying
- Whether camera streaming works reliably with modern ffmpeg versions and various platforms
- Current state of Home Assistant integration and whether it remains actively maintained
- Performance and stability under high accessory counts or frequent state changes
- Specific port and network configuration requirements for AccessoryDriver setup
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 6 packagesasync_timeoutcryptographychacha20poly1305-reuseableorjsonzeroconfh11 |
| Maintenance | Aging 354 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 88,777 / month, #13,706 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: End Users/DesktopNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Home AutomationTopic :: Software Development :: Libraries :: Python Modules |
Evidence: hap_python-5.0.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “homekit accessory protocol python”
- HAP-pythonHAP-python implements the HomeKit Accessory Protocol, letting you…
- aiohomekitAn asyncio-based HomeKit client library for controlling HomeKit…
- pyobjc-framework-ExternalAccessoryProvides Python bindings to macOS's ExternalAccessory framework for…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also aiohomekit · homeassistant · ha-ffmpeg · pyobjc-framework-ExternalAccessory · airthings-cloud · aioslimproto · pigpio · pyhiveapi · aiohue · pytapo