Pure Python Multicast DNS Service Discovery Library (Bonjour/Avahi compatible)
This is fork of pyzeroconf, Multicast DNS Service Discovery for Python, originally by Paul Scott-Murphy (https://github.com/paulsm/pyzeroconf), modified by William McBrine (https://github.com/wmcbrine/pyzeroconf).
The original William McBrine’s fork note:
This fork is used in all of my TiVo-related projects: HME for Python (and therefore HME/VLC), Network Remote, Remote Proxy, and pyTivo. Before this, I was tracking the changes for zeroconf.py in three separate repos. I figured I should have an authoritative source. Although I make changes based on my experience with TiVos, I expect that they're generally applicable. This version also includes patches found on the now-defunct (?) Launchpad repo of pyzeroconf, and elsewhere around the net -- not always well-documented, sorry.
Compared to some other Zeroconf/Bonjour/Avahi Python packages, python-zeroconf:
This project’s versions follow the following pattern: MAJOR.MINOR.PATCH.
There are some people using this package. I don’t actively use it and as such any help I can offer with regard to any issues is very limited.
The easiest way to install python-zeroconf is using pip:
pip install zeroconf
Here’s an example of browsing for a service:
from six.moves import input from zeroconf import ServiceBrowser, Zeroconf class MyListener(object): def remove_service(self, zeroconf, type, name): print("Service %s removed" % (name,)) def add_service(self, zeroconf, type, name): info = zeroconf.get_service_info(type, name) print("Service %s added, service info: %s" % (name, info)) zeroconf = Zeroconf() listener = MyListener() browser = ServiceBrowser(zeroconf, "_http._tcp.local.", listener) try: input("Press enter to exit...\n\n") finally: zeroconf.close()
Discovery and service registration use all available network interfaces by default. If you want to customize that you need to specify interfaces argument when constructing Zeroconf object (see the code for details).
If you don’t know the name of the service you need to browse for, try:
from zeroconf import ZeroconfServiceTypes print('\n'.join(ZeroconfServiceTypes.find()))
See examples directory for more.
LGPL, see COPYING file for details.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|File Name & Checksum SHA256 Checksum Help||Version||File Type||Upload Date|
|zeroconf-0.19.1-py2.py3-none-any.whl (27.1 kB) Copy SHA256 Checksum SHA256||3.6||Wheel||Jun 13, 2017|
|zeroconf-0.19.1.tar.gz (22.8 kB) Copy SHA256 Checksum SHA256||–||Source||Jun 13, 2017|