singlestoredb.management.workspace.StageObject

class singlestoredb.management.workspace.StageObject(name: str, path: str, size: int, type: str, format: str, mimetype: str, created: datetime | None, last_modified: datetime | None, writable: bool, content: List[str] | None = None)

Stage file / folder object.

This object is not instantiated directly. It is used in the results of various operations in WorkspaceGroup.stage methods.

__init__(name: str, path: str, size: int, type: str, format: str, mimetype: str, created: datetime | None, last_modified: datetime | None, writable: bool, content: List[str] | None = None)

Methods

__init__(name, path, size, type, format, ...)

abspath()

Return the full path of the object.

basename()

Return the basename of the object.

dirname()

Return the directory name of the object.

download([local_path, overwrite, encoding])

Download the content of a stage path.

download_file([local_path, overwrite, encoding])

Download the content of a stage path.

exists()

Does the file / folder exist?

from_dict(obj, stage)

Construct a StageObject from a dictionary of values.

getctime()

Return the creation datetime as a UNIX timestamp.

getmtime()

Return the last modified datetime as a UNIX timestamp.

is_dir()

Is the stage object a directory?

is_file()

Is the stage object a file?

open([mode, encoding])

Open a Stage path for reading or writing.

remove()

Delete the stage file.

removedirs()

Delete the stage directory recursively.

rename(new_path, *[, overwrite])

Move the stage file to a new location.

rmdir()

Delete the empty stage directory.

Attributes

name

Name of file / folder

path

Path of file / folder

size

Size of the object (in bytes)

type

file or directory

format

Data format

mimetype

Mime type

created_at

Datetime the object was created

last_modified_at

Datetime the object was modified last

writable

Is the object writable?

content

Contents of a directory