Pyro5.nameserver — Pyro name server

Name Server and helper functions.

Pyro5.nameserver.start_ns(host=None, port=None, enableBroadcast=True, bchost=None, bcport=None, unixsocket=None, nathost=None, natport=None, storage=None)

utility fuction to quickly get a Name server daemon to be used in your own event loops. Returns (nameserverUri, nameserverDaemon, broadcastServer).

Pyro5.nameserver.start_ns_loop(host=None, port=None, enableBroadcast=True, bchost=None, bcport=None, unixsocket=None, nathost=None, natport=None, storage=None)

utility function that starts a new Name server and enters its requestloop.

class Pyro5.nameserver.NameServer(storageProvider=None)

Pyro name server. Provides a simple flat name space to map logical object names to Pyro URIs. Default storage is done in an in-memory dictionary. You can provide custom storage types.

count()

Returns the number of name registrations.

list(prefix=None, regex=None, return_metadata=False)

Retrieve the registered items as a dictionary name-to-URI. The URIs in the resulting dict are strings, not URI objects. You can filter by prefix or by regex.

lookup(name, return_metadata=False)

Lookup the given name, returns an URI if found. Returns tuple (uri, metadata) if return_metadata is True.

ping()

A simple test method to check if the name server is running correctly.

register(name, uri, safe=False, metadata=None)

Register a name with an URI. If safe is true, name cannot be registered twice. The uri can be a string or an URI object. Metadata must be None, or a collection of strings.

remove(name=None, prefix=None, regex=None)

Remove a registration. returns the number of items removed.

set_metadata(name, metadata)

update the metadata for an existing registration

yplookup(meta_all=None, meta_any=None, return_metadata=True)

Do a yellow-pages lookup for registrations that have all or any of the given metadata tags. By default returns the actual metadata in the result as well.