Search¶

class tekdrive.models.Search(tekdrive: TekDrive)¶

Provides various methods to help with searching for TekDrive files and folders.

files(*, name: Optional[str] = None, limit: Optional[int] = 100, folder_id: [<class 'str'>] = None, silo: Optional[str] = None, depth: Optional[int] = 1, file_type: Optional[List[str]] = None, upload_state: Optional[List[str]] = None, order_by: Optional[List[str]] = None, include_trashed: bool = False) → Iterator[tekdrive.models.drive.file.File]¶

Convenience method for files search.

Parameters
  • limit – Total limit for returned results.

  • name – File name to match on. Case insensitive.

  • folder_id – Unique ID of folder to perform search within.

  • silo – Name of the silo to perform the search within. Values: "SHARES" or "PERSONAL".

  • depth – How many levels deep to perform search when specifying a folder_id or silo.

  • file_type – Limit results to files matching the given file type(s).

  • upload_state – Limit results to files in the given upload state(s).

Examples

Get up to 50 WFM files:

results = td.search.files(file_type="WFM", limit=50)
Returns

Iterator [ File ]

folders(*, name: Optional[str] = None, limit: Optional[int] = 100, folder_id: [<class 'str'>] = None, silo: Optional[str] = None, depth: Optional[int] = 1, order_by: Optional[List[str]] = None, include_trashed: bool = False) → Iterator[tekdrive.models.drive.folder.Folder]¶

Convenience method for folders search.

Parameters
  • limit – Total limit for returned results.

  • silo – Name of the silo to perform the search within. Values: "SHARES" or "PERSONAL".

  • name – Folder name to match on. Case insensitive.

  • folder_id – Unique ID of folder to perform search within.

  • depth – How many levels deep to perform search when specifying a folder_id or silo.

Examples

Get up to 10 folders with a name like "team_":

results = td.search.folders(name="team_", limit=10)
Returns

Iterator [ Folder ]

query(*, name: Optional[str] = None, limit: Optional[int] = 100, folder_id: [<class 'str'>] = None, silo: Optional[str] = None, depth: Optional[int] = 1, file_type: Optional[List[str]] = None, include_files: bool = True, include_folders: bool = True, upload_state: Optional[List[str]] = None, order_by: Optional[List[str]] = None, include_trashed: bool = False) → Iterator[Union[tekdrive.models.drive.file.File, tekdrive.models.drive.folder.Folder]]¶

Execute search for files and/or folders matching the provided criteria. A global search will be performed by default unless a folder_id or silo is provided.

Parameters
  • limit – Total limit for returned results.

  • name – File/Folder name to match on. Case insensitive.

  • folder_id – Unique ID of folder to perform search within.

  • depth – How many levels deep to perform search when specifying a folder_id or silo.

  • silo – Name of the silo to perform the search within. Values: "SHARES" or "PERSONAL".

  • file_type – Limit results to files matching the given file type(s).

  • include_files – Include files in the search results? Default: True.

  • include_folders – Include folders in the search results? Default: True.

  • upload_state – Limit results to files in the given upload state(s).

  • include_trashed – Include files and folders in the trashcan.

Examples

Get files with name like "project1":

results = td.search.query(name="project1", include_folders=False)
Returns

Iterator [ Union [ File , Folder ] ]

TekDrive SDK

TekDrive logo

Navigation

Quickstart

  • Installation
  • Usage Overview

Code Overview

  • Models
  • Search
  • Trashcan
  • Tree
  • User

  • TekDrive Home

Related Topics

  • Documentation overview
    • Previous: User
    • Next: Trashcan

Quick search

©2021 TEKTRONIX, INC. | Powered by Sphinx 3.4.3 & Alabaster 0.7.12 | Page source