Skip to content

register

Canonical path: o6.ns.register

register

register(
    shortname,
    uri,
    *,
    scope=None,
    version=None,
    publicationDate=None
)

Register a namespace and return its namespace module.

Registering the same shortname again with identical metadata returns the existing module, so this is idempotent. A missing publication date is filled in on a repeat call.

Parameters:

Name Type Description Default
shortname str

Short name to register the namespace under, and the attribute it becomes on o6.ns.

required
uri str

Namespace URI as published by the model.

required
scope str | None

Registration scope, to separate identically named namespaces. Defaults to the global scope.

None
version str | None

Model version string.

None
publicationDate str | None

Publication date declared by the model.

None

Returns:

Type Description
NamespaceModule

The NamespaceModule for this namespace.

Raises:

Type Description
ValueError

The shortname is already registered for a different URI, scope, or version.