API reference

class ftrack_sftp_accessor.sftp.SFTPAccessor(host, username, port=22, password=None, folder=None)[source]

Provide SFTP location access.

__init__(host, username, port=22, password=None, folder=None)[source]

Initialise location accessor.

Uses the server credentials specified by host, password, port and password to create a sftp connection.

If specified, folder indicates the subfolder where assets are stored

exists(resource_identifier)[source]

Return if resource_identifier is valid and exists in location.

get_container(resource_identifier)[source]

Return resource_identifier of container for resource_identifier.

Raise AccessorParentResourceNotFoundError if container of resource_identifier could not be determined.

get_url(resource_identifier=None)[source]

Return url for resource_identifier.

is_container(resource_identifier)[source]

Return whether resource_identifier refers to a container.

is_file(resource_identifier)[source]

Return whether resource_identifier refers to a file.

is_sequence(resource_identifier)[source]

Return whether resource_identifier refers to a file sequence.

list(resource_identifier)[source]

Return list of entries in resource_identifier container.

Each entry in the returned list should be a valid resource identifier.

Raise AccessorResourceNotFoundError if resource_identifier does not exist or AccessorResourceInvalidError if resource_identifier is not a container.

make_container(resource_identifier, recursive=True)[source]

Make a container at resource_identifier.

If recursive is True, also make any intermediate containers.

open(resource_identifier, mode='rb')[source]

Return Data for resource_identifier.

remove(resource_identifier)[source]

Remove resource_identifier.

Raise AccessorResourceNotFoundError if resource_identifier does not exist.

property sftp

Return SFTP resource.

property ssh

Return SSH resource.