Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ssdpy

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ssdpy

Python SSDP library

  • 0.4.1
  • PyPI
  • Socket score

Maintainers
1

SSDPy: Python SSDP library Build PyPI PyPI - Wheel GitHub codecov Read the Docs

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. You can read the full documentation here.

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

CLI utilities

SSDPy comes with two CLI utilities:

  • ssdpy-server is a server that listens for M-SEARCHes and responds if they match its name.
  • ssdpy-discover sends an M-SEARCH query and collects all responses.

Release checklist

  • Update ssdpy/version.py with new version name.
  • Update CHANGES.md.
  • Commit the changes, tag with version & push.
  • Run make release.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc