Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jnap-0.1.0.tar.gz (54.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jnap-0.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

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

Hashes for jnap-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3fa26e6a53b99f51ce4e7093ec48d2295241dfb76511ee6e24ebc3d83fa138d1
MD5 022719a6721646df891fad44262855c8
BLAKE2b-256 8ddc2396e590d81f454bb898d8f0f97da257b71d714f3e70774243fc31b409a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for jnap-0.1.0.tar.gz:

Publisher: publish.yml on jmalcic/jnap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for jnap-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1fbb97b4c51b1aead58bf156bb76da87461456a2b17adbe81198b29f8e0b4624
MD5 52e9b0e9a97ef4f93112bef70a626f4d
BLAKE2b-256 24ce276a80d8d8053c9b278cd9e359c5e4f6c19f0415653f2df98a429febc3f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for jnap-0.1.0-py3-none-any.whl:

Publisher: publish.yml on jmalcic/jnap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page