pyzmq API reference
143 public APIs from pyzmq (zeromq/pyzmq) — 49 classes, 28 functions, 66 methods. Signatures extracted by static analysis of the actual source.
Repository: zeromq/pyzmq
| Kind | Count |
|---|---|
| Classes | 49 |
| Functions | 28 |
| Methods | 66 |
API list
func
buildutils.constants.promoted_constants()Generate CONST: int for mypy
func
perf.perf.do_run(test, **kwargs)Do a single run
func
perf.perf.latency(url, count, size, poll=False, copy=True, quiet=False)Perform a latency test
class
zmq.asyncio.ContextContext for creating asyncio-compatible Sockets
class
zmq.asyncio.PollerPoller returning asyncio.Future for poll results.
class
zmq.asyncio.SocketSocket returning asyncio Futures for send/recv/poll methods.
class
zmq.asyncio.ZMQEventLoopDEPRECATED: AsyncIO eventloop using zmq_poll.
func
zmq.asyncio.install()DEPRECATED: No longer needed in pyzmq 17
class
zmq.auth.asyncio.AsyncioAuthenticatorZAP authentication for use in the asyncio IO loop
method
zmq.auth.asyncio.AsyncioAuthenticator.start() -> NoneStart ZAP authentication
method
zmq.auth.asyncio.AsyncioAuthenticator.stop() -> NoneStop ZAP authentication
class
zmq.auth.base.AuthenticatorImplementation of ZAP authentication for zmq connections.
method
zmq.auth.base.Authenticator.allow(*addresses:str) -> NoneAllow IP address(es).
method
zmq.auth.base.Authenticator.configure_curve(domain:str='*', location:Union[str, os.PathLike]='.') -> NoneConfigure CURVE authentication for a given domain.
method
zmq.auth.base.Authenticator.configure_curve_callback(domain:str='*', credentials_provider:Any=None) -> NoneConfigure CURVE authentication for a given domain.
method
zmq.auth.base.Authenticator.configure_plain(domain:str='*', passwords:Optional[dict[str, str]]=None) -> NoneConfigure PLAIN authentication for a given domain.
method
zmq.auth.base.Authenticator.deny(*addresses:str) -> NoneDeny IP address(es).
method
zmq.auth.base.Authenticator.handle_zap_message(msg:list[bytes])Perform ZAP authentication
method
zmq.auth.base.Authenticator.start() -> NoneCreate and bind the ZAP socket
method
zmq.auth.base.Authenticator.stop() -> NoneClose the ZAP socket
func
zmq.auth.certs.create_certificates(key_dir:Union[str, os.PathLike], name:str, metadata:Optional[dict[str, str]]=None) -> tuple[str, str]Create zmq certificates.
func
zmq.auth.certs.load_certificate(filename:Union[str, os.PathLike]) -> tuple[bytes, Optional[bytes]]Load public and secret key from a zmq certificate.
func
zmq.auth.certs.load_certificates(directory:Union[str, os.PathLike]='.') -> dict[bytes, bool]Load public keys from all certificates in a directory
class
zmq.auth.ioloop.IOLoopAuthenticatorZAP authentication for use in the tornado IOLoop
class
zmq.auth.thread.ThreadAuthenticatorRun ZAP authentication in a background thread
method
zmq.auth.thread.ThreadAuthenticator.is_alive() -> boolIs the ZAP thread currently running?
method
zmq.auth.thread.ThreadAuthenticator.start() -> NoneStart the authentication thread
method
zmq.auth.thread.ThreadAuthenticator.stop() -> NoneStop the authentication thread
method
zmq.backend.cffi.context.Context.get(option)get context option see zmq_ctx_get
method
zmq.backend.cffi.context.Context.set(option, value)set a context option see zmq_ctx_set
method
zmq.backend.cffi.message.Frame.fast_copy()Fast shallow copy of the Frame.
func
zmq.backend.cffi.utils.has(capability)Check for zmq capability by name (e.g.
func
zmq.backend.cffi.zmq_version_info()Get libzmq version as tuple of ints
class
zmq.backend.cython._zmq.ContextManage the lifecycle of a 0MQ context.
method
zmq.backend.cython._zmq.Context.get(option:C.int)Get the value of a context option.
method
zmq.backend.cython._zmq.Context.set(option:C.int, optval)Set a context option.
method
zmq.backend.cython._zmq.Context.term()Close or terminate the context.
method
zmq.backend.cython._zmq.Frame.buffer()A memoryview of the message contents.
method
zmq.backend.cython._zmq.Frame.get(option)Get a Frame option or property.
method
zmq.backend.cython._zmq.Frame.set(option, value)Set a Frame option.
class
zmq.backend.cython._zmq.SocketA 0MQ socket.
method
zmq.backend.cython._zmq.Socket.bind(addr:str | bytes)Bind the socket to an address.
method
zmq.backend.cython._zmq.Socket.close(linger:int | None=None)Close the socket.
method
zmq.backend.cython._zmq.Socket.closed()Whether the socket is closed
method
zmq.backend.cython._zmq.Socket.connect(addr:str | bytes) -> NoneConnect to a remote 0MQ socket.
method
zmq.backend.cython._zmq.Socket.get(option:C.int)Get the value of a socket option.
method
zmq.backend.cython._zmq.Socket.join(group:str | bytes)Join a RADIO-DISH group Only for DISH sockets.
method
zmq.backend.cython._zmq.Socket.monitor(addr:str | bytes | None, events:C.int=ZMQ_EVENT_ALL)Start publishing socket events on inproc.
method
zmq.backend.cython._zmq.Socket.recv(flags=0, copy:bint=True, track:bint=False)Receive a message.
method
zmq.backend.cython._zmq.Socket.set(option:C.int, optval)Set socket options.
method
zmq.backend.cython._zmq.Socket.unbind(addr:str | bytes)Unbind from an address (undoes a call to bind).
func
zmq.backend.cython._zmq.free_python_msg(data:p_void, vhint:p_void) -> C.intA pure-C function for DECREF'ing Python-owned message data.
func
zmq.backend.cython._zmq.has(capability:str) -> boolCheck for zmq capability by name (e.g.
func
zmq.backend.cython._zmq.monitored_queue(in_socket:Socket, out_socket:Socket, mon_socket:Socket, in_prefix:bytes=b'in', out_prefix:bytes=b'out')Start a monitored queue device.
func
zmq.backend.cython._zmq.strerror(errno:C.int) -> strReturn the error string given the error number.
func
zmq.backend.cython._zmq.zmq_errno() -> C.intReturn the integer errno of the most recent zmq error.
func
zmq.backend.select.select_backend(name:str) -> dictSelect the pyzmq backend
class
zmq.constants.ContextOptionOptions for Context.get/set ..
class
zmq.constants.DeviceTypeDevice type constants for zmq.device ..
class
zmq.constants.Errnolibzmq error codes ..
class
zmq.constants.EventSocket monitoring events ..
class
zmq.constants.FlagSend/recv flags ..
class
zmq.constants.MessageOptionOptions on zmq.Frame objects ..
class
zmq.constants.NormModeValues for zmq.NORM_MODE socket option ..
class
zmq.constants.PollEventWhich events to poll for in poll methods ..
class
zmq.constants.ReconnectStopSelect behavior for socket.reconnect_stop ..
class
zmq.constants.RouterNotifyValues for zmq.ROUTER_NOTIFY socket option ..
class
zmq.constants.SocketOptionOptions for Socket.get/set ..
class
zmq.constants.SocketTypezmq socket types ..
func
zmq.decorators.socket(*args, **kwargs)Decorator for adding a socket to a function.
class
zmq.devices.basedevice.DeviceA 0MQ Device to be run in the background.
method
zmq.devices.basedevice.Device.bind_in(addr:str) -> NoneEnqueue ZMQ address for binding on in_socket.
method
zmq.devices.basedevice.Device.bind_out(addr:str) -> NoneEnqueue ZMQ address for binding on out_socket.
method
zmq.devices.basedevice.Device.connect_in(addr:str) -> NoneEnqueue ZMQ address for connecting on in_socket.
method
zmq.devices.basedevice.Device.connect_out(addr:str)Enqueue ZMQ address for connecting on out_socket.
method
zmq.devices.basedevice.Device.join(timeout:Optional[float]=None) -> Nonewait for me to finish, like Thread.join.
method
zmq.devices.basedevice.Device.run() -> Nonewrap run_device in try/catch ETERM
method
zmq.devices.basedevice.Device.run_device() -> NoneThe runner method.
method
zmq.devices.basedevice.Device.start() -> NoneStart the device.
class
zmq.devices.basedevice.ProcessDeviceA Device that will be run in a background Process.
class
zmq.devices.basedevice.ThreadDeviceA Device that will be run in a background Thread.
class
zmq.devices.monitoredqueuedevice.MonitoredQueueClass for running monitored_queue in the background.
class
zmq.devices.monitoredqueuedevice.MonitoredQueueBaseBase class for overriding methods.
class
zmq.devices.monitoredqueuedevice.ProcessMonitoredQueueRun zmq.monitored_queue in a separate process.
class
zmq.devices.monitoredqueuedevice.ThreadMonitoredQueueRun zmq.monitored_queue in a background thread.
class
zmq.devices.proxydevice.ProcessProxyProxy in a Process.
class
zmq.devices.proxydevice.ProxyThreadsafe Proxy object.
class
zmq.devices.proxydevice.ProxyBaseBase class for overriding methods.
class
zmq.devices.proxydevice.ThreadProxyProxy in a Thread.
class
zmq.devices.proxysteerabledevice.ProcessProxySteerableProxySteerable in a Process.
class
zmq.devices.proxysteerabledevice.ProxySteerableClass for running a steerable proxy in the background.
class
zmq.devices.proxysteerabledevice.ProxySteerableBaseBase class for overriding methods.
class
zmq.devices.proxysteerabledevice.ThreadProxySteerableProxySteerable in a Thread.
class
zmq.error.AgainWrapper for zmq.EAGAIN ..
class
zmq.error.ContextTerminatedWrapper for zmq.ETERM ..
class
zmq.error.DraftFDWarningWarning for using experimental FD on draft sockets.
class
zmq.error.ZMQBaseErrorBase exception class for 0MQ errors in Python.
class
zmq.error.ZMQBindErrorAn error for ``Socket.bind_to_random_port()``.
class
zmq.error.ZMQErrorWrap an errno style error.
class
zmq.eventloop._deprecated.DelayedCallbackSchedules the given callback to be called once.
method
zmq.eventloop._deprecated.DelayedCallback.start()Starts the timer.
class
zmq.eventloop._deprecated.ZMQPollerA poller that can be used in the tornado IOLoop.
method
zmq.log.handlers.TopicLogger.log(level, topic, msg, *args, **kwargs)Log 'msg % args' with level and topic.
method
zmq.sugar.context.Context.getsockopt(opt:int) -> OptValTget default socket options for new sockets created by this Context ..
method
zmq.sugar.context.Context.instance(io_threads:int=1) -> _ContextTypeReturns a global Context instance.
method
zmq.sugar.context.Context.setsockopt(opt:int, value:Any) -> Noneset default socket options for new sockets created by this Context ..
method
zmq.sugar.context.Context.socket(socket_type:int, socket_class:Callable[[_ContextType, int], _SocketType] | None=None, **kwargs:Any) -> _SocketTypeCreate a Socket associated with this Context.
method
zmq.sugar.context.Context.term() -> NoneClose or terminate the context.
func
zmq.sugar.device(device_type:DeviceType, frontend:socket.Socket, backend:socket.Socket)Deprecated alias for zmq.proxy ..
method
zmq.sugar.frame.Frame.group()The RADIO-DISH group of the message.
class
zmq.sugar.poll.PollerA stateful poll interface that mirrors Python's built-in poll.
method
zmq.sugar.poll.Poller.poll(timeout:int | None=None) -> list[tuple[Any, int]]Poll the registered 0MQ or native fds for I/O.
method
zmq.sugar.poll.Poller.unregister(socket:Any)Remove a 0MQ socket or native fd for I/O monitoring.
method
zmq.sugar.socket.Socket.bind(addr:str) -> _SocketContext[_SocketType]s.bind(addr) Bind the socket to an address.
method
zmq.sugar.socket.Socket.bind_to_random_port(addr:str, min_port:int=49152, max_port:int=65536, max_tries:int=100) -> intBind this socket to a random port in a range.
method
zmq.sugar.socket.Socket.close(linger=None) -> NoneClose the socket.
method
zmq.sugar.socket.Socket.connect(addr:str) -> _SocketContext[_SocketType]s.connect(addr) Connect to a remote 0MQ socket.
method
zmq.sugar.socket.Socket.fileno() -> intReturn edge-triggered file descriptor for this socket.
method
zmq.sugar.socket.Socket.get_hwm() -> intGet the High Water Mark.
method
zmq.sugar.socket.Socket.get_string(option:int, encoding='utf-8') -> strGet the value of a socket option.
method
zmq.sugar.socket.Socket.poll(timeout:int | None=None, flags:int=zmq.POLLIN) -> intPoll the socket for events.
method
zmq.sugar.socket.Socket.recv_json(flags:int=0, **kwargs) -> _JSONTypeReceive a Python object as a message using json to serialize.
method
zmq.sugar.socket.Socket.recv_pyobj(flags:int=0) -> AnyReceive a Python object as a message using UNSAFE pickle to serialize.
method
zmq.sugar.socket.Socket.recv_string(flags:int=0, encoding:str='utf-8') -> strReceive a unicode string, as sent by send_string.
method
zmq.sugar.socket.Socket.send_json(obj:Any, flags:int=0, **kwargs) -> NoneSend a Python object as a message using json to serialize.
method
zmq.sugar.socket.Socket.set_hwm(value:int) -> NoneSet the High Water Mark.
method
zmq.sugar.socket.Socket.set_string(option:int, optval:str, encoding='utf-8') -> NoneSet socket options with a unicode object.
method
zmq.sugar.socket.Socket.subscribe(topic:str | bytes) -> NoneSubscribe to a topic Only for SUB sockets.
method
zmq.sugar.socket.Socket.unsubscribe(topic:str | bytes) -> NoneUnsubscribe from a topic Only for SUB sockets.
class
zmq.sugar.tracker.MessageTrackerA class for tracking if 0MQ is done using one or more messages.
func
zmq.sugar.version.pyzmq_version() -> strreturn the version of pyzmq as a string
func
zmq.sugar.version.zmq_version() -> strreturn the version of libzmq as a string
class
zmq.utils.garbage.GarbageCollectorThreadThread in which garbage collection actually happens.
func
zmq.utils.jsonapi.dumps(o:object, **kwargs:Any) -> bytesSerialize object to JSON bytes (utf-8).
func
zmq.utils.jsonapi.loads(s:bytes | str, **kwargs:Any) -> dict[str, Any] | list[Any] | str | floatLoad object from JSON bytes (utf-8).
func
zmq.utils.monitor.parse_monitor_message(msg:list[bytes]) -> _MonitorMessagedecode zmq_monitor event messages.
func
zmq.utils.strtypes.cast_bytes(s:str | bytes, encoding:str='utf8', errors:str='strict') -> bytescast str or bytes to bytes
func
zmq.utils.strtypes.cast_unicode(s:str | bytes, encoding:str='utf8', errors:str='strict') -> strcast bytes or str to str
class
zmq.utils.win32.allow_interruptUtility for fixing CTRL-C events on Windows.
func
zmq.utils.z85.decode(z85bytes:str | _RawBytes) -> bytesdecode Z85 bytes to raw bytes, accepts ASCII string
func
zmq.utils.z85.encode(rawbytes:_RawBytes) -> bytesencode raw bytes into Z85
func
zmqversion.include_dirs_from_path()Check the exec path for include dirs.
func
zmqversion.ver_str(version)version tuple as string
About this data
These signatures were extracted from the public source of zeromq/pyzmq
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.