Skip to main content

An easy to use UPnP TR64 protocol library

Project description

This library supports the discovery of UPnP devices in the local network and let you execute actions on them if the device supports any. Also it contains a convenient way to execute TR64 protocol actions on routers or other network devices which supports TR64.

>>> results = simpletr64.discover()
>>> print(results[0])
LOC: http://192.168.178.1:49000/tr64desc.xml SRV: urn:dslforum-org:device:InternetGatewayDevice:1
...
>>> device = simpletr64.DeviceTR64(hostname=192.168.178.1, port=49000)
...
>>> device.execute("/upnp/control/hosts", "urn:dslforum-org:service:Hosts:1", "GetGenericHostEntry", NewIndex=1)
{'NewActive': '0', 'NewIPAddress': '192.168.0.23', 'NewMACAddress': '9C:20:7B:E7:FF:5F', 'NewInterfaceType':
    'Ethernet', 'NewHostName': 'Apple-TV', 'NewAddressSource': 'DHCP', 'NewLeaseTimeRemaining': '0'}

or even easier, execute:

>>> device = System("192.168.178.1")
>>> device.setupTR64Device("fritz.box")
>>> print(device.getSystemInfo().manufactureName)
"AVM"

On the command line:

$ upnp_tools discover

Features

  • Discovery of UPnP devices in the local network

  • Gathering of UPnP device information’s

  • Executing of UPnP actions

  • Authentication for username/password or password only

  • HTTP(S) proxy support

  • Unicode

  • Provides shell command ‘upnp_tools’ for all above

Installation

To install Simple TR64, simply:

$ pip install simpletr64

Documentation

Please, see the documentation here

Release History

1.0.6 (2016-01-24)

  • Fix error in upnp_tools when no command was given

1.0.5 (2016-01-15)

  • Adding the support for DNLA devices which announce some device definitions slightly differently

  • Moving all tools/ scripts into one “upnp_tools” script and move it to bin so it get installed into exe path

1.0.4 (2016-01-11)

  • Adding Fritz specific actions

  • Fix a bug with installing the package, thanks to Raphael Sobik

1.0.3 (2016-01-08)

  • Added timeout to any TR64 action

  • Added getSpecificAssociatedDeviceInfo in Wifi actions

  • Added setEnable to toggle the LAN/WAN/Wifi interface on/off

  • Added setSSID and setChannel to set these Wifi interface parameters accordingly

  • Added softwareUpdateAvailable

  • Added requestConnection and terminateConnection for a WAN connection

  • Added AVM Fritz Box product specific capabilities in new Fritz class

  • Fix reboot action

  • Fix all TR64 actions with bool results which were always True

1.0.2 (2016-01-06)

  • Added the ability to request the namespace for a TR64 action

  • Added interface ID’s to all actions in Lan, Wan and Wifi

  • Added a factory method to DeviceTR64 which takes an URL to the device definitions

  • Improved error handling on XML parsing problems of any content

  • Changed the declaration of getGenericAssociatedDeviceInfo for consistency reasons

  • Changed for all Wifi actions that the interface id is now optional

  • Changed all TR64 action classes to be a sub class of DeviceTR64

  • Fix an issue with relative URL’s in the device definition

1.0.1 (2016-01-04)

  • Added better error reporting

  • Added timeout to any network interaction

  • added the possibility to discover more than one service at the same time

  • fixed getHostDetailsByMACAddress()

1.0.0 (2016-01-02)

  • Birth!

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

simpleTR64-1.0.6.tar.gz (36.8 kB view details)

Uploaded Source

Built Distribution

simpleTR64-1.0.6-py2.py3-none-any.whl (50.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file simpleTR64-1.0.6.tar.gz.

File metadata

  • Download URL: simpleTR64-1.0.6.tar.gz
  • Upload date:
  • Size: 36.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for simpleTR64-1.0.6.tar.gz
Algorithm Hash digest
SHA256 754e21d62a7de4ac4497615f17aaeef1ab556d5ddd05d8102a0e7bf9144784fd
MD5 cbb1b859e5f7d45aa5e492cb0aca98e4
BLAKE2b-256 4547313cc0ab104188e7bbe80b5bc128157e27d43b938c884c1426d0949f4c58

See more details on using hashes here.

File details

Details for the file simpleTR64-1.0.6-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for simpleTR64-1.0.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8bacccf7816ea591af36804a7fb4be6a51e7124fdab93b63beaf714ac1f62350
MD5 a2c064ffa2dfaee2cd8894762ec81610
BLAKE2b-256 e7b16fd84535d855cca74ae343c206eab5fa0d2fba8538cbe95862704cc7381d

See more details on using hashes here.

Supported by

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