sadrive.commands.delete module#

Provides CLI commands for deleting files and folders from Google Drive and updating the local database accordingly. Supports recursive folder deletion and full cleanup of all service-account drives.

Functions: - del_file: Remove a single file from Drive and database. - del_folder: Recursively delete a folder and its contents.

Commands: - delete(fileid): Delete a specific file or folder by ID. - clearall(): Wipe all files across all service accounts and reset DB.

sadrive.commands.delete.del_file(sa_num: str, file_id: str)[source]#

Deletes a single file from Google Drive and removes its record from the DB.

Parameters:
  • sa_num – Service account number owning the file.

  • file_id – Drive file ID to delete.

sadrive.commands.delete.del_folder(sa_num: str, file_id: str)[source]#

Recursively deletes all contents of a folder in Drive and the database, then deletes the folder itself.

Parameters:
  • sa_num – Service account number owning the folder.

  • file_id – Drive folder ID to delete.