Skip to main content

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!

Release files for simpleTR64 1.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simpleTR64 1.0.6
File Size Uploaded
simpleTR64-1.0.6.tar.gz 36.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simpleTR64 1.0.6
File Interpreter ABI Platform
simpleTR64-1.0.6-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 86.9 kB

Release files / simpleTR64-1.0.6.tar.gz

Download URL simpleTR64-1.0.6.tar.gz
Size 36.8 kB
Tags Source
SHA-256 checksum
How to use checksums
754e21d62a7de4ac4497615f17aaeef1ab556d5ddd05d8102a0e7bf9144784fd
BLAKE2b-256 checksum
How to use checksums
4547313cc0ab104188e7bbe80b5bc128157e27d43b938c884c1426d0949f4c58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / simpleTR64-1.0.6-py2.py3-none-any.whl

Download URL simpleTR64-1.0.6-py2.py3-none-any.whl
Size 50.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8bacccf7816ea591af36804a7fb4be6a51e7124fdab93b63beaf714ac1f62350
BLAKE2b-256 checksum
How to use checksums
e7b16fd84535d855cca74ae343c206eab5fa0d2fba8538cbe95862704cc7381d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.6 This release

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page