dlt.common.storages.fsspecs.google_drive
GoogleDriveFileSystem Objects
class GoogleDriveFileSystem(AbstractFileSystem)
__init__
def __init__(credentials: GcpCredentials = None,
trash_delete: bool = True,
access: Optional[Literal["full_control",
"read_only"]] = "full_control",
spaces: Optional[Literal["drive", "appDataFolder",
"photos"]] = "drive",
**kwargs: Any)
Google Drive as a file-system.
The gdrive url has following format: gdrive://<root_file_id>/<file_path> Where <root_file_id> is a file id of the folder where the <file_path> is present.
Google Drive provides consistency when file ids are used. Changes are reflected immediately. In case of listings (ls) the consistency is eventual. Changes are reflected with a delay. As ls is used to retrieve file id from file name, we will be unable to build consistent filesystem with google drive API. Use this with care.
Based on original fsspec Google Drive implementation: https://github.com/fsspec/gdrivefs
Arguments:
credentials
GcpCredentials - Google Service credentials. If not provided, anonymous credentials are usedtrash_delete
bool - If True sends files to trash on rm. If False, deletes permanently. Note that permanent delete is not available for shared drives access (Optional[Literal["full_control", "read_only"]]): One of "full_control", "read_only". spaces (Optional[Literal["drive", "appDataFolder", "photos"]]): Category of files to search, can be 'drive', 'appDataFolder' and 'photos'. Of these, only the first is general. **kwargs: Passed to the parent.