Python client for the Swisscom Internet-Box
Project description
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'}")
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" |
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_swisscom_internet_box-0.1.1.tar.gz.
File metadata
- Download URL: python_swisscom_internet_box-0.1.1.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
109859d23635b0b271d5c40df6af9df1d71926d2f6f4e41ca607342c9e9636ef
|
|
| MD5 |
2b468edb8a2d3708b3608f3875943e52
|
|
| BLAKE2b-256 |
b4208698c3cc28471a368cb17d961f1dbadd7a8b87858bb18d5000c1235f1330
|
Provenance
The following attestation bundles were made for python_swisscom_internet_box-0.1.1.tar.gz:
Publisher:
publish.yml on anatosun/python-swisscom-internet-box
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_swisscom_internet_box-0.1.1.tar.gz -
Subject digest:
109859d23635b0b271d5c40df6af9df1d71926d2f6f4e41ca607342c9e9636ef - Sigstore transparency entry: 1643382706
- Sigstore integration time:
-
Permalink:
anatosun/python-swisscom-internet-box@aa75bf01c56db41cbd497592899047976767ce7f -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/anatosun
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@aa75bf01c56db41cbd497592899047976767ce7f -
Trigger Event:
push
-
Statement type:
File details
Details for the file python_swisscom_internet_box-0.1.1-py3-none-any.whl.
File metadata
- Download URL: python_swisscom_internet_box-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
faf3fdddac6b9b8ec9746022abc7f2ab1e1b2d1ab150305bc817df1445eaea14
|
|
| MD5 |
6fd87e92bf21b0c840e26ca9399b4709
|
|
| BLAKE2b-256 |
e7b134d21624fa277d9931cb1b5df7c61d00f7dd67680135fe294893a55a70bd
|
Provenance
The following attestation bundles were made for python_swisscom_internet_box-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on anatosun/python-swisscom-internet-box
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_swisscom_internet_box-0.1.1-py3-none-any.whl -
Subject digest:
faf3fdddac6b9b8ec9746022abc7f2ab1e1b2d1ab150305bc817df1445eaea14 - Sigstore transparency entry: 1643382835
- Sigstore integration time:
-
Permalink:
anatosun/python-swisscom-internet-box@aa75bf01c56db41cbd497592899047976767ce7f -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/anatosun
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@aa75bf01c56db41cbd497592899047976767ce7f -
Trigger Event:
push
-
Statement type: