--- id: hap-python version: "5.0.0" license: Apache-2.0 license_treatment: permissive maintenance: aging --- # HAP-python — HomeKit Accessory Protocol implementation in python License: permissive · Maintenance: aging · Downloads: 88.8K/mo ## 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 above — verify before relying. HAP-python implements the HomeKit Accessory Protocol, letting you create smart home accessories that integrate with Apple's Home app and respond to Siri commands over a local network. 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 pip install hap-python uv add hap-python poetry add hap-python ## Installing HAP-python 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). 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') Requires Avahi/Bonjour system library; on Raspberry Pi install libavahi-compat-libdnssd-dev first. Minimum Python 3.9. 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_current - Install friction: low - Maintenance: aging - Downloads: 88.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags homekit accessory protocol python, apple home app integration, smart home device python, homekit python library, local network home automation, siri voice control devices, homekit camera streaming, homekit, smart-home, asyncio [View on SkillFed](https://skillfed.io/packages/hap-python) · [View on PyPI](https://pypi.org/project/hap-python/)