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 = DeviceTR64("fritz.box")
>>> device.setupTR64Device("fritz.box")
>>> system = System(device)
>>> print(system.getSystemInfo().manufactureName)
"AVM"
Also please see the tools which have been provided with this library, these demonstrates the full functionality.
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
Installation
To install Simple TR64, simply:
$ pip install simpletr64
Documentation
Please, see the documentation here
Release History
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
Built Distribution
Hashes for simpleTR64-1.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3ccb25064fc955076725b2e3b34b230752cc4f55793013b2b3bcc2c1ec4c035 |
|
MD5 | ceb6e600716bfc9ff95e07611c548297 |
|
BLAKE2b-256 | 5951b3df032c4b309ec3b63d6dade6318d4082eac1ba2f149a442ef6080f216c |