FileItem (autotransform.item.file)

The implementation for the FileItem.

class autotransform.item.file.FileItem(*, key: str, extra_data: Optional[Dict[str, Any]] = None)

Bases: Item

An item representing a file that can be used by AutoTransform. Provides some utility methods for interacting with the file.

name

The name of the component.

Type:

ClassVar[ItemName]

get_content() str

Gets the content of the file.

Returns:

The file’s content.

Return type:

str

get_path() str

Gets the path of the file.

Returns:

The file’s path.

Return type:

str

name: ClassVar[ItemName] = 'file'
write_content(content: str) None

Writes new content to the file.

Parameters:

content (str) – The new content for the File.