Package: zeroconf
python-zeroconfDocumentation.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.Compatible with:BonjourAvahiCompared to some other Zeroconf/Bonjour/Avahi Python packages, python-zeroconf:isn’t tied to Bonjour or Avahidoesn’t use D-Busdoesn’t force you to use particular event loop or Twisted (asyncio is used under the hood but not required)is pip-installablehas PyPI distributionhas an optional cython extension for performance (pure python is supported as well)Python compatibilityCPython 3.7+PyPy3.7 7.3+VersioningThis project uses semantic versioning.StatusThis project is actively maintained.Traffic ReductionBefore version 0.32, most traffic reduction techniques described inhttps://datatracker.ietf.org/doc/html/rfc6762#section-7where not implemented which could lead to excessive network traffic.  It is highly recommended that version 0.32 or later
is used if this is a concern.IPv6 supportIPv6 support is relatively new and currently limited, specifically:InterfaceChoice.Allis an alias forInterfaceChoice.Defaulton non-POSIX
systems.Dual-stack IPv6 sockets are used, which may not be supported everywhere (some
BSD variants do not have them).Listening on localhost (::1) does not work. Help with understanding why is
appreciated.How to get python-zeroconf?PyPI pagehttps://pypi.org/project/zeroconf/GitHub projecthttps://github.com/python-zeroconf/python-zeroconfThe easiest way to install python-zeroconf is using pip:pip install zeroconfHow do I use it?Here’s an example of browsing for a service:fromzeroconfimportServiceBrowser,ServiceListener,ZeroconfclassMyListener(ServiceListener):defupdate_service(self,zc:Zeroconf,type_:str,name:str)->None:print(f"Service{name}updated")defremove_service(self,zc:Zeroconf,type_:str,name:str)->None:print(f"Service{name}removed")defadd_service(self,zc:Zeroconf,type_:str,name:str)->None:info=zc.get_service_info(type_,name)print(f"Service{name}added, service info:{info}")zeroconf=Zeroconf()listener=MyListener()browser=ServiceBrowser(zeroconf,"_http._tcp.local.",listener)try:input("Press enter to exit...\n\n")finally:zeroconf.close()NoteDiscovery and service registration useallavailable network interfaces by default.
If you want to customize that you need to specifyinterfacesargument when
constructingZeroconfobject (see the code for details).If you don’t know the name of the service you need to browse for, try:fromzeroconfimportZeroconfServiceTypesprint('\n'.join(ZeroconfServiceTypes.find()))See examples directory for more.ChangelogChangelogLicenseLGPL, see COPYING file for details.