Skip to content

identifier.py

ofrak.component.identifier

Identifier (AbstractComponent, ABC)

Identifiers are components that tag resources with specific resource tags.

identify(self, resource, config) async

Perform identification on the given resource.

Users should not call this method directly; rather, they should run Resource.identify.

Parameters:

Name Type Description Default
resource Resource required
config ~CC

Optional config for identifying. If an implementation provides a default, this default will always be used when config would otherwise be None. Note that a copy of the default config will be passed, so the default config values cannot be modified persistently by a component run.

required
Source code in ofrak/component/identifier.py
@abstractmethod
async def identify(self, resource: Resource, config: CC) -> None:
    """
    Perform identification on the given resource.

    Users should not call this method directly; rather, they should run
    [Resource.identify][ofrak.resource.Resource.identify].

    :param resource:
    :param config: Optional config for identifying. If an implementation provides a default,
    this default will always be used when config would otherwise be None. Note that a copy of
    the default config will be passed, so the default config values cannot be modified
    persistently by a component run.
    """
    raise NotImplementedError()

IdentifierError (RuntimeError)

Base exception raised by identifiers.