Skip to main content

Module for interacting with OpenWrt Luci RPC interface

Project description

openwrt-luci-rpc

https://img.shields.io/pypi/v/openwrt_luci_rpc.svg https://img.shields.io/travis/fbradyirl/openwrt-luci-rpc.svg Documentation Status

Python3 module for interacting with the OpenWrt Luci RPC interface

Features

  • Allows you to use the Luci RPC interface to fetch connected devices on your OpenWrt based router.

  • Supports 17.X & 18.X or newer releases of OpenWrt.

Usage

You will first need to install the package luci-mod-rpc on your OpenWrt router.

opkg update
opkg install luci-mod-rpc

Once that is done, you can use this module to interact with the RPC interface.

Install

pip install openwrt-luci-rpc

Use

from openwrt_luci_rpc import OpenWrtRpc

router = OpenWrtRpc('192.168.1.1', 'root', 'mypassword')
result = router.get_all_connected_devices(only_reachable=True)

for device in result:
   mac = device.mac
   name = device.hostname

   # convert class to a dict
   device_dict = device._asdict()

Development

See contributing guide.

History

0.1.0 (2019-02-19)

  • Initial release. Not working. Do not use.

0.2.0 (2019-02-19)

  • Initial release. Not working. Do not use.

0.3.0 (2019-02-19)

  • First working release on PyPI.

0.4.8 (2019-02-20)

  • Fix travis deploy repo, once more.

0.4.9 (2019-02-20)

  • Fix README formatting for docs.

0.4.10 (2019-02-20)

  • Fix links to github repo

0.4.11 (2019-02-20)

  • Updated usage in README.

0.4.12 (2019-02-20)

  • Fix typo in README.

0.4.13 (2019-02-20)

  • Fix README parse issue.

1.0.0 (2019-02-21)

  • Updated to return all device information.

  • Added extra unit tests.

1.0.1 (2019-02-22)

  • Minor bug fixes and extra unit tests

1.0.2 (2019-02-22)

  • Logging fixes around token refresh

1.0.3 (2019-02-22)

  • Fix History.rst formatting issue.

1.0.4 (2019-02-22)

  • Take SSL param in init now

  • Fix some typos

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

openwrt-luci-rpc-1.0.4.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

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

openwrt_luci_rpc-1.0.4-py2.py3-none-any.whl (8.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file openwrt-luci-rpc-1.0.4.tar.gz.

File metadata

  • Download URL: openwrt-luci-rpc-1.0.4.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

File hashes

Hashes for openwrt-luci-rpc-1.0.4.tar.gz
Algorithm Hash digest
SHA256 fe7a32d8a0f34dceeae0e0dbb1a8952e33efa3c13a50750202f28ac493097c99
MD5 2221639ce9f3a6dc0b4537a41ea5a0bb
BLAKE2b-256 85c4cfaa3485b54fb492aab883cf68202f68555ddeb90b44a5d4ef17bd1b56ce

See more details on using hashes here.

File details

Details for the file openwrt_luci_rpc-1.0.4-py2.py3-none-any.whl.

File metadata

  • Download URL: openwrt_luci_rpc-1.0.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

File hashes

Hashes for openwrt_luci_rpc-1.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5033c917a21cea62e5994268f7f058e3d964a5fcfc07970300762f37e75c5606
MD5 fa48c6f6342c32d75aca0fb75ceae252
BLAKE2b-256 b157bf28d937ba88511e651bfbdd37fc5a6c5c9cc18a7423988848398d262609

See more details on using hashes here.

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