def set_namespace_aliases(prefix="qLib::", alias=True, verbose=False):

	if type(prefix) is list:
		for p in prefix: set_namespace_aliases(p)
		return

	assert "::" in prefix, "Include trailing '::' characters in prefix"

	cmds = []
	for file in hou.hda.loadedFiles():

		names = [ (d.nodeType().name(), d.nodeTypeCategory().name()) \
			for d in list(hou.hda.definitionsInFile(file)) \
			if prefix in d.nodeType().name() ]

		for n in names:

			try:
				# strip namespace prefix and version suffix
				old = re.sub("^[^:]+::", "", n[0])
				old = re.search("^[^:]+", old).group(0)	

				# opalias <network> <namespaced-op.> <plain-old-op.>
				cmd = "opalias %s %s %s" % (n[1], n[0], old)

				if cmd not in cmds:
					if verbose: print cmd
					if alias: hou.hscript(cmd)
					cmds.append(cmd)
				else:
					print "# ALREADY ALIASED: %s (%s)" % (cmd, file)

			except:
				print "ERROR: %s" % traceback.format_exc()
Defines (non-)namespaced aliases for operators with a particular namespace prefix.
dataset/ETHPy150Open qLab/qLib/scripts/python/qlibutils.py/set_namespace_aliases