Skip to main content

Python SSDP library

Project description

SSDPy: Python SSDP library Build Status PyPI PyPI - Wheel GitHub codecov

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

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.

Links

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

ssdpy-0.2.4.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ssdpy-0.2.4-py2.py3-none-any.whl (12.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file ssdpy-0.2.4.tar.gz.

File metadata

  • Download URL: ssdpy-0.2.4.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/35.0.2 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/2.7.17

File hashes

Hashes for ssdpy-0.2.4.tar.gz
Algorithm Hash digest
SHA256 86451b0dd7f8caaffb4cabe7820fae7310cd3f4ca8c58b9657993206f79f4807
MD5 0f24f4824d3b8c035361698897cb61b1
BLAKE2b-256 c39461a675647f33fc4816ff66097b89747ec0ff4ab0a4f2bca215cf7b5ccbbf

See more details on using hashes here.

File details

Details for the file ssdpy-0.2.4-py2.py3-none-any.whl.

File metadata

  • Download URL: ssdpy-0.2.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/35.0.2 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/2.7.17

File hashes

Hashes for ssdpy-0.2.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3feda14755a8aaec4465bd4bbc5d22d456d8e92157704912e46d66f2efd00e67
MD5 c44c9eae3cb3f3b4f2a0d6ebea4989e8
BLAKE2b-256 9830154797ea6a0d5a40737a4ab4d9c1135c2e243182eb2b04339c57c27230ad

See more details on using hashes here.

Supported by

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