Metadata-Version: 2.1
Name: ssdp
Version: 1.1.1
Summary: Python asyncio library for Simple Service Discovery Protocol (SSDP).
Keywords: ssdp,python,asyncio,upnp,iot
Author-email: Johannes Maron <johannes@maron.family>
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Framework :: AsyncIO
Classifier: Topic :: System :: Networking
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Home Automation
Requires-Dist: pytest ; extra == "test"
Requires-Dist: pytest-cov ; extra == "test"
Project-URL: Changelog, https://github.com/codingjoe/ssdp/releases
Project-URL: Project-URL, https://github.com/codingjoe/ssdp
Provides-Extra: test

# Python SSDP

Python asyncio library for Simple Service Discovery Protocol (SSDP).

SSDP is a UPnP substandard. For more information see:
https://en.wikipedia.org/wiki/Simple_Service_Discovery_Protocol

## Setup

```bash
python3 -m pip install ssdp
```

## Usage

```python
import asyncio
import socket

import ssdp


class MyProtocol(ssdp.SimpleServiceDiscoveryProtocol):

    def response_received(self, response, addr):
        print(response, addr)

    def request_received(self, request, addr):
        print(request, addr)


loop = asyncio.get_event_loop()
connect = loop.create_datagram_endpoint(MyProtocol, family=socket.AF_INET)
transport, protocol = loop.run_until_complete(connect)

notify = ssdp.SSDPRequest('NOTIFY')
notify.sendto(transport, (MyProtocol.MULTICAST_ADDRESS, 1982))

try:
    loop.run_forever()
except KeyboardInterrupt:
    pass

transport.close()
loop.close()
```

## Examples

The `examples <examples/>`\_ directory contains examples on how to use
this library.

