tailscale
Asynchronous Python client for the Tailscale API.
What it is and what it does
This package provides an async Python interface to the Tailscale API, letting you programmatically query device status, manage network configuration, and automate tailnet operations. It wraps HTTP calls to Tailscale's public API endpoints with typed dataclasses (Device, User, DNS settings, etc.) and exposes them through an async context manager. The client handles authentication via API key or OAuth, request timeouts, and JSON serialization using orjson for performance.
Typical use cases include Home Assistant integrations that trigger automations based on device connectivity, third-party tools that need to authorize or rename devices, and infrastructure scripts that manage subnet routes or DNS settings across a tailnet. An optional CLI is available for direct terminal access to the same operations without writing Python code.
Use it for:
- Home Assistant automations triggered by Tailscale device status changes or network events.
- Infrastructure scripts that authorize, rename, or delete devices from a tailnet programmatically.
- Third-party dashboards or monitoring tools that query device addresses, OS versions, and last-seen timestamps.
- DNS and subnet route management automation across multiple tailnet devices.
- Terminal-based CLI for quick device queries and tailnet administration without code.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Asynchronous Python client for querying and managing Tailscale networks programmatically via the Tailscale API, with optional command-line interface support.
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive MIT license. It is well-suited for anyone integrating Tailscale into Python automation, Home Assistant, or infrastructure tooling. Requires Python 3.11+ and a valid Tailscale API key; no other gotchas.
Install
tailscale on PyPI
pip
pip install tailscaleuv
uv add tailscalepoetry
poetry add tailscaleInstalling tailscale
Before you install
Low install friction with a pure Python wheel. Actively maintained with recent releases; last commit 2026-08-14. Requires Python 3.11 or later. Four runtime dependencies (aiohttp, mashumaro, orjson, yarl) are all stable, widely-used async/serialization libraries.
License in practice
MIT license (permissive) allows use in commercial and private projects with minimal restrictions—only requires preserving copyright and license notices.
Quickstart
import asyncio
from tailscale import Tailscale
async def main():
async with Tailscale(tailnet="your-tailnet", api_key="tskey-...") as ts:
devices = await ts.devices()
for device_id, device in devices.items():
print(f"{device.hostname} ({device.os})")
asyncio.run(main())
Requires a valid Tailscale API key (tskey-...) issued by Tailscale and a tailnet name to authenticate.
Verify before relying
- Whether the optional CLI extra (tailscale[cli]) adds significant dependencies or install friction beyond the base package.
- Performance characteristics when managing large tailnets (number of devices, API call latency).
- Compatibility with Tailscale API versions and any breaking changes in recent Tailscale service updates.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — aiohttp, mashumaro, orjson, yarl |
| Maintenance | actively maintained — 115 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 145,700/month — #11,120 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: tailscale-0.8.0-py3-none-any.whl
Keywords: api, async, client, home-assistant, mesh-vpn, network, tailnet, tailscale, vpn, wireguard
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
gotailwindAsynchronous Python client for controlling and…
permissive · top 15,000 on PyPI
pulumi-tailscaleA Pulumi resource provider that lets you…
permissive · top 15,000 on PyPI
python-bsblanAsynchronous Python client for controlling and…
permissive · top 15,000 on PyPI
adguardhomeAsynchronous Python client library for…
permissive · top 15,000 on PyPI
elgatoAsynchronous Python client for controlling and…
permissive · top 15,000 on PyPI
pysmartthingsAsynchronous Python client for fetching data…
permissive · top 15,000 on PyPI
energyzeroAsynchronous Python client for retrieving…
permissive · top 15,000 on PyPI
open-meteoProvides an asynchronous Python client for…
permissive · top 15,000 on PyPI
directvAsynchronous Python client for controlling and…
permissive · top 15,000 on PyPI
wledAn asynchronous Python client library for…
permissive · top 15,000 on PyPI