--- id: python-kasa version: "0.10.2" license: GPL-3.0-or-later license_treatment: copyleft maintenance: active --- # python-kasa — Python API for TP-Link Kasa and Tapo devices License: copyleft · Maintenance: active · Downloads: 194.6K/mo ## What it is and what it does python-kasa is a community-maintained Python library and CLI tool for discovering and controlling TP-Link Kasa and Tapo smart home devices. It provides both a high-level async API for programmatic control and a command-line interface for direct device management. The library handles device discovery via broadcast, authentication, and feature-based control (turning devices on/off, adjusting brightness, color temperature, and other device-specific settings). The package is built on async I/O (aiohttp, asyncclick) and supports modern Python versions (3.11+). It works with a wide range of TP-Link hardware including plugs, power strips, wall switches, bulbs, light strips, hubs, and hub-connected devices. The library is not affiliated with TP-Link and relies on community contributions for device support and testing. Use it for: - Automate smart plugs and switches in a home network via Python scripts or scheduled tasks. - Build a dashboard or mobile app that discovers and controls multiple TP-Link devices. - Integrate TP-Link devices into a broader home automation system (e.g., Home Assistant). - Query device state (power, brightness, color) and log telemetry for monitoring. - Provision and configure TP-Link devices programmatically before deployment. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Control TP-Link Kasa and Tapo smart home devices (plugs, switches, bulbs, strips, hubs) over the network via Python or command-line interface. Yes, if you own TP-Link Kasa or Tapo devices and need to control them from Python or the command line. The library is actively maintained, has low install friction, and covers a broad range of device types. The GPL-3.0-or-later license is permissive for personal and open-source use but requires attention if you plan to distribute proprietary software. No known security vulnerabilities. ## Install pip install python-kasa uv add python-kasa poetry add python-kasa ## Installing python-kasa Before you install: Low friction: pure Python wheel with 5 runtime dependencies (aiohttp, asyncclick, cryptography, mashumaro, tzdata). Active maintenance with recent commits; last release 548 days ago but repository shows ongoing development. License in practice: GPL-3.0-or-later (copyleft): you must share modifications under the same license if you distribute derived work. Acceptable for internal use and open-source projects; check your distribution model before embedding. Quickstart: pip install python-kasa import asyncio from kasa import Discover async def main(): dev = await Discover.discover_single("192.0.2.123") await dev.turn_on() await dev.update() asyncio.run(main()) Requires Python 3.11 or later; devices must be on the same network or reachable by IP address. Verify before relying: - Whether authentication (username/password) is required for all device types or only some models. - Performance and latency characteristics when controlling many devices simultaneously. - Support status for devices not explicitly listed in the documentation. ## Package facts - License: GPL-3.0-or-later (copyleft) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 194.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags tp-link smart home control, kasa device automation, tapo smart plug python, smart home device api, network-connected device control, home automation library, smart bulb and switch control, smart-home, device-control, async-io [View on SkillFed](https://skillfed.io/packages/python-kasa) · [View on PyPI](https://pypi.org/project/python-kasa/)