python-swisscom-internet-box
Async Python client for the Swisscom Internet-Box local API (/ws endpoint).
Installation
pip install python-swisscom-internet-box
Usage
import asyncio
import aiohttp
from swisscom_internet_box import SwisscomClient
async def main():
async with aiohttp.ClientSession() as session:
client = SwisscomClient(session, "192.168.1.1", "admin", "your-password")
# Device info & WAN status (unauthenticated)
info = await client.get_box_info()
print(f"{info.model_name} — FW {info.software_version}")
wan = await client.get_wan_status()
print(f"WAN: {wan.connection_state} ({wan.protocol})")
# WiFi access points (includes guest network)
for ap in await client.get_access_points():
label = "guest" if ap.is_guest else "main"
print(f"[{label}] {ap.ssid} — {ap.frequency_band} — {'on' if ap.enabled else 'off'}")
# Connected LAN devices
for device in await client.get_devices():
if device.active:
print(f"{device.name} — {device.ip_address} — {'wifi' if device.is_wireless else 'eth'}")
# Steer the box (authenticated; logs in automatically)
await client.set_guest_wifi(True) # turn the guest network on
await client.set_wifi(False) # turn all WiFi off
await client.reboot() # reboot the box
asyncio.run(main())
API
SwisscomClient(session, host, username, password)
| Method | Auth required | Description |
|---|---|---|
get_box_info() |
No | Manufacturer, model, firmware, MAC, uptime |
get_wan_status() |
No | Link type/state, protocol, connection state |
get_nmc_info() |
No | WAN mode, active interface, provisioning state |
get_wifi_status() |
No | WiFi global enable/active state |
get_access_points() |
Yes | All VAPs (main + guest); use ap.is_guest to filter |
get_devices(expression) |
Yes | LAN devices; default expression: "lan and not self" |
set_wifi(enabled) |
Yes | Turn all WiFi radios on/off (global switch) |
set_guest_wifi(enabled) |
Yes | Turn the guest WiFi network on/off |
reboot(reason) |
Yes | Reboot the box (default reason: "GUI_Reboot") |
Device expressions
| Expression | Result |
|---|---|
"lan and not self" |
All LAN clients (default) |
"wifi" |
Wireless clients only |
"eth" |
Wired clients only |
Models
BoxInfo—manufacturer,model_name,software_version,base_mac,up_time,device_statusWANStatus—link_type,link_state,protocol,connection_state,.is_connectedNMCInfo—wan_mode,active_wan_interface,provisioning_stateWiFiStatus—enabled,active,wps_enabled,scheduler_enabledAccessPoint—key,ssid,bssid,enabled,frequency_band,channel,.is_guestDevice—key,name,phys_address,ip_address,active,interface_name,.is_wireless,ipv4_addresses,ipv6_addresses,bandwidth
Compatibility
Tested on Internet-Box 4 (IB4-00, firmware 14.20.40). Should work on IB2, IB3 and IB5 running similar firmware.
License
MIT
Metadata
Release files for python-swisscom-internet-box 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| python_swisscom_internet_box-0.2.0.tar.gz | 7.4 kB | With provenance | Details for python_swisscom_internet_box-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_swisscom_internet_box-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for python_swisscom_internet_box-0.2.0-py3-none-any.whl |
Total release size: 16.3 kB
Release files / python_swisscom_internet_box-0.2.0.tar.gz
| Download URL | python_swisscom_internet_box-0.2.0.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1b5fe15b68d1e882960274aa717a8aea9516f6f18c971c04d4cef9c380420eec
|
|
BLAKE2b-256 checksum How to use checksums |
f0874033d1cf5d94bd1cdde3bae02891440222bbfdccdab6933580d27225f274
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.
Transparency logRelease files / python_swisscom_internet_box-0.2.0-py3-none-any.whl
| Download URL | python_swisscom_internet_box-0.2.0-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b590b5c1ceae49fb1b01e8fad0bf6aa723f49419738b7e00f6950d434fd08e9
|
|
BLAKE2b-256 checksum How to use checksums |
754d41362afe3908a11dcd0e4b8802c5cd240682baaa4967f62ef21b1d3ca321
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.
Transparency logSecurity for python-swisscom-internet-box 0.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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for python_swisscom_internet_box-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.
Transparency logA 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.