Skip to main content

tplink-deco-api

CI PyPI

Sponsor

Python SDK for controlling TP-Link Deco mesh Wi-Fi routers via the internal HTTP API.

Installation

pip install tplink-deco-api

Usage

from tplink_deco_api import DecoClient

with DecoClient("192.168.68.1", "admin", "your-password") as deco:
    for client in deco.get_client_list():
        print(client.name, client.ip, client.connection_type)

Available methods

Session

Method Returns
login() LoginResult
logout() None
is_authenticated() bool

Typed queries

Method Returns
get_device_list() list[Device]
get_device_mode() DeviceMode
get_wlan_config() WlanConfig
get_performance() Performance
get_client_list(deco_mac?) list[ClientDevice]
get_client_totals(deco_mac?) NetworkTotals
get_internet_status() InternetStatus
get_wan_info(device_mac?) WanInfo
get_dsl_status(device_mac?) DslStatus
get_wireless_power(device_mac?) WirelessPower
get_time_settings(device_mac?) TimeSettings
get_log_types() list[LogType]
get_system_log(severity, page?) SystemLogPage

Client management — deco.clients

Method Returns
update(mac, name, client_type?) None
remove(mac) None
get_blocked() list[BlockedClient]
block(mac, name, client_type) None
unblock(mac) None

update always sends the name: the firmware ignores an edit that does not carry one, so pass the current name to change only the device type. remove forgets an offline client; the router lists it again if it reconnects.

Fixed IPs — deco.address_reservations

Method Returns
get_table() AddressReservationTable
add(reservation) None
modify(current, replacement) None
remove(mac) None
from tplink_deco_api import AddressReservation, DecoClient

with DecoClient("192.168.68.1", "admin", "your-password") as deco:
    deco.address_reservations.add(AddressReservation("AA:BB:CC:DD:EE:FF", "192.168.68.50"))
    deco.clients.update("AA:BB:CC:DD:EE:FF", "Living Room TV")

MAC addresses are accepted with : or - separators. Malformed MAC or IPv4 input raises ValueError before any request is sent.

LAN address — deco.network

Method Returns
get_lan_ip(device_mac?) LanIp
set_lan_ip(ip, mask, device_mac?) None

set_lan_ip moves the router to a new address, so the current session stops answering; open a new DecoClient on the new IP.

Wi-Fi — deco.wireless

Method Returns
get_fast_roaming() bool
get_ht160_enabled() bool
get_operation_mode() str
get_bridge() WirelessBridge
set_wlan(band, *, guest?, ssid?, password?, enable?) None

set_wlan sends only the arguments you pass; SSID and password are base64-encoded for you.

Mesh nodes — deco.devices

Method Returns
reboot(*macs) None

reboot takes node MACs as returned by get_device_list(); rebooting the gateway drops the session.

Supported endpoints — deco.capabilities

Method Returns
probe(interval?) list[EndpointCapability]

probe sends every documented read (never a write) and tells you, per path + form, whether this model answers it: ok, empty, absent (HTTP 404, module not in the firmware) or error (with the HTTP status or error_code). It takes under a minute.

Raw access

request(path, form, data) and request_list(path, form, data) send an authenticated, encrypted request to any endpoint and return the decrypted result (as an object or a list respectively). Use them for the endpoints that have no typed wrapper yet — the full catalogue is documented in docs/endpoints/.

Models

Every method returns typed dataclasses — no generic dictionaries.

client.mac              # "AA:BB:CC:DD:EE:FF"
client.name             # "MacBook Pro"
client.ip               # "192.168.68.10"
client.connection_type  # "band6"
client.online           # True

device.device_model     # "BE65"
device.software_ver     # "1.2.10 Build 20251229"

wlan.band2_4.host.ssid      # "My Network"
wlan.band2_4.guest.password # "guest-password"

perf.cpu_usage  # 0.03
perf.mem_usage  # 0.42

Requirements

  • Python 3.14+
  • TP-Link Deco router reachable on the local network

Support

This SDK is built and maintained on personal time, on hardware bought for the purpose. If it is useful to you, consider sponsoring the work — it keeps the devices, the testing and the releases coming.

License

MIT

Metadata

Release files for tplink-deco-api 2.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tplink-deco-api 2.2.0
File Size Uploaded Provenance Actions
tplink_deco_api-2.2.0.tar.gz 140.2 kB Without provenance Details for tplink_deco_api-2.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tplink-deco-api 2.2.0
File Interpreter ABI Platform Actions
tplink_deco_api-2.2.0-py3-none-any.whl Python 3 none any Details for tplink_deco_api-2.2.0-py3-none-any.whl

Total release size: 184.8 kB

Security for tplink-deco-api 2.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page