lamindb.Folder#

class lamindb.Folder(path: Optional[Union[Path, UPath, str]] = None, *, id: Optional[str] = None, name: Optional[str] = None, key: Optional[str] = None, storage_id: Optional[str] = None, files: List[File] = [])#

Bases: BaseORM

Folders: collections of files.

Real vs. virtual folders:

  • A real LaminDB Folder has a 1:1 correspondence to a folder on a file system or in object storage, and a .key that is not None.

  • A virtual LaminDB Folder is a mere way of grouping files. A file can be linked to multiple virtual folders, but only to one real folder.

Attributes

id: str#
name: str#
key: Optional[str]#
storage_id: Optional[str]#

Storage root id.

created_by_id: str#
created_at: datetime#
updated_at: Optional[datetime]#
created_by: User#
files: List[File]#

File.

Methods

path()#

Path on storage.

Return type:

Union[Path, UPath]

subset(*, prefix, **fields)#

Get files via relative path to folder.

Return type:

List[File]

tree(level=-1, limit_to_directories=False, length_limit=1000)#

Print a visual tree structure.

Return type:

None