{"id":22406,"library":"ssdp","title":"SSDP (Simple Service Discovery Protocol)","description":"Python asyncio library for Simple Service Discovery Protocol (SSDP). Supports both client and server roles, enabling discovery and advertisement of network services. Current version 1.3.1, released under MIT license. Active development with asyncio-native design.","status":"active","version":"1.3.1","language":"python","source_language":"en","source_url":"https://github.com/jd/ssdp","tags":["ssdp","upnp","discovery","asyncio","network"],"install":[{"cmd":"pip install ssdp","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Standard import path","symbol":"SSDPClient","correct":"from ssdp import SSDPClient"},{"note":"Standard import path","symbol":"SSDPServer","correct":"from ssdp import SSDPServer"},{"note":"SSDPError is in the top-level ssdp module, not in a submodule","wrong":"from ssdp.exceptions import SSDPError","symbol":"SSDPError","correct":"from ssdp import SSDPError"}],"quickstart":{"code":"import asyncio\nfrom ssdp import SSDPClient\n\nasync def discover():\n    client = SSDPClient()\n    async with client:\n        services = await client.discover(st='upnp:rootdevice', mx=3)\n        for service in services:\n            print(f'Location: {service.location}')\n\nasyncio.run(discover())","lang":"python","description":"Discover UPnP devices on the network."},"warnings":[{"fix":"Use async/await pattern. Wrap code in asyncio.run() if needed.","message":"Version 1.3.0 removed the old synchronous API. All functionality now requires asyncio.","severity":"breaking","affected_versions":">=1.3.0"},{"fix":"Use 'async with client:' or call await client.start() and await client.close().","message":"SSDPClient/SSDPServer must be used as async context managers or have start()/close() called explicitly.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set loopback=True in SSDPClient constructor to enable.","message":"The library does not support multicast loopback by default, so discovery may not see services on the same host.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Upgrade to latest: pip install --upgrade ssdp","cause":"Outdated library version (<1.0.0) where API names differ.","error":"AttributeError: module 'ssdp' has no attribute 'SSDPClient'"},{"fix":"Use await discover() directly or nest in another async function.","cause":"Calling asyncio.run(discover()) inside a running event loop (e.g., Jupyter notebook).","error":"RuntimeError: This event loop is already running"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}