ftrack_api.resource_identifier_transformer.base

class ftrack_api.resource_identifier_transformer.base.ResourceIdentifierTransformer(session)[source]

Transform resource identifiers.

Provide ability to modify resource identifier before it is stored centrally (encode()), or after it has been retrieved, but before it is used locally (decode()).

For example, you might want to decompose paths into a set of key, value pairs to store centrally and then compose a path from those values when reading back.

Note

This is separate from any transformations an ftrack_api.accessor.base.Accessor may perform and is targeted towards common transformations.

__init__(session)[source]

Initialise resource identifier transformer.

session should be the ftrack_api.session.Session instance to use for communication with the server.

encode(resource_identifier, context=None)[source]

Return encoded resource_identifier for storing centrally.

A mapping of context values may be supplied to guide the transformation.

decode(resource_identifier, context=None)[source]

Return decoded resource_identifier for use locally.

A mapping of context values may be supplied to guide the transformation.