Async Python client for the Linksys JNAP API
Project description
jnap
Async Python client for the Linksys JNAP API.
Installation
pip install jnap
Usage
import asyncio
import aiohttp
from jnap import JNAPClient
async def main():
async with aiohttp.ClientSession() as session:
client = JNAPClient("192.168.1.1", session, password="your-password")
info = await client.get_device_info()
print(info.description, info.serial_number)
response = await client.get_devices()
for device in response.devices:
print(device.name, device.mac, device.ip_address)
asyncio.run(main())
API
JNAPClient(host, session, password, *, username="admin")
The main client class. Accepts an existing aiohttp.ClientSession so you can manage connection pooling and lifecycle yourself.
Methods
-
await client.get_device_info()→GetDeviceInfoResponse
Returns the router's description and serial number. -
await client.get_devices()→GetDevicesResponse
Returns all devices currently connected to the router. Only devices with a known MAC address and an active connection are included.
Models
| Class | Fields |
|---|---|
GetDeviceInfoResponse |
description, serial_number |
GetDevicesResponse |
devices: list[JNAPDevice] |
JNAPDevice |
mac, name, ip_address, hostname |
Device names are resolved in priority order: user-assigned name → friendly name → device ID.
Exceptions
All exceptions inherit from JNAPError.
| Exception | Raised when |
|---|---|
JNAPUnauthorizedError |
Authentication failed |
JNAPUnknownActionError |
The device does not recognise the action |
JNAPInvalidInputError |
The request was rejected as invalid |
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 jnap-0.1.0.tar.gz.
File metadata
- Download URL: jnap-0.1.0.tar.gz
- Upload date:
- Size: 54.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fa26e6a53b99f51ce4e7093ec48d2295241dfb76511ee6e24ebc3d83fa138d1
|
|
| MD5 |
022719a6721646df891fad44262855c8
|
|
| BLAKE2b-256 |
8ddc2396e590d81f454bb898d8f0f97da257b71d714f3e70774243fc31b409a6
|
Provenance
The following attestation bundles were made for jnap-0.1.0.tar.gz:
Publisher:
publish.yml on jmalcic/jnap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jnap-0.1.0.tar.gz -
Subject digest:
3fa26e6a53b99f51ce4e7093ec48d2295241dfb76511ee6e24ebc3d83fa138d1 - Sigstore transparency entry: 1984492700
- Sigstore integration time:
-
Permalink:
jmalcic/jnap@cfacfe56cd454022814e23622042b973195767b7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/jmalcic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cfacfe56cd454022814e23622042b973195767b7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file jnap-0.1.0-py3-none-any.whl.
File metadata
- Download URL: jnap-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.9 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 |
1fbb97b4c51b1aead58bf156bb76da87461456a2b17adbe81198b29f8e0b4624
|
|
| MD5 |
52e9b0e9a97ef4f93112bef70a626f4d
|
|
| BLAKE2b-256 |
24ce276a80d8d8053c9b278cd9e359c5e4f6c19f0415653f2df98a429febc3f5
|
Provenance
The following attestation bundles were made for jnap-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on jmalcic/jnap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jnap-0.1.0-py3-none-any.whl -
Subject digest:
1fbb97b4c51b1aead58bf156bb76da87461456a2b17adbe81198b29f8e0b4624 - Sigstore transparency entry: 1984492785
- Sigstore integration time:
-
Permalink:
jmalcic/jnap@cfacfe56cd454022814e23622042b973195767b7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/jmalcic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cfacfe56cd454022814e23622042b973195767b7 -
Trigger Event:
push
-
Statement type: