Python SSDP library
Project description
SSDPy: Python SSDP library
SSDPy is a lightweight implementation of SSDP (Simple Service Discovery Protocol). It is designed for ease of use and high compatibility with the protocol in real-life use. It supports both the IETF and UPnP versions of the protocol.
Example usage
Send an SSDP discover packet (M-SEARCH):
>>> from ssdpy import SSDPClient
>>> client = SSDPClient()
>>> devices = client.m_search("ssdp:all")
>>> for device in devices:
... print(device.get("usn"))
uuid:Dell-Printer-1_0-dsi-secretariat::urn:schemas-upnp-org:service:PrintBasic:1
uuid:00000000-0000-0000-0200-00125A8A0960::urn:schemas-microsoft-com:nhed:presence:1
Send an SSDP NOTIFY packet, telling others about a service:
>>> from ssdpy import SSDPServer
>>> server = SSDPServer("my-service-identifier")
>>> server.notify()
Start an SSDP server which responds to relevant M-SEARCHes:
>>> from ssdpy import SSDPServer
>>> server = SSDPServer("my-service-identifier", device_type="my-device-type")
>>> server.serve_forever()
Then, from a client, M-SEARCH for our server:
>>> from ssdpy import SSDPClient
>>> client = SSDPClient()
>>> devices = client.m_search("my-device-type")
>>> for device in devices:
... print(device.get("usn"))
my-service-identifier
Links
- IETF draft of the protocl (still in use by some devices, e.g. redfish) https://tools.ietf.org/html/draft-cai-ssdp-v1-03
- UPnP Device Architecture 1.1 https://web.archive.org/web/20150905102426/http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf
- UPnP Device Architecture 2.0 https://web.archive.org/web/20151107123618/http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v2.0.pdf
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ssdpy-0.2.1.tar.gz
(8.6 kB
view hashes)
Built Distribution
ssdpy-0.2.1-py2.py3-none-any.whl
(12.2 kB
view hashes)
Close
Hashes for ssdpy-0.2.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 853db9dd7402e6147d5a5fbf018767d49554a5ec79a62109cb94dc1063eb9423 |
|
MD5 | f406e2cd3522c456b6356bfa9da06d35 |
|
BLAKE2b-256 | ee5cb04c72410c878cd3cc28d5f38d27c07c6c60a2155feb6b735272a3120fff |