Registry / http-networking / pytapo

pytapo

JSON →
library3.4.15pypypi✓ verified 87d ago

PyTapo is an unofficial Python library designed for communication with Tapo Cameras. It facilitates interoperability by wrapping HTTP requests used to control and retrieve data from Tapo devices. The library is actively maintained, currently at version 3.4.13, and receives regular updates focused on bug fixes, performance enhancements, and support for new camera features such as dual-cam linkage.

pip install pytapo
INSTALL
IMPORT
SIG · PYTAPO
P
pytapo
http-networkingpythonv3.4.15
Install
7.3s avg
Import
2120ms
Disk
64MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.4.15 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 1.300s · 67.5MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 7.3s · import 1.244s · 69MB
64MB installed
● package 64MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Tapo
from pytapo import Tapo
The primary class for interacting with Tapo cameras.

Initialize the `Tapo` class with your camera's IP address, username, and password, then retrieve basic device information. Ensure you use the 'Camera Account' credentials set up in the Tapo mobile application.

import os from pytapo import Tapo # It's recommended to store sensitive information in environment variables. host = os.environ.get('TAPO_CAMERA_HOST', '192.168.1.100') # Replace with your camera's IP user = os.environ.get('TAPO_CAMERA_USER', 'camera_username') # Camera Account username from Tapo App password = os.environ.get('TAPO_CAMERA_PASSWORD', 'camera_password') # Camera Account password from Tapo App try: tapo = Tapo(host, user, password) basic_info = tapo.getBasicInfo() print(f"Successfully connected to Tapo camera {host}.") print(f"Device Name: {basic_info['device_name']}") print(f"Device ID: {basic_info['device_id']}") except Exception as e: print(f"Failed to connect to Tapo camera: {e}") print("Please ensure the host, username, and password are correct.") print("For authentication, use the 'Camera Account' created in the Tapo App (Settings > Advanced settings > Camera account).")
Debug
Known issues
gotchaAuthentication often fails due to incorrect credentials. Users frequently attempt to use their TP-Link cloud account password or an 'admin' username not configured as a local camera account.
fix
Always use the 'Camera Account' credentials established within the Tapo App (Settings > Advanced settings > Camera account). For some specific camera models or firmware, 'admin' with the TP-Link cloud password might be a fallback but is not the recommended method.
affects: All versions
gotchaDownloading recordings requires `ffmpeg` to be installed and available in your system's PATH, as `pytapo` uses it for stream conversion.
fix
Install `ffmpeg` on your operating system. For example, on Ubuntu: `sudo apt-get install ffmpeg`, or on macOS: `brew install ffmpeg`.
affects: All versions
breakingNew Tapo camera firmware versions can introduce changes that break compatibility with `pytapo` functions, requiring updates to the library or dependent integrations.
fix
Regularly update `pytapo` to the latest version. If using a Home Assistant integration, ensure the integration version is compatible with your `pytapo` version and camera firmware. Check the GitHub issues for known firmware-related problems.
affects: All versions, especially with new camera firmware.
gotchaUsers of `urllib3` versions 2.0 or higher might encounter `SSLV3_ALERT_HANDSHAKE_FAILURE` errors due to underlying changes in SSL/TLS handling.
fix
Upgrade `pytapo` to version 3.4.5 or newer, which includes fixes for `urllib3` compatibility. Ensure your `urllib3` library is also up to date.
affects: Versions prior to 3.4.5 (where an internal fix was noted)
gotchaKLAP camera models (e.g., C206, C212) can exhibit 'Server disconnected' errors, particularly if the camera hasn't been fully initialized through the official app or if the local authentication service isn't active.
fix
Ensure the camera is fully set up and initialized via the official Tapo app. Explicitly enable and configure the local 'Camera Account' within the Tapo App. Avoid using 'admin' as a local RTSP username if not explicitly supported or advised by the camera's local account settings.
affects: All versions, affecting KLAP-enabled cameras.
Errors
Common errors & fixes
Exception: Invalid authentication data
The username or password provided to the `Tapo` class constructor is incorrect, or you are attempting to use TP-Link cloud credentials instead of the local 'Camera Account' credentials.
fix
Verify the host IP, username, and password. Create or use the 'Camera Account' credentials from the Tapo App (Settings > Advanced settings > Camera account). These are distinct from your TP-Link cloud account.
PyTapo KLAP Error #3: ('Device connection error: XXX.XXX.XXX.XXX: Server disconnected', ServerDisconnectedError('Server disconnected'))
A connection issue specific to KLAP-protocol cameras, often occurring when the camera's local authentication service isn't fully active, or the camera hasn't completed initial setup via the official Tapo app.
fix
Complete the camera's setup process through the official Tapo mobile application. Ensure the 'Camera Account' is enabled and configured correctly. Verify network connectivity and that the camera IP is reachable.
DependencyError: Could not setup dependencies: Incorrect pytapo version installed: X.X.X. Required: Y.Y.Y.
An integration (e.g., Home Assistant) explicitly requires a different or newer version of `pytapo` than what is currently installed in your environment.
fix
Upgrade `pytapo` to the exact required version (Y.Y.Y) or the latest version if the integration allows. Use `pip install --upgrade pytapo` or `pip install pytapo==Y.Y.Y`.
Error code -71112 when browsing media
An internal error code indicating a failure when trying to retrieve or browse media from the camera.
fix
Update `pytapo` to version 3.4.9 or later, as this specific issue was addressed in that release.
Upgrade
Version history
3.4.15latest on PyPI · released Jun 11, 2026
Audit
Dependencies
urllib3requiredHTTP client for network requests.
rtprequiredLikely related to real-time protocol handling for streams.
requestsrequiredHTTP client for network requests.
python-kasarequiredInteroperability with TP-Link Kasa devices, often related to Tapo's parent ecosystem.
pycryptodomerequiredCryptographic operations for secure communication with cameras.
ffmpegoptionalRequired for converting recording streams to watchable video files.
Agent activity
25 hits · last 30 days
node
20
Resources
pytapo — pip install pytapo · libregistry